threefoldfoundation / tfchain

Official implementation of the ThreeFold blockchain
https://explorer.threefoldtoken.com
Apache License 2.0
13 stars 7 forks source link

[frontend] fix arbitrary data display #355

Closed GlenDC closed 5 years ago

GlenDC commented 5 years ago

Arbitrary data is the expected case arbitrary data, in which case we should

But since the introduction of the 3Bot Mobile App as well as the Threefold Desktop Wallet there is also a formatting scheme clients can use to allow users to send UTF-8 unicode messages and/or include the sender's id in the arbitrary data.

The format looks as follows:

| 6 Byte   | 1 Byte  | 1 Byte          | 1 Byte             | x Bytes    | y Bytes       |
| ccksum   | type    | name length (x) | message length (y) | name (opt) | message (opt) | 

If this all worked, you can show 2 rows, one representing the message and one the sender (or just one row in case just 1 was defined. In case none were defined simply display an empty string as a single row.


(1): not so much trickery turns out, with any modern browser you should be able to do const str = new TextDecoder().decode(bytes)

GlenDC commented 5 years ago

Closed by 1d876180fbe13b45c767fdc20977d2300b276748.