Skip to content

TX vchdata serialization definition

zhongjin edited this page Nov 19, 2019 · 2 revisions

To use TX, the following conditions must be met at the same time

  1. nType = TX_TOKEN
  2. sendTo: the address type is pubkey,or TemplateId = TEMPLATE_WEIGHTED / TEMPLATE_MULTISIG
  3. vchData is not null
0               16   20 21        x                                              E
|________________|____|_|_________|______________________________________________|
  • byte0 ~ byte15 : UUID (RFC 4122)
  • byte16 ~ byte19 : timestamp (UTC in second)
  • byte20 : szDesc , strDescription size,if the value is 0, it is said that no strdescription field
  • If "szDesc" value is not 0, Strdescription from 21st byte,size is "szDesc". Strdescription needs to be encoded with Base64, and the encoded length cannot exceed 255 bytes.
  • Then there are user-defined data segments. It is recommended to use “MessagePack/BSON” for encapsulation

NOTE: The application is indexed by UUID, and TX query and retrieval can be performed by UUID and timestamp.

Clone this wiki locally