Data transaction binary format

Learn more about data transaction

Transaction version 1

Field order number Field JSON field name Field type Field size in bytes Comment
1 Version flag Byte 1 Indicates the transaction version is version 2 or higher.
Value must be 0
2 Transaction type ID type Byte 1 Value must be 12
3 Transaction version version Byte 1 Value must be 1
4 Public key of the transaction sender senderPublicKey Array[Byte] 32
5 Length of the data array Short 2
6.1 Key 1 length Short 2
6.2 Key 1 key String 4 × L L is a key length
6.3 Value 1 type type Byte 1 0 — integer
1 — boolean
2 — array of bytes
3 — string
6.4 Value 1 length Short 2 This field is present only if the value is of type of array of bytes or a string.
If the value is of type of integer or a boolean, this field should not be included in the data structure
6.5 Value 1 value T Depends on the size of the value T is one of the following:
- Long
- Array[Byte]
- Boolean
- String
6.6 Key 2 length Short 2
6.7 Key 2 key String 4 × L L is a key length
6.8 Value 2 type type Byte 1 0 — integer
1 — boolean
2 — array of bytes
3 — string
6.9 Value 2 length Short 2 This field is present only if the value is of type of array of bytes or a string.
If the value is of type of integer or a boolean, this field should not be included in the data structure
6.10 Value 2 value T Depends on the size of the value T is one of the following:
- Long
- Array[Byte]
- Boolean
- String
... ... ... ... ... ...
... ... ... ... ... ...
... ... ... ... ... ...
... ... ... ... ... ...
... ... ... ... ... ...
6.[5 × N - 4] N-th key length Short 2
6.[5 × N - 3] N-th key key String 4 × L L is a key length
6.[5 × N - 2] N-th value type type Byte 1 0 — integer
1 — boolean
2 — array of bytes
3 — string
6.[5 × N - 1] N-th value length Short 2 This field is present only if the value is of type of array of bytes or a string.
If the value is of type of integer or a boolean, this field should not be included in the data structure
6.[5 × N] N-th value value T Depends on the size of the value T is one of the following:
- Long
- Array[Byte]
- Boolean
- String
7 Transaction timestamp timestamp Long 8
8 Transaction fee fee Long 8
9 Transaction proofs proofs Proofs S If the array is empty, then S = 3. If the array is not empty, then S = 3 + 2 × N + (P1 + P2 + ... + Pn), where N is the number of proofs in the array, Pn is the size of N-th proof in bytes. The maximum number of proofs in the array is 8. The maximum size of each proof is 64 bytes

JSON representation of the transaction

See the example in Node API.

results matching ""

    No results matching ""