Exploring the Depths of Push Protocol Smart Contracts

Exploring the Depths of Push Protocol Smart Contracts

Introduction

What is Push?

Push Protocol, is a decentralized communication and notification system for Web3. The protocol allows dApps, smart contracts, backends, or other protocols to communicate both on-chain and off-chain across multiple blockchain networks in a gasless and platform-agnostic manner. Our current suite of products includes Push Notifications, Push Chat, Group Chat, NFT Chat, and Push Video, all aimed at enhancing interaction within the Web3 ecosystem

Push Smart Contract

For the protocol to be chain-agnostic as well as truly decentralized, Push smart contracts play a major role.

The Push smart contracts are divided into two different smart contracts — Push Core & Push Communicator.

  1. Push Core

  2. Push Communication a.k.a (Push Comm)

Push Core Contract

The Push Core protocol, as its name suggests, serves as the central smart contract responsible for managing critical functions, including the creation of channels, governance, modifications to channel states, fund management, and incentive mechanisms, among other essential features.

  1. The leading Smart Contact handles all core functionalities like channel creation, governance, channel state change as well as fund and incentives mechanisms, etc.

  2. Push Core Smart Contract is Deployed on Ethereum Blockchain and not any other chain.

Push Core smart contract can only be deployed on the Ethereum blockchain and not on any other chain.

Push Core smart contracts are all upgradable and follow ERC-1967 transparent upgradable proxy.

Channels

For any user service, product, or protocol seeking to function as a service for sending notifications or engaging with their users, it is necessary to initiate the process by creating Channels within the Push Core smart contract.

A Few impertive pionters on Channels

  1. It must be noted that channel creation only happens on the Ethereum Chain.

  2. one wallet address can create one channel only on the protocol.

  3. A channel can have the following states at any given time

    1. Inactive

    2. Activated

    3. Deactivated

    4. Blocked

  4. Creation of a channel requires 50 $PUSH tokens.

Fund and Fee Pool in Core Contract

State variables within the core contract are specifically crafted to monitor and record incoming funds.

//@notice Necessary variables for Keeping track of Funds and Fees
    uint256 public CHANNEL_POOL_FUNDS;
    uint256 public PROTOCOL_POOL_FEES;
    uint256 public ADD_CHANNEL_MIN_FEES;
    uint256 public FEE_AMOUNT;
    uint256 public MIN_POOL_CONTRIBUTION;

NOTE: All imperative actions or transactions in the Push Core Contract require the native $PUSH tokens.

CHANNEL_POOL_FUNDS This variable is responsible for tracking the $PUSH tokens that channel owners can claim when they deactivate or delete a channel. It receives the PUSH tokens remaining after deducting PROTOCOL_POOL_FEES from the amount a user sends when creating or reactivating a channel. For example, if a user sends 50 tokens to create a channel, 10 tokens are set aside as PROTOCOL_POOL_FEES, and the remaining 40 tokens are added to CHANNEL_POOL_FUNDS.

PROTOCOL_POOL_FEES A small fee is subtracted by the core smart contract for essential transactions such as channel creation, reactivation, and channel detail modifications. Currently, this protocol fee is fixed at 10 PUSH tokens, but it can be adjusted through on-chain governance. This fee is deducted from the amount a channel creator chooses to stake in the protocol. For instance, if a user stakes 50 PUSH tokens during channel creation, 10 of those tokens are allocated to the Protocol Fee Pool, while the remainder is directed to the Channel Pool Funds, which can be claimed by channel owners upon deactivation.

ADD_CHANNEL_MIN_FEES This state variable sets the minimum required amount of PUSH tokens for creating or reactivating a channel. The current value for this variable is 50 PUSH tokens, and it can only be modified through on-chain governance using the setMinChannelCreationFees() function. The value can never be reduced below 50 PUSH tokens.

FEE_AMOUNT FEE_AMOUNT represents the fee charged to a channel owner when deactivating a channel. The current value for this state variable is 10 PUSH tokens, which can be adjusted only through on-chain governance using the setFeeAmount() function.

MIN_POOL_CONTRIBUTION is a constant value of 1 PUSH token used in calculating a channel's weight within the protocol. This amount is subtracted from the channel pool contribution when a channel is deactivated, and the remaining amount is refunded to the user.

