Decentralized applications (DApps) are becoming more popular every day, with many smart contracts that process transactions deployed to various blockchain networks in need of a notification system to track activities on the blockchain.
Push notifications have obviously been around for a while: simply, they provide the process of receiving messages from a server that triggers a pop-up on a client application that can have different forms for web, mobile, and desktop platforms.
Before the Ethereum push notification service (EPNS), there was no real way to achieve push notification functionalities on smart contracts and DApps.
While some wallets like Metamask notify users of every transaction carried out on their accounts, smart contract notifications were not previously really possible. But, in this post, we’ll cover the following to learn how EPNS works in DApps, including:
EPNS is a decentralized notification protocol that seamlessly gives Ethereum wallet addresses (or users) access to receive notifications for on-chain or off-chain activities.
With EPNS DApps, smart contracts and backend applications can send notifications to users in a platform-agnostic manner.
EPNS notifications are possible because of the open communication network, also called push nodes, which are tied to wallet addresses enabling crypto wallets, DApp frontends, and other services to display notifications to users.
EPNS also has a token called $PUSH that enables EPNS users to get incentives based on direct or indirect actions.
The EPNS protocol allows users to directly control what services they receive notifications from and imposes strict rules on the services, including spam protection for users.
Services that want to send notifications to their subscribers have to stake DAI. Interest earned during this process is distributed in portions to subscribers who opted to receive notifications. EPNS incentivizes both senders and receivers with usage rewards.
The EPNS protocol also enables retrievable information of every notification that enables universal notifications successively. It delivers notifications to any crypto wallets, mobile apps, web browsers, apps, or other platforms that integrate the protocol.
Channels incorporate a spam score that ranges from
0 means the channel has a good score and
1 means the channel is extremely unhealthy.
The protocol governance is intended to incentivize continued adoption of the EPNS protocol, which is achieved by providing incentives for all users involved.
EPNS is a protocol that has its own nodes (PUSH nodes) governed by the $PUSH token. PUSH nodes listen to events in the EPNS protocol smart contracts and send the notifications that are triggered by the events from corresponding recipients.
$PUSH tokens are used for governance in the EPNS ecosystem. The EPNS protocol provides incentives for users based on specific actions on the EPNS protocol, including subscribing to channels directly and indirectly, and users are given these incentives for participating in the EPNS protocol.
When token incentives are given to a user in the protocol, the user can claim them anytime. These token incentives are generated using AAVE aDAI (AAVE Interest Bearing DAI). The aDAI then converts to $PUSH tokens on withdrawal.
A $PUSH token has a total supply of 100,000,000, and only 100,000,000 will ever be created. The value of a $PUSH token at the time of writing is worth $1.13 and has a circulating supply of 15,287,926 (approximately 15%) of the total $PUSH tokens.
Push notifications are an integral feature in the Web2 ecosystem and became an important strategy for sending information to and retaining users. But, Web2 notifications are entirely created and prescribed by the applications themselves.
Users hardly have a choice about what kinds of notifications they wish to receive; they can either turn off an application notification or turn it on.
Decentralized notifications like EPNS, on the other hand, provide the Web3 ecosystem with the benefits of a robust and improved notification ecosystem without the centralized drawbacks of Web2 notifications.
To receive Web2 notifications, a user must install the app they wish to receive notifications from, or visit their website and accept their notification prompt.
With EPNS, a user can receive notifications from platforms, like Coindesk, without installing the app; all they do is opt into their channe, providing the user more power to decide what notifications they choose to receive.
Applications need better ways to communicate with users in real-time and event-initiated ways than platforms like Twitter, Discord, or email. Users also deserve an easier process of controlling what notifications they receive, and should benefit from Web3’s open-source nature.
Almost any application in the Web3 ecosystem can benefit from push notifications. Some of these types of DApps are:
When using EPNS in DeFi, notifications can be useful for lending protocol users. With this, users can set up notifications to be informed when their staked coins will liquidate. Instead of manually checking regularly, they can now receive seamless notifications.
DEX users can set up notifications to inform them when their trades complete instead of constantly checking back. EPNS enables them to get seamlessly notified; for instance, users can create notifications for when gas prices are favorable to help them decide when to trade.
Apps like the Ethereum Name Service (ENS) can notify users when their subscriptions are about to expire, rather than users checking regularly to remind themselves of expiration dates.
NFTs trading on marketplaces or goods within games can connect to EPNS to inform users when certain items go on sale or when auctions go live.
NFT artists can also receive notifications when a bid is made for their NFTs or topped as well as create notifications for their NFTs resale.
The EPNS solution is made of four modules: services, channels, users, and subscribers.
Services are addresses of DApps, wallet owners, or any Web3 service that wants to send notifications while channels are services that activate themselves on the EPNS protocol and can create notifications.
Users are Web3 participants that want to receive notifications about a DApp, wallet, or smart contract, and subscribers are users that elect to receive notifications from any particular channel and can select particular channels that send out specific notifications.
To integrate EPNS in your DApps, you must create an EPNS channel. You can do this on EPNS the DApp mainnet website or staging website. After visiting the website, follow these steps to create a channel.
First, you will be prompted to connect your crypto wallet (either Metamask, Ledger, or Portis since EPNS staging DApps only support the Kovan test network).
After connecting your wallet, click CREATE YOUR CHANNEL and upload the channel logo (the logo must have a dimension of 128px by 128px).
To activate the channel, you are required to stake DAI tokens to contribute to the interest-generating staking pool on AAVE.
50 DAI is the minimum stake fee and the more DAI that is staked, the more interest can be generated by a channel. Which, in turn, incentivizes subscribers (on staging, you receive 50 DAI for testing).
After staking the DAI, you can give your channel a name and description. Then click SETUP CHANNEL to activate it.
After creating a channel successfully you can integrate it into your DApp backend or frontend applications.
To integrate EPNS on your backend, you must first install the EPNS backend production or staging SDK:
npm install @epnsproject/backend-sdk for mainnet or
npm install @epnsproject/backend-sdk-staging for staging.
Next, copy the private key of the address used for creating the EPNS channel; you can find the code in this GitHub gist:
To integrate EPNS on your React frontend, you must install the EPNS frontend production or staging SDK with
npm install @epnsproject/backend-sdk for production or
npm install @epnsproject/backend-sdk-staging for testing or development.
Users can also subscribe to EPNS channels from a frontend application using the following code:
You can also use EPNS by downloading the app on your phone from the Google Playstore or Apple Appstore.
You can also use EPNS desktop and web apps, or download the EPNS web extension on your web browser, then connect your wallet(s) and select different channels based on which notifications you’d like to receive.
Push notifications are still a popular app feature for users, but with EPNS, this integral feature for Web3 provides users more control over notification settings, the notifications they wish to receive, and receive incentives for participation in the EPNS protocol.
EPNS has improved the current Web2 push notification protocol and Web3 users will greatly benefit from this solution. I hope every Web3 user uses EPNS for seamless notifications.
LogRocket is like a DVR for web and mobile apps, recording everything that happens in your web app or site. Instead of guessing why problems happen, you can aggregate and report on key frontend performance metrics, replay user sessions along with application state, log network requests, and automatically surface all errors.
Modernize how you debug web and mobile apps — Start monitoring for free.
ElectricSQL is a cool piece of software with immense potential. It gives developers the ability to build a true local-first application.
Leptos is an amazing Rust web frontend framework that makes it easier to build scalable, performant apps with beautiful, declarative UIs.
We spoke with Dom about his approach to balancing innovation with handling tech debt and to learn how he stays current with technology.