JustPush - Push notifications for the TRON Ecosystem

Project Name: JustPush


Project Track: Web3


Team Name: TeamPush
Team Member(s): @novax


DevPost URL:


Project Goal: Bring push Notifications for the Tron Ecosystem


Project Info:

JustPush

Docs Discord Chat License
JustPush brings notification capabilities to the TRON ecosystem.

The protocol consists of several components.

All these components were implemented in the hackathon timeframe after Sep20, 2022

Smart contracts

[github.com/justpush-protocol/contracts]

JustPush node

[github.com/justpush-protocol/node]

JustPush SDK

[github.com/justpush-protocol/sdk]

Dapp

[github.com/justpush-protocol/frontend]

Telegram Bot

[github.com/justpush-protocol/telegram-bot]

Discord Bot

[github.com/justpush-protocol/discord-bot]

JustPush makes the building of notification-enabled blockchain applications easy. It provides a set of tools such as Smart contracts SDKs, APIS, and a Dapp that allow developers to build notification-enabled applications in a matter of minutes.

These notifications are tied to a wallet address.

JustPush is built in a composability-first way. This means the method the end users receive notifications can be easily changed.

These can be mobile push notifications, email, SMS, telegram, discord, etc. We have built a telegram bot and discord bot that can be used to receive notifications. But the list of supported methods can be easily extended.


Project Website:
https://justpush.app (Dapp)
https://docs.justpush.app (Documentation)


Project Test Instructions:

Several things can be tested depending on the role you play.

Community Users

  • Go to our website: https://justpush.app
  • Subscribe to one of the Groups
  • Setup Telegram/Discord bots to receive notifications as explained here
  • You can even create a group with one account, subscribe it with another account and see if you can send and receive notifications

Developers / Ecosytem Projects

Try integrating your DAPP/Protocol to JustPush protocol so your users can get notifications :slight_smile:

All the steps are explained in the Project Details section here.

If you come across any issues, happy to help.


Project Details:
The process of integrating JustPush into a Dapp or service is as follows. The following guide also introduces concepts and design decisions behind JustPush.

Step 01: Create a Group

What are groups?

https://docs.justpush.app/concepts/groups

A Group is anyone who activates themselves as a service on the protocol to send notifications to its users.

Any service that wants to send notifications to their users can create a Group.Typically dApps in the Tron ecosystem will create a Group to send notifications to their users.

How to create a Group?

https://docs.justpush.app/developer-guides/create-group

There are several ways to create a group. The easiest way is to use the JustPush Dapp.

Step 02: Ask users to subscribe to your group

Why do they need to subscribe?

Imagine if anyone could send notifications to anyone. This would be a huge spam problem.

JustPush solves this problem by requiring users to subscribe to a group before they can receive notifications from that group.

How to ask users to subscribe?

https://docs.justpush.app/developer-guides/subscribe-to-groups

Users can subscribe to a group using the JustPush Dapp. But you can also ask them to subscribe to your group using your own UI by using the JustPush SDK.

You can also make your users subscribe to your group on -chain by calling JustPush smart contracts directly.

Step 03: Send notifications

https://docs.justpush.app/developer-guides/sending-notifications

What are the types of notifications?

There are two types of notifications. Broadcast and Direct. Broadcast notifications are sent to all users who have subscribed to a group. Direct notifications are sent to a specific user.

How to send notifications?

Group owners can send notifications to their users using the JustPush Dapp. This can be also done by using the JustPush SDK or by calling JustPush smart contracts directly.

Step 04: Recieve notifications

Subscribed users can receive notifications in a variety of ways. With the SDK, you can show notifications in your own UI, mobile app, service, etc.

For the scope of this hackathon, we have built a telegram bot and a discord bot that can be used to receive notifications. But the list of supported methods can be easily extended.


Contract address:
Mainnet: TMptrmkFrmvc3zHV7c62kHAFka44Ae5ob1


Project Milestones:

  • Smart Contracts: Done
  • SDK: Done
  • Frontend: Done
  • Telegram/Discord Bots: Done
  • Documentations : Done

Please note that the Groups listed in the DApp are for demonstration purposes only. You will not be getting notifications from the listed projects yet. But we are planning to bring the ecosystem projects towards the platform once the hackathon is over.

On the other hand, if you are representative of any of the listed projects (Sunswap, ApeNFT etc). Please reach out. We can give you ownership and guide you - so you can send notifications to your target audience easily.


20 Likes

Initial Concepts (work in progress)

Groups

A Group is anyone who activates themselves as a service on the protocol to send notifications to its users.

Typically dapps in the Tron ecosystem will create a Group to send notifications to their users.

  • The creation of a Group happens on the chain.
  • The group can have one owner but can have multiple delegated notifiers.

