Command and transaction structure
Structurally, a transaction is divided into 2 elements: command and transaction.
    Command - a specific operation in the network. It is specified by the type of operation and a set of fields necessary for the operation. For example, registration, transfer, etc.
    Transaction - a container for several commands sent to the network. The transaction specifies the commission and its payer.

Command structure

    version* : int - format version.
    id* : String - command identifier is calculated from the command hash (according to the principles of EDS) and from the time of command creation. Hashing algorithm is defined by the version.
    type* : String - type of operation.
    publisher* : String - sender to the network.
    timestamp* : long - command's creation time.
    deadline* : long - command lifetime.
    data* : Map<String, Long|String|Map<...>> - command data.
    note : String - comment.
    confirmations*: Map<String, String> - signatures (account ID - EDS in the Base64).
    reference : String - dependence on another command in the transaction.
* - required fields.
Example:
1
{
2
"data": {
3
"alg": "ed25519",
4
"id": "EON-27Z6X-N77SJ-B8GEM",
5
"key": "9zUema0KRJFkx2mC4HjEZZ0xCH0MMAdGH34rXfz2p4o="
6
},
7
"deadline": 300,
8
"id": "CMD-GC3KG-HB3LK-2ETBN",
9
"network": "core.dev.Ti2YGY",
10
"publisher": "EON-HRAEQ-8NZL7-C9LHJ",
11
"timestamp": 1592296782,
12
"type": "core.auth.pk.new",
13
"version": 1
14
}
15
Copied!

Transaction structure

    version* : int - format version.
    id* : String - transaction identifier is calculated from the command hash (according to the principles of EDS) and from the time of command creation. Hashing algorithm is defined by the version.
    commands* : List<Command> - commands in the transaction.
    publisher* : AccId - payer.
    fee* : long - commission.
    confirmations*: Map<String, String> - signatures (account ID - EDS in the Base64).
    timestamp* : long - command's creation time.
    deadline* : long - command lifetime.
    tags : Map<String, String> - tags.
    block : String - identifier of the block in which the transaction was validated (used only when requesting a transaction from peer).
* - required fields.
Example:
1
{
2
"commands": [
3
{
4
"data": {
5
"alg": "ed25519",
6
"id": "EON-27Z6X-N77SJ-B8GEM",
7
"key": "9zUema0KRJFkx2mC4HjEZZ0xCH0MMAdGH34rXfz2p4o="
8
},
9
"deadline": 300,
10
"id": "CMD-GC3KG-HB3LK-2ETBN",
11
"network": "core.dev.Ti2YGY",
12
"publisher": "EON-HRAEQ-8NZL7-C9LHJ",
13
"timestamp": 1592296782,
14
"type": "core.auth.pk.new",
15
"version": 1
16
}
17
],
18
"confirmations": {
19
"EON-HRAEQ-8NZL7-C9LHJ": "HyZIa5n3fKxlUY6lnJVjYhAICGnIPi2czQnW7T+h/CDJORR5gJPfmYaIP22/yHCHWhfCkWV4aLZkc2k6XcePAg=="
20
},
21
"deadline": 300,
22
"fee": 1000,
23
"id": "TX-GC3KG-HFN93-GHF6R",
24
"publisher": "EON-HRAEQ-8NZL7-C9LHJ",
25
"timestamp": 1592296782,
26
"version": 1
27
}
28
Copied!

Basic rules of transaction operation

    The transaction is signed by the sender specified in the publisher field.
    A transaction is executed atomically. An error in the processing of any command in a transaction will cause the entire transaction to fail. No command will be accepted.
    All commands in a transaction are executed sequentially.
    The publisher field is included in the command so that only the correct account can release the transaction to the network.
    The command has a reference field that allows control over how the commands are related. If this field is defined, the specified command must be included in the current transaction and placed before the current command in the transaction command list.
Last modified 6mo ago