TesserPG-Android icon indicating copy to clipboard operation
TesserPG-Android copied to clipboard

Red Packet Feature (Stage 1) [Draft]

Open neruthes opened this issue 6 years ago • 0 comments

302: https://github.com/DimensionDev/Tessercube-iOS/issues/75

Mirror:

=== STILL UNDER CONSTRUCTION ===

Abstract

This is the first Proof of Concept for Cryptocurrency Red Packet.

In this stage, we will send cryptocurrencies into a smart contract, which stores a list of SHA256 hashes of UUIDs. When a wallet invokes the smart contract with a correct UUID, an amount of tokens within it will be transferred to the wallet. With this design, the recipients can receive a red packet without a preexisting wallet.

See Also

  • https://github.com/DimensionDev/Tessercube2-Meta-RFC/issues/2

Use Cases

Stage 1 (Current)

Wallets:

  • Create Wallet
  • Import Wallet
  • Delete Wallet
  • Check balance

Keyboard:

  • Send a Red Packet in the keyboard
  • Open a Red Packet in the keyboard

Messages:

  • Look up sent Red Packets
  • Look up received Red Packets

Stage 2 (Next)

  • Export Wallet
  • Send Tokens
  • Receive Tokens
  • Lookup transaction history

Modules

Keyboard Upgrades

Figma prototype: https://www.figma.com/file/BlCiZUHohnjLqXpdbDmFgi/Keyboard-v2?node-id=2%3A2

Messages Tab

We will add another message type here. For a message which starts with -----BEGIN RED PACKET-----, it should be displayed with a different template in the list of messages.

A red packet may not be kept as a draft.

Screen Shot 2019-11-06 at 07 32 49

Sent Red Packet

A "Sent Red Packet" cell has 6 states:

  • Network unavailable
  • Publishing
  • Online
  • All Delivered
  • Partially Delivered
  • All Returned

Received Red Packet

A "Received Red Packet" cell has 4 states:

  • Network unavailable
  • Opening
  • Claimed
  • Out of number

Wallets Tab

Figma prototype: https://www.figma.com/file/IwTEViGxwLEAAny5jYrIrp/TesserPG-iOS-LegacySketchFile?node-id=3%3A0

Components:

  • Tab "Wallets"
    • Button: Add (Tap to open action sheet)
      • Button: Import Wallet
      • Button: Generate Wallet
    • List of Wallets
      • Every card has:
        • Nickname (calculated from address)
        • Wallet Address preview
        • Wallet Balance
        • Button: Copy Wallet Address
        • Button: Show Wallet Address as QR code
      • // Delayed: By tapping a Wallet, the app navigates into the corresponding "Wallet Detail" page.

Blockchain Interface

Notes

  • Minimum 0.001 ETH per recipient

Message Payload

Example

-----BEGIN RED PACKET-----
CB0ABC7756440D12915E3F25AFB3373F5200DF38:Neruthes<[email protected]>
0x9c86825280b1d6c7dB043D4CC86E1549990149f9
b7dc77a6-3000-4f08-956b-7f3fd8671435
9953e346-5f1a-4c8a-9801-da54f05cf77f
877b6c8a-e9f9-4d85-89a7-c224ea7ac0f5
6a46b77a-2a1e-40de-a3e3-f0e610ff673e
df6039f7-00e2-48e3-af75-f068d8c56948
20e23779-06d8-4291-8e8c-fc9683d6837e
298186f2-1cd7-47ae-b59d-ada3e51548b5
7caf7bc1-2c40-4a12-acae-02bfb85271d0
ab6810c7-fe56-4099-b35b-57d8f9dd6911
-----END RED PACKET-----

Sender Indicator

  • Uppercase 40-digit fingerprint hash.
  • Colon character
  • Sender Name
  • CRLF 

Smart Contract Address

The third line of the payload is a smart contract address, starting with 0x.

UUID

The following lines are a list of UUIDv4 strings, in the standard lowercase hex serialization format.

Extensibility

In future, if we need to make breaking changes over the payload format, we should add version number to the header and the footer, like -----BEGIN RED PACKET V2-----.

neruthes avatar Nov 04 '19 09:11 neruthes