Protocol Fees play a critical role in the incentivization mechanism of core Contracts.

  • for every crucial transaction on the core, it takes a small fee amount and stores it in what we call the Push Fee Pool

  • This Fee pool is the one that's used to incentivise users of the protocol through the stake-and-claim mechanism

  • It is worth noting that as the protocol expands its boundaries, the incentive available for users to claim from the contract also improves.

  • This eventually means that the more the protocol grows, the better the incentives for the users.

  • The direct correlation between protocol growth and user incentives creates a mutually beneficial relationship within the ecosystem.

Core V2 Smart Contract Staking

The staking feature allows $PUSH token holders to stake their token in the core contract and earn rewards from the Fee Pool directly.

Details about Push Fee Pool Staking :-

  1. It's an epoch-based staking.

  2. The distribution of rewards is split into epochs within which users can stake and earn.

  3. Each epoch is ~21Days Long(3 weeks long)

  4. $PUSH token holders can stake their tokens at any given time in the core v2 contract.

  5. $PUSH had time weightage built into the token which also goes live with this update. This means people who have held $PUSH tokens longer are rewarded more if they stake.

  6. Total claimable rewards at an epoch rely on the Fee Pool.

  7. The more $PUSH tokens accumulated by the protocol during an epoch, the more rewards for the stakes of the specific epoch.

Individual Component of Push V2 Staking :-

Push Communication Contract

The Push Communicator protocol differs from the Push Core smart contract in that it is intended for deployment on multiple blockchain networks. This flexibility is a key factor contributing to the lightweight nature of the communicator contract, and it reduces its dependence on Push Core.

The Push Communicator protocol is relatively straightforward in its design. It encompasses functionalities that enable users to perform actions such as subscribing to channels, unsubscribing from channels, and most importantly, sending notifications.

Since the communicator protocol can be implemented on different blockchain networks, it grants the capability to initiate notifications across a variety of chains, extending beyond the confines of the Ethereum blockchain.

  1. Designed to be deployed on Multiple Chains

  2. This is comparatively simpler, lightweight, and less reliant to push Core

  3. The main feature includes:

    1. sending notifications

    2. subscribing and unsubscribing channel

    3. incentivized chat features.

  4. Communication Contract supports Delegates For The Channels.

    • Channel delegates are additional wallets that the channel creators have authorised to send notifications on the channel's behalf.
  5. Comm Contract Supports ERC-1271

    • However, with the help of the EIP-1271 Standard, we have an effective Mechanism by which a contract can indicate whether a signature is valid or not on its behalf.
  6. Incentivized Chat Request

    • Incentivized Chat Request introduces an innovative chat setting that empowers users to customize their experience by implementing a one-time Fee in ($PUSH) token for individuals who wish to send them Push Chat requests.

    • This feature grants the user greater control over their chat interactions and enables them to monetize their engagement on the platform.

Push Communicator smart contracts are necessary to be deployed on any chain where notification directly from the smart contracts feature is enabled.

Push Smart Contracts Github Link

      git clone https://github.com/ethereum-push-notification-service/push-smart-contracts

Conclusion

In conclusion, the Push Protocol represents a significant advancement in the Web3 ecosystem, offering a decentralized communication and notification system that bridges the gap between blockchain networks in a gasless and platform-agnostic manner. With a suite of products including Push Notifications, Push Chat, Group Chat, NFT Chat, and Push Video, the protocol aims to enhance interaction within the Web3 space.

Key to the protocol's functionality are the Push smart contracts, specifically the Push Core and Push Communicator. Push Core, deployed exclusively on the Ethereum blockchain, acts as the central smart contract responsible for fundamental functions such as channel creation, governance, fund management, and incentive mechanisms. The use of $PUSH tokens is essential for all actions within this contract, providing the foundation for user incentives and growth.

In summary, Push Protocol presents a comprehensive and decentralized communication solution for the Web3 space, emphasizing the importance of smart contracts, $PUSH tokens, and user incentives in its growth and sustainability. Its flexibility and innovative features make it a promising player in the evolution of blockchain communication and interaction.