EDS calculation
EDS calculation is based on the same principles as in EON 1 ([TestNet3 - EON Peer API / Transaction signature], but the Bencode string is not converted to uppercase):
Forming a dictionary with the data to be signed.
Forming a Bencode string from the dictionary.
Bytes are taken in UTF-8 coding.
Signing received bytes with the private key.
The obtained signature is inserted into the appropriate field.
For transaction
The following fields are used to form the dictionary (similar to the transaction structure):
version : long
timestamp : long
deadline : long
publisher : String
fee : long
tags : map<string>
(optional field)commands : list<map>
(commands are formed as for signature)
Example (JSON):
For command
The following fields are used to form the dictionary (similar to the command structure):
version : long
network : String
timestamp : long
deadline : long
publisher : String
type : String
data : map
reference : string
(optional field)note : string
(optional field)
Example (JSON):
Signing transactions and commands
The transaction is signed by the account specified in the publisher
field. Each type of command has its own rules for determining who should sign it (if the command requires a signature at all).
Commands and transactions are signed according to the multisignature settings. I.e., if multisignature is enabled, then it should be signed by the accounts specified in the multisignature. The accounts sign the commands and transactions according to their multisignature settings if they are enabled (except when an account includes itself in the multisignature setting, in which case the account's EDS is required).
For example:
The `A' account issues the transaction. It must be signed.
If account
A
has set the accountsB
andC
in the multisignature, then the signatures of accountsB
andC
are expected in the transaction (taking into account their multisignature settings).If account
B
has set multisignature to accountC
, then only accountC
is expected to sign in the transaction (taking into account its multisignature settings).If account
C
has set multisignature to accountsC
andD
, then the signatures of accountsC
andD
are expected in the transaction (EDS forC
and forD
, taking into account the multisignature settings).If account
D
has not set multisignature, then the transaction must have two EDS: one from accountC
and one from accountD
.
Last updated