Transaction Detail

To support the DPOS consensus mechanism, LBTC introduces three transaction types: register, vote, cancel vote. All the business data follows OP_RETURN in UTXO. Usually a normal transaction generates two new UTXOs when it is spent: one UTXO for receiving currency and the other UTXO for change. LBTC do not change to the structure of UTXO. It just put the new business data after the script OP_RETURN in UTXO.

The format of the message after OP_RETURN is as follows:
STRING_ID + PUBLICKEY + DATETIME + SIGNATURE + TX_CODE + TX_DATA

Field Name Field Description
STRING_ID “LBTC” string
PUBLICKEY The public key of the address that initiated the transaction
DATETIME The time the transaction was initiated
SIGNATURE The result of signing the transaction initiation time by applying the private key that initiated the transaction address
TX_CODE Store the corresponding opcode of the exchange. They are: 0xc0 – Register, 0xc1 – Vote, 0xc2 – Cancel the poll
TX_DATA Data content for each opcode

Detail business data structure.

Type TX_CODE TX_DATA
Register 0xc0 According to the UTF8 encoded delegate name, the name length is not more than 32 bytes in bytes
Vote 0xc1 The public key hash corresponding to the registered address of all voter names. Each public key hash has a fixed size of 20 bytes.
CancelVote 0xc2 The public key hash corresponding to the registered address of all canceled voters’ names. Each public key hash has a fixed size of 20 bytes.

Business data whose TX_CODE is 0xc1 :

#raw data
6a4cbb044c425443210373222bc0d565ed2959fed83fe48fcb424885f611def33cb507546d49515afc8f042968505a473045022100af02e5ccc602e21bafc2e044cfb519fe6bad40dd1209a9ac760ae8d6f99d0c180220149fda04d03280fa7357a1cddf789bd6f5ca9d3369e90be1ef18b6249e5ba7072ac128b9eb24447fc3f4640d843e1c6c6274204f1fb61fc50b4e8780d6132a97be0bd0ecd7d170c90ec6a1

6a -- OP_RETURN
4cbb -- length of data after OP_RETURN

04 -- length of STRING_ID
4c425443 -- STRING_ID value

21 -- length of PUBLICKEY
0373222bc0d565ed2959fed83fe48fcb424885f611def33cb507546d49515afc8f -- PUBLICKEY value

04 -- length of DATETIME
2968505a -- DATETIME value

47 -- length of SIGNATURE
3045022100af02e5ccc602e21bafc2e044cfb519fe6bad40dd1209a9ac760ae8d6f99d0c180220149fda04d03280fa7357a1cddf789bd6f5ca9d3369e90be1ef18b6249e5ba707 -- SIGNATURE value

2a -- length of business data

c1 -- TX_CODE

28 -- length of TX_DATA
b9eb24447fc3f4640d843e1c6c6274204f1fb61fc50b4e8780d6132a97be0bd0ecd7d170c90ec6a1 -- TX_DATA value