-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add EIP: Notification Interface #7017
Conversation
File
|
Co-authored-by: Andrew B Coathup <[email protected]>
Nice proposal.. we are definitely like minded on this topic :) Streamr would be happy to help or bring exposure to this initiative if you think it can help. We are a properly decentralized pub/sub network looking to bring to life more open comms/data use cases in Web3. Worth a look; EthWatch |
Deinetely interested in some exposure. I'm developing a chrome extension that would listen for contracts implementing EIP-7017 and notify users about the notifications of their interest. I unfortunately hit a big roadblock on that one. I'm also working on a discord BOT now. For this usecases a decentralized pub/sub network is definetely useful. I'm currently using Quicknode to get the alerts to the discord BOT service. Obiously this is all just a proof of concept and a way to test this initiative on a real-world scenario, but I would be glad to meet if you want, as I would be happy to see more projects jump on board. |
If its just subscribing to events then your could use the EthWatch stream - it's totally free to use and works in the browser/extension environment.
Sure, feel welcome to book some time - Calendly / or reach out to me at [email protected] |
A good idea could be to implement a singleton pattern, i.e. the INotification is implemented on a fixed address and all off-chain services have to query only this address. |
Specify how the body of a message could be structured and add an encription option to DMs
Yes! For wallets sending the notifications, there is really only one contract implementation of the events necesary. In the case of contracts sending the notifications, it would't work that well, as you need to know who has sent the notification in a straight forward way, and if the contract is calling another contract, then it's more complicated to see who the real sender is. Also, if the the contract has to send many notifications, I think it's cheaper to just emit an event than to call another contract that does it for you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend the following changes:
- Have a sister EIP to standardize encryption methods (so that DMMs to smart contracts can be encrypted).
- Require encryption. This seems like a no-brainer to me.
- Taking a book out of MMS, have the actual message parameter be a URI so the message data can be stored off-chain. If on-chain storage is desired, a
data:
URL can be used. The message parameter type would be changed tostring
, and the schema would be turned into an actual JSON schema.
Additionally, the following issues MUST be addressed:
- The message schema must be added to the Specification. It is only mentioned in the Rationale.
Also, improve grammar.
The commit 8eea6ba (as a parent of 0e1a785) contains errors. |
Also, highlight RFC 2119 key words
The only point that would be a bit outside my reach is the encryption method. I found that EIP-5630 addresses this problem and seems like a good match, but I wouldn't know if it is the best or even if it's an acceptable method. Also, it hasn't been approved as an EIP. I will be in contact with it's author to see if we can have a talk. Also, any further feedback would be appreciated. |
EIPS/eip-7017.md
Outdated
"subject": "The subject of the message", | ||
"body": "The body of the message", | ||
"image_uri": "An image URI", | ||
"transaction_request": "A transaction request" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks like you are missing indentations here. would recommend trying to match lines 151–154, and also clarifying how indentation/spacing should be handled in the JSONs.
EIPS/eip-7017.md
Outdated
emit BroadcastMsg (0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045, message); | ||
``` | ||
|
||
This is why the message sender in the log's topic must allways be verified against the transaction "from" or transaction "to", depending on the notification type (wallet or contract respectively). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after further discussion: this "advice" is now obsolete. it is up to the client-side application to listen only to contracts which make "sensible" choices as far as the meanings of from
and to
. in particular, there are various patterns which it might make sense for a contract to use, depending on the circumstance. it doesn't make sense to be prescriptive here.
after a conversation with Oliver, i have the following suggestions:
|
@Pandapip1 EIP-5630 seems to be the appropriate standard; I will collaborating with @Oli-art to get encryption incorporated into this EIP. |
Add EIP-5630 as the encryption requirement for all direct messages. Update the interface to not need the four functions and merged the two events into one common one for DMs and Broadcasts.
I took @firnprotocol 's suggestions into the last commit. Senders are not required to be either the contract or the address executing it, although I'm not entierly convinced on this topic and think we would do good by hearing the opinions of people working in the wallets and dApps. I'll ask for some meetings here and there to get more perspectives 👍 |
--- | ||
eip: 7017 | ||
title: Notification Interface | ||
description: A notifications interface for a more engaging blockchain |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your description doesn't really add any additional information over the title. You should try to expand on the ideas introduced on the title.
Perhaps something like:
description: A notifications interface for a more engaging blockchain | |
description: An event signature and JSON schema for broadcast and unicast notifications. |
Some usecases include but are not limited to: | ||
|
||
- DAO governance voting anouncement | ||
- DEX informing an address about a certain price limit being reached, for example a stop-loss or a margin-call. | ||
- An NFT marketplace informing an NFT owner about an offer being made to one of it’s NFTs. | ||
- A metaverse informing about an important event. | ||
- Warning to an address about an ENS domain expiration date approaching. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These use cases should be moved to the Motivation section.
The following standard allows addresses / smart contracts to send notifications one-to-one and one-to-many. | ||
|
||
It achieves it in a trustless and decentralized way and without requiring any on-chain interaction by the receivers. | ||
|
||
It requires a front-end implementation where the notifications are listened to, filtered and showed to the end user (address owner). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these should be combined into a single paragraph.
The following standard allows addresses / smart contracts to send notifications one-to-one and one-to-many. | |
It achieves it in a trustless and decentralized way and without requiring any on-chain interaction by the receivers. | |
It requires a front-end implementation where the notifications are listened to, filtered and showed to the end user (address owner). | |
The following standard allows addresses / smart contracts to send notifications one-to-one and one-to-many. It achieves it in a trustless and decentralized way and without requiring any on-chain interaction by the receivers. It requires a front-end implementation where the notifications are listened to, filtered and showed to the end user (address owner). |
It achieves it in a trustless and decentralized way and without requiring any on-chain interaction by the receivers. | ||
|
||
It requires a front-end implementation where the notifications are listened to, filtered and showed to the end user (address owner). | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to see a bit more about how this proposal works, technically, in the abstract.
|
||
## Motivation | ||
|
||
With the adoption of web3 applications, an increasing necessity arises to be informed about certain events happening on-chain. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about this wording instead:
With the adoption of web3 applications, an increasing necessity arises to be informed about certain events happening on-chain. | |
As the adoption of web3 applications grows, so too does the need to be informed about certain events happening on-chain. |
|
||
With the adoption of web3 applications, an increasing necessity arises to be informed about certain events happening on-chain. | ||
|
||
Users are used to being informed, whether it be about news or updates of their favorite applications. As we are in a time of instant data feeds on social media, instant messaging apps and notifications of events that users care about, notifications are a feature in practically every application that exists in web2. They mostly come to email inboxes, SMSs, inside the applications, or in the notification inbox in the operating system. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Users are used to being informed, whether it be about news or updates of their favorite applications. As we are in a time of instant data feeds on social media, instant messaging apps and notifications of events that users care about, notifications are a feature in practically every application that exists in web2. They mostly come to email inboxes, SMSs, inside the applications, or in the notification inbox in the operating system. | |
Users are accustomed to being informed, whether it be about news or updates of their favorite applications. As we are in a time of instant data feeds on social media, instant messaging apps and notifications of events that users care about, notifications are a feature in practically every application that exists in web2. They mostly come to email inboxes, SMSs, inside the applications, or in the notification inbox in the operating system. |
In web2, most of the user account’s are linked to an email address that is required at sign-up. This makes it easy to send notifications to specific users and requires no further complexity as an infrastructure exists to deliver a message to the user using their email address. | ||
|
||
In web3, on the other hand, there's mostly is only one inbox to send notifications to: addresses. | ||
Every smart contract can define its own event’s to which one can listen to, but for each of them, a change has to be done in the frontend to listen to that specific contract and event structure. This poses a problem of coordination between smart contracts and web3 applications that can notify users. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Every smart contract can define its own event’s to which one can listen to, but for each of them, a change has to be done in the frontend to listen to that specific contract and event structure. This poses a problem of coordination between smart contracts and web3 applications that can notify users. | |
Every smart contract can define its own events to which one can listen to, but for each of them, a change has to be done in the frontend to listen to that specific contract and event structure. This poses a problem of coordination between smart contracts and web3 applications that can notify users. |
|
||
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119. | ||
|
||
An approach that is both simple, decentralized and easy to implement is to use a notifications smart contract standard that is **event-based** to be able to emit notifications to one address or broadcast them to anyone that wants to listen. Off-chain **whitelists** would record all addresses a user wants to allow receiving messages from to avoid spam. This is useful for direct messages from one address to another. Off-chain **subscription lists** would indicate which addresses they want to listen for general broadcasts. This is useful for receiving updates on a project. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This paragraph introduces no requirements or recommendations for implementation. It should be split and moved to motivation and rationale as appropriate.
|
||
An approach that is both simple, decentralized and easy to implement is to use a notifications smart contract standard that is **event-based** to be able to emit notifications to one address or broadcast them to anyone that wants to listen. Off-chain **whitelists** would record all addresses a user wants to allow receiving messages from to avoid spam. This is useful for direct messages from one address to another. Off-chain **subscription lists** would indicate which addresses they want to listen for general broadcasts. This is useful for receiving updates on a project. | ||
|
||
As a user SHALL NOT record its whitelist and subscription list on-chain, the receiver will not do any transaction. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a bit more readable:
As a user SHALL NOT record its whitelist and subscription list on-chain, the receiver will not do any transaction. | |
Notification recipients SHALL NOT be required to record a whitelist and subscription list on-chain. |
Here is an example of a malitious implementation of a BroadcastMsg event impersonating Vitalik Buterin: | ||
|
||
```solidity | ||
emit BroadcastMsg (0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045, message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This event doesn't match one from the interface. Is that intentional?
I am closing this pull request because we are in the process of separating EIPs and ERCs into distinct repositories. Unfortunately, as far as we are aware, GitHub does not provide any tools to ease this migration, so every pull request will need to be re-opened manually. As this is a PR to create / modify an ERC, I will kindly ask you to redirect this to the new repository at ethereum/ERCs. We have prepared a guide to help with the process. If there is relevant history here, please link to this PR from the new pull request. On behalf of the EIP Editors, I apologize for this inconvenience. |
No description provided.