Ideally, in the future, there should be a fee or staking requirement (stake x amount JustPush TRC-20 governance tokens) to create a Group. But for the scope of the hackathon, anyone will be able to create a Group.

  • Users will be able to Subscribe to a Group free of charge to receive notifications.

Notifications

A Group that is successfully created and active can send notifications to its subscribers. These can be dapp notifications (ex: liquidation alerts), governance news, or anything that subscribers find valuable.

Who can send notifications?

  • Group owner
  • Delegated notifiers (a group owner can delegate the responsibility of sending notifications to other wallets)
  • User (only to themselves)
4 Likes

Some progress updates.

I have made the initial version of the contract.

The interface of the core contract looks like this. Please note, this is still a work in progress. And could be heavily modified later.

// SPDX-License-Identifier: MIT
pragma solidity 0.8.6;

interface IJustPushV1 {
    /**
     * @notice Initializes the protocol.
     * @param _justPushGovernance The address of the JustPush governance.
     */
    function initialize(address _justPushGovernance) external;

    /**
     * @notice Creates a new notification group.
     * @param _data A Json string that holds the group name, description, and other metadata.
     * @return groupId The id of the newly created group.
     */
    function createGroup(string memory _data)
        external
        returns (uint256 groupId);

    /**
     * @notice Updates the group data.
     * @param _groupId The id of the group.
     * @param _data A Json string that holds the group name, description, and other metadata.
     */
    function changeData(uint256 _groupId, string memory _data) external;

    /**
     * @notice Adds a new notifier to the group.
     * @param _groupId The id of the group.
     * @param _notifier The address of the notifier.
     */
    function addNotifier(uint256 _groupId, address _notifier) external;

    /**
     * @notice Removes a notifier from the group.
     * @param _groupId The id of the group.
     * @param _notifier The address of the notifier.
     */
    function disableNotifier(uint256 _groupId, address _notifier) external;

    /**
     * @notice Changes the group owner.
     * @param _groupId The id of the group.
     * @param _newOwner The address of the new owner.
     */
    function changeGroupOwner(uint256 _groupId, address _newOwner) external;

    /**
     * @notice Deactivates a group.
     * @param _groupId The id of the group.
     */
    function deactivateGroup(uint256 _groupId) external;

    /**
     * @notice Activates a group.
     * @param _groupId The id of the group.
     */
    function activateGroup(uint256 _groupId) external;

    /**
     * @notice Blocks a group.
     * @param _groupId The id of the group.
     */
    function blockGroup(uint256 _groupId) external;

    /**
     * @notice Verifies a group.
     * @param _groupId The id of the group.
     */
    function verifyGroup(uint256 _groupId) external;

    /**
     * @notice Unverifies a group.
     * @param _groupId The id of the group.
     */
    function unverifyGroup(uint256 _groupId) external;

    /**
     * @notice Verifies batch of groups.
     * @param _groupIds The ids of the groups.
     */
    function batchVerifyGroups(uint256[] memory _groupIds) external;

    /**
     * @notice Subscribes a user to a group.
     * @param _groupId The id of the group.
     */
    function subscribe(uint256 _groupId) external;

    /**
     * @notice Batch subscribe a user to multiple groups.
     * @param _groupIds The ids of the groups.
     */
    function batchSubscribe(uint256[] memory _groupIds) external;

    /**
     * @notice Batch unsubscribe a user from multiple groups.
     * @param _groupIds The ids of the groups.
     */
    function batchUnsubscribe(uint256[] memory _groupIds) external;
}

The implementation of these functions is also done. You can inspect them once the GitHub repository for the contracts is public (private right now, it will be made public nearby the submission date).


EDIT: November 3

The above-listed contract has been changed and heavily modified. The updated contract link will be posted in the first post soon.


3 Likes

Some feedback on the developer experience.

Tronweb needs to add typescript definitions - There are several issues in the GitHub repository goes back to 2020. And it hasn’t been added yet. :slightly_frowning_face:

Tronbox (which is based on Truffle) has to support typechain. I tried to use the truffle-typechain library with tronbox, but it doesn’t seem to work.

It would be great instead of truffle, someone can make it work with the much better hardhat library.

How will the users receive the push notifs? A tx for every notification? :thinking:

Justpush builts the tools and infrastructure (smart contracts, apis, sdks) need to facilitate web3 notifications in tron ecosystem. Ideally, how the end-user receives the notification entirely depends on which services integrate with the JustPush protocol.

For the scope of the hackathon - we will have a user interface where Tron users can opt-in and see the notifications they have subscribed.

If JustPush becomes one of the winners and if the community finds it useful - we can integrate this furthermore where users can get notifications in the wallet (tronlink for example) itself. By using the SDK/Apis - anyone in the community (or JustPush team) can build tools to receive the notifications by email, mobile push notifications, etc.


