LTO Network
Search…
Data
Data transaction sets data entries in sender's account data storage.

JSON

1
{
2
"type": 12,
3
"version": 3,
4
"id": "8M6dgn85eh3bsHrVhWng8FNaHBcHEJD4MPZ5ZzCciyon",
5
"sender": "3Jq8mnhRquuXCiFUwTLZFVSzmQt3Fu6F7HQ",
6
"senderKeyType": "ed25519",
7
"senderPublicKey": "AJVNfYjTvDD2GWKPejHbKPLxdvwXjAnhJzo6KCv17nne",
8
"fee": 14000000,
9
"timestamp": 1610397549043,
10
"data": [
11
{
12
"type": "boolean",
13
"value": true,
14
"key": "bool"
15
},
16
{
17
"type": "binary",
18
"value": "base64:SGVsbG8gV2F2ZXM=",
19
"key": "bin"
20
},
21
{
22
"type": "integer",
23
"value": 1234567,
24
"key": "int"
25
},
26
{
27
"type": "string",
28
"value": "some text",
29
"key": "str"
30
}
31
],
32
"proofs": [
33
"4aMwABCZwtXrGGKmBdHdR5VVFqG51v5dPoyfDVZ7jfgD3jqc851ME5QkToQdfSRTqQmvnB9YT4tCBPcMzi59fZye"
34
],
35
"height": 1069662
36
}
Copied!
  • id and height should be omitted when broadcasting. These fields are set by the node.
  • Binary strings are base58 encoded.
  • timestamp is in microseconds since epoch.
  • fee includes 8 digits, so LTO * 10^8

Data entries

Data entries are one of 4 types: "boolean", "integer", "string", and "binary". A data transaction can have a maximum of 100 data entries.
In JSON, the value of a binary data entry must be base64 encoded and prefixed with "base64:". The value of the integer type is a signed long (8 bytes).

Fees

The fees of a data transaction are determined by the size of the data entries. The base fee is 1 LTO, with an additional fee of 0.1 LTO per 256 bytes.

Binary schema

The binary data structure of the unsigned transaction.
V3 (current)
1
Transaction type
Byte (constant, value=12)
1
2
Version
Byte (constant, value=3)
1
3
Chain id
Byte
1
4
Timestamp
Long
8
5
Sender's key type
KeyType (Byte)
1
6
Sender's public key
PublicKey (Array[Byte])
32 | 33
7
Fee
Long
8
8
Number of entries
Short
2
9
Entry 1
...
  • Anchor length and Anchor can be repeated for each anchor hash.
  • Chain id can be obtained by taking the 2nd byte from the sender address.
  • Each key type has a numeric id in addition to the reference from the JSON.
  • Integers (short, int, long) have a big endian byte order.
The encoding of a data entry depends on the type.

Integer

Type
Byte (constant, value=0)
1
Value
Long
8

Boolean

Type
Byte (constant, value=1)
1
Value
Byte
1

Binary

Type
Byte (constant, value=2)
1
Length (N)
Short
2
Value
Array[Byte]
N

String

Type
Byte (constant, value=3)
1
Length (N)
Short
2
Value
String (UTF-8)
N
Last modified 2mo ago