TEA party epoch7 layer1 notification design #105
Replies: 2 comments
-
Please note, this topic is mainly for the notification feature in Layer1. TEA Party in epoch7 will be the first app to use this feature. There are still a few questions not answered yet, such as the Nickname. Before we have a better solution, we probably use the full-length address. I know it looks ugly but better than nothing. |
Beta Was this translation helpful? Give feedback.
-
the pricing model of the notification is not confirmed yet. It is likely to be how long the notification to be valid (in blocks) to be seen by the receiver. For example, 1T for 10000 blocks. If you pay 1T, this message will be available for the receiver to get notified in 10000 blocks. After the 10000 blocks, the notification will be auto removed if the receiver has not read it yet. This billing model would be the same as how the messages live in the storage. User can always extend the TTL by paying another T. This is not about the billing model of posting messages on the discussion board. |
Beta Was this translation helpful? Give feedback.
-
TEA party is a layer2 TApp. Currently there is no way to let the user who did not login to the TEA party to get notification when he only login to the layer1 wallet.
Goal:
Add a notification in layer1 so that the users will get notification and click to go to TEA party and read the messages
Design points:
UI workflow:
Receiver
In the wallet, besides the user name, there is a notification area. If there is layer1 notification arrives, it shows a badge.
Click the badge, go to TEA Party app table=SYSTEM. User selects any nodes no matter they have a TEA party layer 2 accounts or not.
Once in TEA Party, user need to login first.
After login, he can see the messages
At the end of each message there will be a "Report Spam" button, and a "Not a Spam".
If click Report Spam. The deposit is slashed by the DAO. A future feature will remove the reported spam message from the OrbitDB even it has not been read by other receives.
if click Not a Spam, or do not do anything. The deposit will be refunded to the sender after the message ends its TTL. Note: Every message has a TTL. No matter read or not. it would be deleted after the TTL.
A reply button to reply a message. The reply message to the original sender is free of charge to this receiver. It is paid from the sneder deposit. Consider this is a "business reply mail, paid by the sender" type of mails.
note: The deposit value need to be set to cover at least one reply.
What the sender receives the reply? this is discussed in the Sender Receive Reply part below
Sender
for original sender (Original means this is not a reply on existing message), sender can generate new message and pay for deposit.
The deposit is calculated from the layer1 RPC based on the receivers' anti-spam threshold.
If this message is a group message, this number can probably be very large. The sender need to consider if he spam to a large quantity of contestants may cause huge financial penalty.
Once the sender click send after review the estimated deposit cost. The message is send and also the deposit is transferred from this user layer 2 account to the TEA Party Reserve Account.
Sending message is a OrbitDB operation. Transfer fund is a State Machine (type A CML) task.
Sender receive reply
When sender receives reply. This message will not be a spam any more. Beacuse the receive imply recognize this message is NOT a Spam. The deposit is refunded immediately. If the sender again reply the same message, this considered a new message, all deposit is needed as if this is the first time sending a new message.
Gift card.
Sender can send gift card (someone call it Red Pocket from a traditional Chinese culture) to receiver. If a gift card is attached, the receiver can see a "Redeem gift card " button. Click the button, the gift card value will be transferred from the reserved account to the receiver layer 2 account.
In the beginning of epoch7, we can disable the withdraw feature. This force the new users to use the gift card money in layer2 without withdrawing back to layer1.
Reserved account
This is a layer2 state machine feature.
When fund sends to the state machine. it has a handle to refund, a TTL that refund automatically when time it up.
The state machine will listen to the handler to be called to refund, or when time is up, the deposit is refunded.
Then handler can do two kinds of transfer. 1) refunded to the original account who pay the deposit, or 2)Another account to take over the fund. If the account is the DAO burning account, this means slashing.
layer1 notification
We will need a new pellet , or just a layer1 storage.
Wallet RPC can query for new notification in the storage. If there is any show the badget (usually with a number on it)
Another storage is to store this account anti spam threshold. This is query when any sender wants to send message this account.
Wallet
Wallet will RPC check the layer1 storage for notification frequently. If socket is not doable, then frequently query will be applied.
TEA Party.
The UI will have a new "private message" page.
A new sending private message page
A introduction for the billing model
Beta Was this translation helpful? Give feedback.
All reactions