EDIT: November 3

There has been an update for the above response. On top of the above mentioned user interface, users of the JustPush now can receive notifications via Telegram and Discord.

On top of that, the SDK has the possibility to integrate with anything such as wallets, extensions, mobile apps etc.


1 Like

@bigplayah hope this answers your question.

1 Like

Update:

Working on some UI designs

Light Mode

Dark Mode

Please note: The groups listed in the screenshot (JustLend, Sunswap, WinkLink) are for demonstration purposes only. Ideally in the future, when JustPush is live and these dapps and services send notifications through JustPush - it'll look like this.


EDIT: November 3

The user interface has seen been updated even more. But the scope of the project is not to make pretty UIs. The objective is to make “building blocks” to support any sort of notifications on Tron. Dapps and services can integrate JustPush to their own UIs and Dapps with the tools.


1 Like

A lot of progress in the past week.

Let me get into some theory and design decisions.


JustPush NODES.

The interfaces that want to receive notifications can be wallets, mobiles, browser extensions, email, SMS messages, etc.

There needs to be something in the middle that can connect the smart contracts to these interfaces.
It is currently impossible to send push notifications, emails,s or SMS directly from the smart contract itself.

We call this middle man Nodes. This is a piece of software anyone can run to facilitate this.

nodes-structure

The node will carry out some important tasks.

  • Accept and dispatch notifications.
  • Provide an api for communication with the protocol
  • Listen to smart contract events
  • Cryptographically verifies the communications (eg: the send notifications operation is actually done by the owner of the group).

Initially, the nodes will be run by JustPush.


Feel free to ask any questions :slight_smile:

loved the idea, waiting for website :dizzy:

1 Like

Any update about this Push notifications project?

Push notifications are certainly missing feature. The key behind a push notification is that it alerts the an individual or group without them doing anything. Unpromted.
Is that the case with your idea here? Correct me if I am wrong, but it seems from what I am reading that for this particular tool, the end user would need to login to your platform to see all the notifications?
If so, that seems like it would end up being like an ad filled social media feed.

1 Like

You are correct about how push notifications are a key missing feature.

—-

Imagine if anyone can send you push notifications about anything to your wallet, email, extention, wallet etc.

This gives the opportunity for scammers to send you fake notifications and try to steal your coins.

On the other hand with this approach. You pick and choose what notifications (sunswap, justlend etc) you would like to receive by ‘opting’ in.

No, in future you don’t have to come to JustPush website to subscribe. With smart contracts or apis being developed by JustPush- the services itself will be able to allow their users to subscribe to their notifications without visiting any centralized website.
So, no. It will not be another ad filled social media.

But for the scope of the hackathon, to demonstrate what is possible with the protocol, apis, smart contracts there will be a website (and maybe more).

Hope that answers your question.

Some updates.

Smart Contracts,
API,
SDK,
Frontend,
Node

The above-listed items are near completion. But none of them are properly documented yet.

I’ve started working on proper developer documentation here.

I only just started documenting and it is in no way near completion. But before the submission date, everything will be updated

This is a big project with so many moving parts. And this is NOT a project I’ve worked on for months and just submitting for the hackathon. This has been built full-time from scratch since a few days after the hackathon was announced.

What will be the process for a dapp to integrate with JustPush? We were considering doing our own telegram bot for notifications (price change on DEX) but I might suggest the idea to the team to integrate with JustPush.

Good Question.

This is being documented. But I will describe it quickly here.

  • Create a group for the dapp
    This can be done via invoking the smart contract directly or just using the JustPush dapp.

  • Ask users to subscribe to the group
    This can be done via the API/SDK (on your own front end) or via the JustPush dapp.

  • Send notifications
    This can be done via Smart Contract, API, SDK, or JustPush dapp.

  • Receiving notifications
    With the api and SDK, you can build any integrations to receive notifications. Email, SMS, Telegram, Discord, Mobile Push notification, etc.
    For now, Users can view their notifications on JustPush Dapp, but I’m working on setting up other media (Email, SMS etc).

I would suggest to focus first on Telegram notifications so people don’t need to enter an email address or phone number. If Telegram notifications are on, they will get a push notif anyway :+1:

1 Like

Thanks for the suggestion. Yes, will look into integrating telegram soon.

JustPush is making the “building blocks” to enable any sort of notification in the Tron ecosystem.

The media where users can get notifications (Telegram, Email, Discord) is something we can build using the building blocks. Feedback like yours is highly appreciated. Thanks @fabsltsa

1 Like

@fabsltsa

After your feedback, started working on this.

It is not completed yet. But it is almost there.

Will submit this as a part of our hackathon submission. Looking into creating a Discord bot as well.

Thanks again.

1 Like

Good job :clap:
Good luck for the hackathon :+1: