Binary Format#

Address Binary Format#

Learn more about address.

Address Binary Format#

Field order number

Field

Field type

Field size in bytes

Comments

\(1\)

Entity type

Byte

\(1\)

Value must be \(1\).

\(2\)

Chain ID

Byte

\(1\)

\(87\) — for Mainnet. \(84\) — for Testnet. \(83\) — for Stagenet.

\(3\)

Account public key hash

Array of bytes

\(20\)

First \(20\) bytes of the result of the Keccak256 (Blake2b256 (publicKey)) hashing function. Here publicKey is the array of bytes of the account public key.

\(4\)

Checksum

Array of bytes

\(4\)

First \(4\) bytes of the result of the Keccak256 (Blake2b256 (data)) hashing function. Here data is the array of bytes of three fields put together: 1) Entity type. 2) Chain ID. 3) Account public key hash.

Alias Binary Format#

Learn more about alias.

Alias Binary Format#

Field order number

Field

Field type

Field size in bytes

Comments

\(1\)

Entity type

Byte

\(1\)

Value must be \(2\).

\(2\)

Chain ID

Byte

\(1\)

\(87\) — for Mainnet. \(84\) — for Testnet. \(83\) — for Stagenet.

\(3\)

Number of characters in the alias

Short

\(2\)

\(4\)

Alias

Array of bytes

From \(4\) to \(30\).

Block Binary Format#

Learn more about block.

Blocks are stored on the blockchain in a binary format (byte representation). Node extensions such as gRPC server can work directly with data in binary format.

Version 5

message Block {
  message Header {
    int32 chain_id = 1;
    bytes reference = 2;
    int64 base_target = 3;
    bytes generation_signature = 4;
    repeated uint32 feature_votes = 5;
    int64 timestamp = 6;
    int32 version = 7;
    bytes generator = 8;
    int64 reward_vote = 9;
    bytes transactions_root = 10;
  }

  Header header = 1;
  bytes signature = 2;
  repeated SignedTransaction transactions = 3;
}
Block Binary Format Version 5#

Field

Description

chain_id

Chain ID

reference

BLAKE2b-256 hash of the previous block header.

base_target

Base target: а variable that is used in the block generation algorithm.

generation_signature

«Generation signature: а variable that is used in the block generation algorithm (\(32\) bytes).»

feature_votes

List of features for which the block generator votes. See the features.

timestamp

Block timestamp: Unix time in milliseconds.

version

Block version: \(5\).

generator

Block generator’s account public key (\(32\) bytes).

reward_vote

Block generation reward for which the block generator votes. \(-1\) means that block generator votes for the current reward size.

transactions_root

Transactions Root Hash (\(32\) bytes).

signature

Block header signature (\(64\) bytes).

transactions

For each transaction: 1) Body bytes: up to \(165,487\) bytes. 2) Proofs: up to \(531\) bytes. See the transaction binary format article for details.

Version 4

Block Binary Format Version 4#

#

Field

Field type

Field size in bytes

Comments

\(1\)

Block version

Byte

\(1\)

The value must be \(4\).

\(2\)

Block timestamp

Long

\(8\)

Unix time in milliseconds.

\(3\)

Signature of the previous block

Array[Byte]

\(64\)

\(4\)

Base target

Long

\(8\)

\(5\)

Generation signature

Array[Byte]

\(32\)

\(6\)

Number of transactions in the block

Integer

\(4\)

\(7.1\)

Transaction 1

Array[Byte]

Body bytes: up to \(165,996\) bytes. Proofs: up to \(531\) bytes.

Bytes of the 1st transaction in binary format.

\(7.2\)

Transaction 2

Array[Byte]

Body bytes: up to \(165,996\) bytes. Proofs: up to \(531\) bytes.

Bytes of the 2nd transaction in binary format.

\(7.[N]\)

Transaction N

Array[Byte]

Body bytes: up to \(165,996\) bytes. Proofs: up to \(531\) bytes.

Bytes of the Nth transaction in binary format.

\(8\)

Number of features for which the block generator votes

\(4\)

Integer

\(9.1\)

Feature 1

\(2\)

Short

\(9.[M]\)

Feature M

\(2\)

Short

\(10\)

Block generation reward for which the block generator votes

\(8\)

Long

\(-1\) means that block generator votes for the current reward size.

\(11\)

Block generator’s account public key

\(32\)

Array[Byte]

\(12\)

Block signature

\(64\)

Array[Byte]

Version 3

Block Binary Format Version 3#

#

Field

Field type

Field size in bytes

Comments

\(1\)

Block version

Byte

\(1\)

The value must be \(4\).

\(2\)

Block timestamp

Long

\(8\)

Unix time in milliseconds.

\(3\)

Signature of the previous block

Array[Byte]

\(64\)

\(4\)

Base target

Long

\(8\)

\(5\)

Generation signature

Array[Byte]

\(32\)

\(6\)

Number of transactions in the block

Integer

\(4\)

\(7.1\)

Transaction 1

Array[Byte]

Body bytes: up to \(165,996\) bytes. Proofs: up to \(531\) bytes.

Bytes of the 1st transaction in binary format.

\(7.2\)

Transaction 2

Array[Byte]

Body bytes: up to \(165,996\) bytes. Proofs: up to \(531\) bytes.

Bytes of the 2nd transaction in binary format.

\(7.[N]\)

Transaction N

Array[Byte]

Body bytes: up to \(165,996\) bytes. Proofs: up to \(531\) bytes.

Bytes of the Nth transaction in binary format.

\(8\)

Block generator’s account public key

Array[Byte]

\(32\)

\(9\)

Block signature

Array[Byte]

\(64\)

Network Message Binary Format#

Block Message Binary Format#

Block message is a reply to GetBlock message.

Block Message Binary Format#

#

Field name

Type

Length in Bytes

\(1\)

Packet length (BigEndian)

Int

\(4\)

\(2\)

Magic Bytes

Bytes

\(4\)

\(3\)

Content ID (0x17)

Byte

\(1\)

\(4\)

Payload length

Int

\(4\)

\(5\)

Payload checksum

Bytes

\(4\)

\(6\)

Block bytes (N)

Bytes

N

Checkpoint Message Binary Format#

Checkpoint Message Binary Format#

#

Field name

Type

Length in Bytes

\(1\)

Packet length (BigEndian)

Int

\(4\)

\(2\)

Magic Bytes

Bytes

\(4\)

\(3\)

Content ID (0x64)

Byte

\(1\)

\(4\)

Payload length

Int

\(4\)

\(5\)

Payload checksum

Bytes

\(4\)

\(6\)

Checkpoint items count (N)

Int

\(4\)

\(7\)

Checkpoint #1 height

Long

\(8\)

\(8\)

Checkpoint #1 signature

Bytes

\(64\)

\(6 + 2 * N - 1\)

Checkpoint #N height

Long

\(8\)

\(6 + 2 * N\)

Checkpoint #N signature

Bytes

\(64\)

Get Block Message Binary Format#

Get Block Message Binary Format#

#

Field name

Type

Length in Bytes

\(1\)

Packet length (BigEndian)

Int

\(4\)

\(2\)

Magic Bytes

Bytes

\(4\)

\(3\)

Content ID (0x16)

Byte

\(1\)

\(4\)

Payload length

Int

\(4\)

\(5\)

Payload checksum

Bytes

\(4\)

\(6\)

Block ID

Bytes

\(64\)

Get Peers Message Binary Format#

Get peers message is sent when one sending node wants to know about other nodes on the network.

Get Peers Message Binary Format#

#

Field name

Type

Length in Bytes

\(1\)

Packet length (BigEndian)

Int

\(4\)

\(2\)

Magic Bytes

Bytes

\(4\)

\(3\)

Content ID (0x01)

Byte

\(1\)

\(4\)

Payload length

Int

\(4\)

\(5\)

Payload checksum

Bytes

\(4\)

Get Signatures Message Binary Format#

Get Signatures Message Binary Format#

#

Field name

Type

Length in Bytes

\(1\)

Packet length (BigEndian)

Int

\(4\)

\(2\)

Magic Bytes

Bytes

\(4\)

\(3\)

Content ID (0x14)

Byte

\(1\)

\(4\)

Payload length

Int

\(4\)

\(5\)

Payload checksum

Bytes

\(4\)

\(6\)

Block IDs count (N)

Int

\(4\)

\(7\)

Block #1 ID

Long

\(64\)

\(6 + N\)

Block #N ID

Bytes

\(64\)

Handshake Message Binary Format#

Handshake is used to start communication between two nodes.

Handshake Message Binary Format#

#

Field name

Type

Length in Bytes

\(1\)

Application name length (N)

Byte

\(1\)

\(2\)

Application name (UTF-8 encoded bytes)

Bytes

N

\(3\)

Application version major

Int

\(4\)

\(4\)

Application version minor

Int

\(4\)

\(1\)

Application version patch

Int

\(4\)

\(6\)

Node name length (M)

Byte

\(1\)

\(7\)

Node name (UTF-8 encoded bytes)

Bytes

M

\(8\)

Node nonce

Long

\(8\)

\(9\)

Declared address length (K) or \(0\) if no declared address was set

Int

\(4\)

\(10\)

Declared address bytes (if length is not \(0\))

Bytes

K

\(11\)

Timestamp

Long

\(8\)

Peers Message Binary Format#

Peers message is a response to get peers message.

Peers Message Binary Format#

#

Field name

Type

Length in Bytes

\(1\)

Packet length (BigEndian)

Int

\(4\)

\(2\)

Magic Bytes

Bytes

\(4\)

\(3\)

Content ID (0x02)

Byte

\(1\)

\(4\)

Payload length

Int

\(4\)

\(5\)

Payload checksum

Bytes

\(4\)

\(6\)

Peers count (N)

Int

\(4\)

\(7\)

Peer #1 IP address

Bytes

\(4\)

\(8\)

Peer #1 port

Int

\(4\)

\(6 + 2 * N - 1\)

Peer #N IP address

Bytes

\(4\)

\(6 + 2 * N\)

Peer #N port

Int

\(4\)

Score Message Binary Format#

Score Message Binary Format#

#

Field name

Type

Length in Bytes

\(1\)

Packet length (BigEndian)

Int

\(4\)

\(2\)

Magic Bytes

Bytes

\(4\)

\(3\)

Content ID (0x18)

Byte

\(1\)

\(4\)

Payload length

Int

\(4\)

\(5\)

Payload checksum

Bytes

\(4\)

\(6\)

Score (N bytes)

Int

\(N\)

Signatures Message Binary Format#

Signatures Message Binary Format#

#

Field name

Type

Length in Bytes

\(1\)

Packet length (BigEndian)

Int

\(4\)

\(2\)

Magic Bytes

Bytes

\(4\)

\(3\)

Content ID (0x15)

Byte

\(1\)

\(4\)

Payload length

Int

\(4\)

\(5\)

Payload checksum

Bytes

\(4\)

\(6\)

Block signatures count (N)

Int

\(4\)

\(7\)

Block #1 signature

Bytes

\(64\)

\(6 + N\)

Block #N signature

Bytes

\(64\)

Transaction Message Binary Format#

Transaction Message Binary Format#

#

Field name

Type

Length in Bytes

\(1\)

Packet length (BigEndian)

Int

\(4\)

\(2\)

Magic Bytes

Bytes

\(4\)

\(3\)

Content ID (0x19)

Byte

\(1\)

\(4\)

Payload length

Int

\(4\)

\(5\)

Payload checksum

Bytes

\(4\)

\(6\)

Transaction (N bytes)

Bytes

N

Order Binary Format#

Learn more about order.

  • An exchange transaction of version 3 can accept orders of versions 1–4.

  • An exchange transaction of version 2 can accept orders of versions 1–3.

  • An exchange transaction of version 1 can accept orders of version 1 only.

Version 4

message AssetPair {
    bytes amount_asset_id = 1;
    bytes price_asset_id = 2;
};

message Order {
  enum Side {
    BUY = 0;
    SELL = 1;
  };

  int32 chain_id = 1;
  bytes sender_public_key = 2;
  bytes matcher_public_key = 3;
  AssetPair asset_pair = 4;
  Side order_side = 5;
  int64 amount = 6;
  int64 price = 7;
  int64 timestamp = 8;
  int64 expiration = 9;
  Amount matcher_fee = 10;
  int32 version = 11;
  repeated bytes proofs = 12;
};

message Amount {
  bytes asset_id = 1;
  int64 amount = 2;
};
Order Binary Format Version 4#

Field

Size

Description

chain_id

\(1\) byte

Chain ID

sender_public_key

\(32\) bytes

Public key of the order sender.

matcher_public_key

\(32\) bytes

Public key of matcher.

asset_pair.amount_asset_id

\(32\) bytes for asset. \(0\) for DecentralCoins.

ID of the amount asset.

asset_pair.price_asset_id

\(32\) bytes for asset. \(0\) for DecentralCoins.

ID of the price asset.

order_side

\(1\) byte

Order type: buy or sell.

amount

\(8\) bytes

Amount of the amount asset, specified in the minimum fraction (“cent”) of asset.

price

\(8\) bytes

Price for the amount asset nominated in the price asset, multiplied by \(108\).

timestamp

\(8\) bytes

Order timestamp: Unix time in milliseconds.

expiration

\(8\) bytes

Unix time in milliseconds when the order will be expired.

matcher_fee.asset_id

\(32\) bytes for asset. \(0\) for DecentralCoins.

Matcher fee token ID.

matcher_fee.amount

\(8\) bytes

Matcher fee

version

\(1\) byte

Order version: 4.

proofs

Each proof up to \(64\) bytes, up to \(8\) proofs.

Order proofs that are used to check the validity of the order.

Version 3

Order Binary Format Version 3#

#

Field name

JSON field name

Field type

Length in bytes

Value

\(1\)

Order binary format version number

version

Byte

\(1\)

Must be \(3\).

\(2\)

Order sender public key

senderPublicKey

Array[Byte]

\(32\)

\(3\)

Matcher public key

matcherPublicKey

Array[Byte]

\(32\)

\(4.1\)

Asset B (amount asset) flag

Byte

\(1\)

If token is DecentralCoins, then value is \(0\), else \(1\).

\(4.2\)

Asset B (amount Asset) ID

amountAsset

Array[Byte]

S

If token is not DecentralCoins, then \(S = 32\), else the field should be absent.

\(5.1\)

Asset A (price asset) flag

Byte

\(1\)

If token is DecentralCoins, then value is \(0\), else \(1\).

\(5.2\)

Asset A (price asset) ID

priceAsset

Array[Byte]

S

If token is not DecentralCoins, then \(S = 32\), else the field should be absent.

\(6\)

Order type

orderType

Byte

\(1\)

If order is for buying, then value is \(0\), if order is for selling, then value is \(1\).

\(7\)

Amount of asset B (amount asset), which the order sender offers for one price asset(asset A)

price

Long

\(8\)

Bytes in big-endian notation.

\(8\)

Amount of asset B (price asset), which the order sender wants to buy or send depending on order type

amount

Long

\(8\)

Bytes in big-endian notation.

\(9\)

Amount of milliseconds from the beginning of Unix epoch till the moment of validation of order by matcher

timestamp

Long

\(8\)

Bytes in big-endian notation.

\(10\)

Amount of milliseconds from the beginning of Unix epoch till the unfulfilled order cancellation

expiration

Long

\(8\)

Bytes in big-endian notation.

\(11\)

Matcher fee

matcherFee

Long

\(8\)

Bytes in big-endian notation.

\(12\)

Matcher fee token flag

Byte

\(1\)

If token is DecentralCoins, then value is \(0\), else \(1\)

\(13\)

Matcher fee token

matcherFeeAssetId

Array[Byte]

F

If token is not DecentralCoins, then \(F = 32\), else the field should be absent.

\(14\)

Proofs

proofs

Array[Proof]

S

If the array is empty, then \(S = 3\). If the array is not empty, then \(S = 3 + 2 × N + (P_{1} + P_{2} + ... + P_{n})\), where \(N\) is amount of proofs in the array, \(P_{n}\) — size N-th proof in bytes. Maximum amount of proofs in the array is \(8\). Maximum length of each proof is \(64\) bytes.

JSON Representation of Order Version 3

{
  "version": 3,
  "senderPublicKey": "FMc1iASTGwTC1tDwiKtrVHtdMkrVJ1S3rEBQifEdHnT2",
  "matcherPublicKey": "7kPFrHDiGw1rCm7LPszuECwWYL3dMf6iMifLRDJQZMzy",
  "assetPair": {
    "amountAsset": "BrjUWjndUanm5VsJkbUip8VRYy6LWJePtxya3FNv4TQa",
    "priceAsset": null
  },
  "orderType": "buy",
  "amount": 150000000,
  "timestamp": 1548660872383,
  "expiration": 1551252872383,
  "matcherFee": 300000,
  "proofs": [
    "YNPdPqEUGRW42bFyGqJ8VLHHBYnpukna3NSin26ERZargGEboAhjygenY67gKNgvP5nm5ZV8VGZW3bNtejSKGEa"
  ],
  "id": "Ho6Y16AKDrySs5VTa983kjg3yCx32iDzDHpDJ5iabXka",
  "sender": "3PEFvFmyyZC1n4sfNWq6iwAVhzUT87RTFcA",
  "price": 1799925005,
}

Version 2

Order Binary Format Version 2#

#

Field name

Type

Length in Bytes

\(1\)

Version

Byte (constant, value = \(2\))

\(1\)

\(2\)

Sender’s public key

PublicKey (Array[Byte])

\(32\)

\(3\)

Matcher’s public key

PublicKey (Array[Byte])

\(32\)

\(4.1\)

Amount asset flag (\(1\) - asset, \(0\) - DecentralCoins)

Byte

\(1\)

\(4.2\)

Amount asset

AssetId (ByteStr = Array[Byte])

\(32\) or \(0\) (depends on the byte in 4.1).

\(5.1\)

Price asset flag (\(1\) - asset, \(1\) - DecentralCoins)

Byte

\(1\)

\(5.2\)

Price asset

AssetId (ByteStr = Array[Byte])

\(32\) or \(0\) (depends on the byte in 5.1).

\(6\)

Order type (\(0\) - Buy, \(1\) - Sell)

Byte

\(1\)

\(7\)

Price

Long

\(8\)

\(8\)

Amount

Long

\(8\)

\(9\)

Timestamp

Long

\(8\)

\(10\)

Expiration

Long

\(8\)

\(11\)

Matcher’s fee

Long

\(8\)

\(12\)

Proofs

Proofs

Version 1

Order Binary Format Version 1#

#

Field name

Type

Length in Bytes

\(1\)

Sender’s public key

PublicKey (Array[Byte])

\(32\)

\(2\)

Matcher’s public key

PublicKey (Array[Byte])

\(32\)

\(3.1\)

Amount asset flag (\(1\) - asset, \(0\) - DecentralCoins)

\(1\)

\(3.2\)

Amount asset

AssetId (ByteStr = Array[Byte])

\(32\) or \(0\) (depends on the byte in 3.1).

\(4.1\)

Price asset flag (\(1\) - asset, \(0\) - DecentralCoins)

\(1\)

\(4.2\)

Price asset

AssetId (ByteStr = Array[Byte])

\(32\) or \(0\) (depends on the byte in 4.1).

\(5\)

Order type (\(0\) - Buy, \(1\) - Sell)

Byte

\(1\)

\(6\)

Price

Long

\(8\)

\(7\)

Amount

Long

\(8\)

\(8\)

Timestamp

Long

\(8\)

\(9\)

Expiration

Long

\(8\)

\(10\)

Matcher fee

Long

\(8\)

\(11\)

Signature

Bytes

\(64\)

The price listed for amount asset in price asset \(* 10^8\). Expiration is order time to live, timestamp in future, max \(= 30\) days in future. The signature is calculated from the following bytes:

Order Binary Format Version 1 Bytes#

#

Field name

Type

Length in Bytes

\(1\)

Sender’s public key

PublicKey (Array[Byte])

\(32\)

\(2\)

Matcher’s public key

PublicKey (Array[Byte])

\(32\)

\(3.1\)

Amount asset flag (\(1\) - asset, \(0\) - DecentralCoins)

\(1\)

\(3.2\)

Amount asset

AssetId (ByteStr = Array[Byte])

\(32\) or \(0\) (depends on the byte in 3.1).

\(4.1\)

Price asset flag (\(1\) - asset, \(0\) - DecentralCoins)

\(1\)

\(4.2\)

Price asset

AssetId (ByteStr = Array[Byte])

\(32\) or \(0\) (depends on the byte in 4.1).

\(5\)

Order type (\(0\) - Buy, \(1\) - Sell)

Bytes

\(1\)

\(6\)

Price

Long

\(8\)

\(7\)

Amount

Long

\(8\)

\(8\)

Timestamp

Long

\(8\)

\(9\)

Expiration

Long

\(8\)

\(10\)

Matcher fee

Long

\(8\)

Transaction Binary Format#

Learn more about transaction.

Transactions are stored on the blockchain in a binary format (byte representation). Node extensions such as gRPC server can work directly with data in binary format. The transaction signature and ID are also formed on the basis of the binary format, namely the transaction body bytes. The contents of transaction body bytes is given in the description of the binary format of each type and version of the transaction. Normally the transaction body bytes include all transaction fields, with the exception of the following fields:

  • Transaction ID (it is not stored on the blockchain),

  • Version flag,

  • Proofs or signature, depending on the version of the transaction.

The guideline for generating a signature and ID is given in the cryptographic practical details article. All strings are UTF-8 encoded.

Protobuf#

Protobuf facilitates the development of client libraries for the DecentralChain blockchain, as it avoids serialization errors and streamlines the creation of a correctly signed transaction. How to generate a transaction signature using protobuf:

  • Download the protocol buffers package for your programming language. Generate the Transaction class on the basis of transaction.proto.

  • Fill in the transaction fields.

    • Asset IDs should be specified in the binary format.

    • Addresses should be specified in the shortened binary format (without the first two and the last four bytes). See the address binary format) article.

  • Serialize the transaction object to get transaction body bytes. Detailed instructions for various programming languages are provided in protocol buffers tutorials.

  • Generate the signature for the transaction body bytes with the Curve25519 function using sender private key bytes.

The byte representation of a transaction based on the protobuf schema must not contain default values. Make sure that your protocol buffers compiler does not write the field value when serializing if it is equal to the default value for this data type, otherwise the transaction signature will be invalid. Send the signed transaction to a node:

  • If you use your own node and gRPC server, send the SignedTransaction object.

  • If you use Node REST API, compose the JSON representation of the transaction and add the base58-encoded signature to the proof array. Send the transaction to a node using POST /transactions/broadcast method.

message SignedTransaction {
  Transaction transaction = 1;
  repeated bytes proofs = 2;
}

message Transaction {
  int32 chain_id = 1;
  bytes sender_public_key = 2;
  Amount fee = 3;
  int64 timestamp = 4;
  int32 version = 5;

  oneof data {
    GenesisTransactionData genesis = 101;
    PaymentTransactionData payment = 102;
    IssueTransactionData issue = 103;
    TransferTransactionData transfer = 104;
    ReissueTransactionData reissue = 105;
    BurnTransactionData burn = 106;
    ExchangeTransactionData exchange = 107;
    LeaseTransactionData lease = 108;
    LeaseCancelTransactionData lease_cancel = 109;
    CreateAliasTransactionData create_alias = 110;
    MassTransferTransactionData mass_transfer = 111;
    DataTransactionData data_transaction = 112;
    SetScriptTransactionData set_script = 113;
    SponsorFeeTransactionData sponsor_fee = 114;
    SetAssetScriptTransactionData set_asset_script = 115;
    InvokeScriptTransactionData invoke_script = 116;
    UpdateAssetInfoTransactionData update_asset_info = 117;
  };
};

message Amount {
  bytes asset_id = 1;
  int64 amount = 2;
};
Transaction Binary Format#

Field

Size

Description

chain_id

\(1\) byte

Chain ID

sender_public_key

\(32\) bytes

Public key of the transaction sender.

fee.amount

\(8\) bytes

Transaction fee in the minimum fraction (“cent”) of the fee asset.

fee.asset_id

\(32\) bytes for the fee in a sponsored asset. \(0\) for the fee in DecentralCoins

ID of the token of the fee. The fee in a sponsored asset is only available for invoke script transactions and transfer transactions. See the sponsored fee article.

timestamp

\(8\) bytes

Transaction timestamp: Unix time in milliseconds. The transaction won’t be added to the blockchain if the timestamp value is more than \(2\) hours back or \(1.5\) hours forward of the current block timestamp.

version

\(1\) byte

Transaction version.

proofs

Each proof up to \(64\) bytes,up to \(8\) proofs.

Transaction proofs that are used to check the validity of the transaction. The array can contain several transaction signatures (but not limited to signatures only).

The fields that depend on the type of transaction are described in the following articles:

Burn Transaction Binary Format#

Learn more about burn transaction.

Version 3

message BurnTransactionData {
  Amount asset_amount = 1;
};

message Amount {
  bytes asset_id = 1;
  int64 amount = 2;
};
Burn Transaction Binary Format Version 3#

Field

Size

Description

asset_amount.amount

\(8\) bytes

Amount of token to burn, specified in the minimum fraction (“cents”).

asset_amount.asset_id

\(32\) bytes

ID of token to burn.

Version 2

Burn Transaction Binary Format Version 2#

#

Field

JSON field name

Field type

Field size in bytes

Comment

\(1\)

Version flag

Byte

\(1\)

Indicates the transaction version is \(2\) or higher. Value must be \(0\).

\(2\)

Transaction type ID

type

Byte

\(1\)

Value must be \(6\).

\(3\)

Transaction version

version

Byte

\(1\)

Value must be \(2\).

\(4\)

Chain ID

chainId

Byte

1

\(87\) — for Mainnet. \(84\) — for Testnet. \(83\) — for Stagenet.

\(5\)

Public key of the transaction sender

senderPublicKey

Array[Byte]

\(32\)

\(6\)

ID of the token to burn

assetId

Array[Byte]

\(32\)

\(7\)

Amount of tokens to burn

amount

Long

\(8\)

\(8\)

Transaction fee

fee

Long

\(8\)

\(9\)

Transaction timestamp

timestamp

Long

\(8\)

\(10\)

Transaction proofs

proofs

See transaction proofs binary format

S

If the array is empty, then \(S = 3\). If the array is not empty, then \(S = 3 + 2 × N + 64 × N\), where \(N\) is the number of proofs in the array. The maximum number of proofs in the array is \(8\). The size of each proof is \(64\) bytes.

The fields \(2\), \(3\), \(4\), \(5\), \(6\), \(7\), \(8\) and \(9\) are the transaction body bytes.

JSON Representation of Transaction

{
  "type":6,
  "id":"csr25XQHT1c965Fg7cY2vJ7XHYVsudPYrUbdaFqgaqL",
  "sender":"3P9QZNrHbyxXj8P9VrJZmVu2euodNtA11UW",
  "senderPublicKey":"9GaQj7gktEiiS1TTTjGbVjU9bva3AbCiawZ11qFZenBX",
  "fee":100000,
  "feeAssetId":null,
  "timestamp":1548660675277,
  "proofs": [
    "61jCivdv3KTuTY6QHgxt4jaGrXcszWg3vb9TmUR26xv7mjWWwjyqs7X5VDUs9c2ksndaPogmdunHDdjWCuG1GGhh"
  ],
  "version":2,
  "assetId":"FVxhjrxZYTFCa9Bd4JYhRqXTjwKuhYbSAbD2DWhsGidQ",
  "amount":9999,
  "chainId":87,
  "height":1370971
}

Version 1

Burn Transaction Binary Format Version 1#

#

Field

Field type

Field size in bytes

Comment

\(1\)

Transaction type ID

Byte

\(1\)

Value must be \(6\).

\(2\)

Public key of the transaction sender

Array[Byte]

\(32\)

\(3\)

ID of the token to burn

Array[Byte]

\(32\)

\(4\)

Amount of tokens to burn

Long

\(8\)

\(5\)

Transaction fee

Long

\(8\)

\(6\)

Transaction timestamp

Long

\(8\)

\(7\)

Transaction signature

Array[Byte]

\(64\)

The fields \(1\), \(2\), \(3\), \(4\), \(5\) and \(6\) are the transaction body bytes.

Create Alias Transaction Binary Format#

Learn more about create alias transaction.

Version 3

message CreateAliasTransactionData {
  string alias = 1;
};
Create Alias Transaction Binary Format Version 3#

Field

Size

Description

alias

From \(4\) to \(30\) bytes

Alias

Version 2

Create Alias Transaction Binary Format Version 2#

#

Field

JSON field name

Field type

Field size in bytes

Comment

\(1\)

Version flag

Byte

\(1\)

Indicates the transaction version is \(2\) or higher. Value must be \(0\).

\(2\)

Transaction type ID

type

Byte

\(1\)

Value must be \(10\).

\(3\)

Transaction version

version

Byte

\(1\)

Value must be \(2\).

\(4\)

Public key of the transaction sender

senderPublicKey

Array[Byte]

\(32\)

\(5\)

Alias length

Short

\(2\)

Number of characters in the alias name.

\(6\)

Alias

alias

String

from \(4\) to \(30\)

\(7\)

Transaction fee

fee

Long

\(8\)

\(8\)

Transaction timestamp

timestamp

Long

\(8\)

\(9\)

Transaction proofs

proofs

See transaction proofs binary format

S

If the array is empty, then \(S = 3\). If the array is not empty, then \(S = 3 + 2 × N + 64 × N\), where \(N\) is the number of proofs in the array. The maximum number of proofs in the array is \(8\). The size of each proof is \(64\) bytes.

The fields \(2\), \(3\), \(4\), \(5\), \(6\), \(7\) and \(8\) are the transaction body bytes.

JSON Representation of Transaction

{
  "type":10,
  "id":"5CZV9RouJs7uaRkZY741WDy9zV69npX1FTZqxo5fsryL",
  "sender":"3PNaua1fMrQm4TArqeTuakmY1u985CgMRk6",
  "senderPublicKey":"B3f8VFh6T2NGT26U7rHk2grAxn5zi9iLkg4V9uxG6C8q",
  "fee":100000,
  "feeAssetId":null,
  "timestamp":1548666019772,
  "proofs": [
    "3cUM8Eq5KfmbS6q1qHDfzhX98YzER1ocnVjVAHG9HSkQdw86zjqxUfmsUPVwnVgwu5zatt3ETLnNFteobRMyR8bY"
  ],
  "version":2,
  "alias":"2.1.0a",
  "height":1371063
}

Version 1

Create Alias Transaction Binary Format Version 1#

#

Field

Field type

Field size in bytes

Comment

\(1\)

Transaction type ID

Byte

\(1\)

Value must be \(10\).

\(2\)

Public key of the transaction sender

Array[Byte]

\(32\)

\(3\)

Alias length

Short

\(2\)

Number of characters in the alias name.

\(4\)

Alias

Array[Byte]

From \(4\) to \(30\)

\(5\)

Transaction fee

Long

\(8\)

\(6\)

Transaction timestamp

Long

\(8\)

\(7\)

Transaction signature

Array[Byte]

\(64\)

The fields \(1\), \(2\), \(3\), \(4\), \(5\) and \(6\) are the transaction body bytes.

Data Transaction Binary Format#

Learn more about data transaction.

Version 2

Data Transaction Binary Format Version 2#

Field

Size

Description

key

Up to \(400\) bytes

Entry key.

value

Up to \(32,767\) bytes

Entry value. If omitted, the transaction deletes the entry.

The maximum number of entries is \(100\). The maximum data size (keys + values) is \(165,890\) bytes.

JSON Representation of Transaction

{
  "type":12,
  "id":"EByjQAWDRGrmc8uy7xRGy2zsQXZQq59bav7h8oTTJyHC",
  "sender":"3PLZcCJyYQnfWfzhKXRA4rteCQC9J1ewf5K",
  "senderPublicKey":"BQMVwAHwf2WEEwRsCxtMVcSLrXUhJ3XtCLmSptLx2e6L",
  "fee":600000,
  "feeAssetId":null,
  "timestamp":1532116120299,
  "proofs": [
    "PZiAGq2ssi1ojh2Cc9dWrzmbuw9nJif2omsQ4dvonU31oiwsJQGbZiio3LG28otatFfFbHPfcX1JVCHwP5i4mKy"
  ],
  "version":1,
  "data": [
    {"key":"4900","type":"integer","value":24010000},{"key":"4901","type":"integer","value":24019801},
    {"key":"4902","type":"integer","value":24029604},{"key":"4903","type":"integer","value":24039409},
    {"key":"4904","type":"integer","value":24049216},{"key":"4905","type":"integer","value":24059025},
    {"key":"4906","type":"integer","value":24068836},{"key":"4907","type":"integer","value":24078649},
    {"key":"4908","type":"integer","value":24088464},{"key":"4909","type":"integer","value":24098281},
    {"key":"4910","type":"integer","value":24108100},{"key":"4911","type":"integer","value":24117921},
    {"key":"4912","type":"integer","value":24127744},{"key":"4913","type":"integer","value":24137569},
    {"key":"4914","type":"integer","value":24147396},{"key":"4915","type":"integer","value":24157225},
    {"key":"4916","type":"integer","value":24167056},{"key":"4917","type":"integer","value":24176889},
    {"key":"4918","type":"integer","value":24186724},{"key":"4919","type":"integer","value":24196561},
    {"key":"4920","type":"integer","value":24206400},{"key":"4921","type":"integer","value":24216241},
    {"key":"4922","type":"integer","value":24226084},{"key":"4923","type":"integer","value":24235929},
    {"key":"4924","type":"integer","value":24245776},{"key":"4925","type":"integer","value":24255625},
    {"key":"4926","type":"integer","value":24265476},{"key":"4927","type":"integer","value":24275329},
    {"key":"4928","type":"integer","value":24285184},{"key":"4929","type":"integer","value":24295041},
    {"key":"4930","type":"integer","value":24304900},{"key":"4931","type":"integer","value":24314761},
    {"key":"4932","type":"integer","value":24324624},{"key":"4933","type":"integer","value":24334489},
    {"key":"4934","type":"integer","value":24344356},{"key":"4935","type":"integer","value":24354225},
    {"key":"4936","type":"integer","value":24364096},{"key":"4937","type":"integer","value":24373969},
    {"key":"4938","type":"integer","value":24383844},{"key":"4939","type":"integer","value":24393721},
    {"key":"4940","type":"integer","value":24403600},{"key":"4941","type":"integer","value":24413481},
    {"key":"4942","type":"integer","value":24423364},{"key":"4943","type":"integer","value":24433249},
    {"key":"4944","type":"integer","value":24443136},{"key":"4945","type":"integer","value":24453025},
    {"key":"4946","type":"integer","value":24462916},{"key":"4947","type":"integer","value":24472809},
    {"key":"4948","type":"integer","value":24482704},{"key":"4949","type":"integer","value":24492601},
    {"key":"4950","type":"integer","value":24502500},{"key":"4951","type":"integer","value":24512401},
    {"key":"4952","type":"integer","value":24522304},{"key":"4953","type":"integer","value":24532209},
    {"key":"4954","type":"integer","value":24542116},{"key":"4955","type":"integer","value":24552025},
    {"key":"4956","type":"integer","value":24561936},{"key":"4957","type":"integer","value":24571849},
    {"key":"4958","type":"integer","value":24581764},{"key":"4959","type":"integer","value":24591681},
    {"key":"4960","type":"integer","value":24601600},{"key":"4961","type":"integer","value":24611521},
    {"key":"4962","type":"integer","value":24621444},{"key":"4963","type":"integer","value":24631369},
    {"key":"4964","type":"integer","value":24641296},{"key":"4965","type":"integer","value":24651225},
    {"key":"4966","type":"integer","value":24661156},{"key":"4967","type":"integer","value":24671089},
    {"key":"4968","type":"integer","value":24681024},{"key":"4969","type":"integer","value":24690961},
    {"key":"4970","type":"integer","value":24700900},{"key":"4971","type":"integer","value":24710841},
    {"key":"4972","type":"integer","value":24720784},{"key":"4973","type":"integer","value":24730729},
    {"key":"4974","type":"integer","value":24740676},{"key":"4975","type":"integer","value":24750625},
    {"key":"4976","type":"integer","value":24760576},{"key":"4977","type":"integer","value":24770529},
    {"key":"4978","type":"integer","value":24780484},{"key":"4979","type":"integer","value":24790441},
    {"key":"4980","type":"integer","value":24800400},{"key":"4981","type":"integer","value":24810361},
    {"key":"4982","type":"integer","value":24820324},{"key":"4983","type":"integer","value":24830289},
    {"key":"4984","type":"integer","value":24840256},{"key":"4985","type":"integer","value":24850225},
    {"key":"4986","type":"integer","value":24860196},{"key":"4987","type":"integer","value":24870169},
    {"key":"4988","type":"integer","value":24880144},{"key":"4989","type":"integer","value":24890121},
    {"key":"4990","type":"integer","value":24900100},{"key":"4991","type":"integer","value":24910081},
    {"key":"4992","type":"integer","value":24920064},{"key":"4993","type":"integer","value":24930049},
    {"key":"4994","type":"integer","value":24940036},{"key":"4995","type":"integer","value":24950025},
    {"key":"4996","type":"integer","value":24960016},{"key":"4997","type":"integer","value":24970009},
    {"key":"4998","type":"integer","value":24980004},{"key":"4999","type":"integer","value":24990001}
  ],
  "height":1091300
}

Version 1

Data Transaction Binary Format Version 1#

#

Field

JSON field name

Field type

Field size in bytes

Comment

\(1\)

Version flag

Byte

\(1\)

Indicates the transaction version is \(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

Up to \(400\)

Maximum of \(100\) characters.

\(6.3\)

Value 1 type

type

Byte

\(1\)

Options are: 0 - Long. 1 - Boolean. 2 - Array[Byte]. 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

S

T is one of the following: 1) Long, \(S = 8\). 2) Boolean, \(S = 1\). 3) Array[Byte], \(S ⩽ 32,767\). 4) String, \(S ⩽ 32,767\).

\(6.6\)

Key 2 length

Short

\(2\)

\(6.7\)

Key 2

key

String

Up to \(400\)

Maximum of \(100\) characters.

\(6.8\)

Value 2 type

type

Byte

\(1\)

Options are: 0 - Long. 1 - Boolean. 2 - Array[Byte]. 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

S

T is one of the following: 1) Long, \(S = 8\). 2) Boolean, \(S = 1\). 3) Array[Byte], \(S ⩽ 32,767\). 4) String, \(S ⩽ 32,767\).

\(6.[5 × N - 4]\)

N-th key length

Short

\(2\)

\(6.[5 × N - 3]\)

N-th key

key

String

Up to \(400\)

Maximum of \(100\) characters.

\(6.[5 × N - 2]\)

N-th value type

type

Byte

\(1\)

Options are: 0 - Long. 1 - Boolean. 2 - Array[Byte]. 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

S

T is one of the following: 1) Long, \(S = 8\). 2) Boolean, \(S = 1\). 3) Array[Byte], \(S ⩽ 32,767\). 4) String, \(S ⩽ 32,767\).

\(7\)

Transaction timestamp

timestamp

Long

\(8\)

\(8\)

Transaction fee

fee

Long

\(8\)

\(9\)

Transaction proofs

proofs

See transaction proofs binary format

S

If the array is empty, then \(S = 3\). If the array is not empty, then \(S = 3 + 2 × N + 64 × N\), where \(N\) is the number of proofs in the array. The maximum number of proofs in the array is \(8\). The size of each proof is 64 bytes.

The fields \(1\), \(2\), \(3\), \(4\), \(5\), \(6.1\), \(6.2\), \(6.3\), \(6.4\), \(6.5\), \(6.6\), \(6.7\), \(6.8\), \(6.9\), \(6.10\), \(6.[5 × N - 4]\), \(6.[5 × N - 3]\), \(6.[5 × N - 2]\), \(6.[5 × N - 1]\), \(6.[5 × N]\), \(7\) and \(8\) are the transaction body bytes. The maximum number of records is \(100\). The maximum size of transaction body bytes is \(153,600\) bytes.

Exchange Transaction Binary Format#

Learn more about exchange transaction.

Version 3

Exchange transaction of version 3 can accept orders of versions 1 –4.

message ExchangeTransactionData {
  int64 amount = 1;
  int64 price = 2;
  int64 buy_matcher_fee = 3;
  int64 sell_matcher_fee = 4;
  repeated Order orders = 5;
};
Exchange Transaction Binary Format Version 3#

Field

Size

Description

amount

\(8\) bytes

Amount of the amount asset (base currency) that the buyer received from the seller, specified in the minimum fraction (“cent”) of asset.

price

\(8\) bytes

Price for the amount asset (base currency) nominated in the price asset (quote currency), multiplied by \(10^{8}\). For more details see the order article.

buy_matcher_fee

\(8\) bytes

Buy matcher fee. The fee token ID is indicated in buy order.

sell_matcher_fee

\(8\) bytes

Sell matcher fee The fee token ID is indicated in sell order.

orders

Buy order and sell order. See the order binary format.

Version 2

Transaction version 2 can accept orders of version 1, 2 and 3.

Exchange Transaction Binary Format Version 2#

#

Field

JSON field name

Field type

Field size in bytes

Comment

\(1\)

Version flag

Byte

\(1\)

Indicates the transaction version is \(2\) or higher. Value must be \(0\).

\(2\)

Transaction type ID

type

Byte

\(1\)

Value must be \(7\).

\(3\)

Transaction version

version

Byte

\(1\)

Value must be \(2\).

\(4.1\)

Buy order size

Int

\(4\)

Size including flag 4.2.

\(4.2\)

Buy order version flag

order1.version

Byte

S

\(S = 1\) if the order version is \(1\). \(S = 0\) if the order version is 2 or 3.

\(4.3\)

Buy order

order1

Array[Byte]

See order binary format

\(5.1\)

Sell order size

Int

\(4\)

Size including flag 5.2.

\(5.2\)

Sell order version flag

order2.version

Byte

S

\(S = 1\) if the order version is \(1\). \(S = 0\) if the order version is 2 or 3.

\(5.3\)

Sell order

order2

Array[Byte]

See order binary format

\(6\)

Deal price

price

Long

\(8\)

Price for the amount asset (base currency) nominated in the price asset (quote currency).

\(7\)

Amount

amount

Long

\(8\)

Amount of the amount asset (base currency) that the buyer received from the seller.

\(8\)

Buy matcher fee

buyMatcherFee

Long

\(8\)

\(9\)

Sell matcher fee

sellMatcherFee

Long

\(8\)

\(10\)

Transaction fee

fee

Long

\(8\)

\(11\)

Transaction timestamp

timestamp

Long

\(8\)

\(12\)

Transaction proofs

proofs

See transaction proofs binary format

S

If the array is empty, then \(S = 3\). If the array is not empty, then \(S = 3 + 2 × N + 64 × N\), where \(N\) is the number of proofs in the array. The maximum number of proofs in the array is \(8\). The size of each proof is \(64\) bytes.

The fields \(1\), \(2\), \(3\), \(4.1\), \(4.2\), \(4.3\), \(5.1\), \(5.2\), \(5.3\), \(6\), \(6.6\), \(7\), \(8\), \(9\), \(10\) and \(11\) are the transaction body bytes.

JSON Representation of Transaction

{
   "type":6,
   "id":"csr25XQHT1c965Fg7cY2vJ7XHYVsudPYrUbdaFqgaqL",
   "sender":"3P9QZNrHbyxXj8P9VrJZmVu2euodNtA11UW",
   "senderPublicKey":"9GaQj7gktEiiS1TTTjGbVjU9bva3AbCiawZ11qFZenBX",
   "fee":100000,
   "feeAssetId":null,
   "timestamp":1548660675277,
   "proofs": [
     "61jCivdv3KTuTY6QHgxt4jaGrXcszWg3vb9TmUR26xv7mjWWwjyqs7X5VDUs9c2ksndaPogmdunHDdjWCuG1GGhh"
   ],
   "version":2,
   "assetId":"FVxhjrxZYTFCa9Bd4JYhRqXTjwKuhYbSAbD2DWhsGidQ",
   "amount":9999,
   "chainId":87,
   "height":1370971
 }

Version 1

Transaction version 1 can accept orders of version 1 only.

Exchange Transaction Binary Format Version 1#

#

Field

Field type

Field size in bytes

Comment

\(1\)

Transaction type ID

Byte

\(1\)

Value must be \(6\).

\(2\)

Buy order size

Int

\(4\)

\(3\)

Sell order size

Int

\(4\)

\(4\)

Buy order

Array[Byte]

See order binary format

\(5\)

Sell order

Array[Byte]

See order binary format

\(6\)

Deal price

Long

\(8\)

Price for the amount asset (base currency) nominated in the price asset (quote currency).

\(7\)

Amount

Long

\(8\)

Amount of the amount asset (base currency) that the buyer received from the seller.

\(8\)

Buy matcher fee

Long

\(8\)

\(9\)

Sell matcher fee

Long

\(8\)

\(10\)

Transaction fee

Long

\(8\)

\(11\)

Transaction timestamp

Long

\(8\)

\(12\)

Transaction signature

Array[Byte]

\(64\)

The fields \(1\), \(2\), \(3\), \(4\), \(5\), \(6\), \(7\), \(8\), \(9\), \(10\) and \(11\) are the transaction body bytes.

Genesis Transaction Binary Format#

Learn more about genesis transaction.

Genesis Transaction Binary Format#

#

Field

JSON field name

Field type

Field size in bytes

Comment

\(1\)

Transaction type ID

type

Byte

\(1\)

Value must be \(1\).

\(2\)

Transaction timestamp

timestamp

Long

\(8\)

\(3\)

Address of the recipient

recipient

Array[Byte]

\(26\)

\(4\)

Amount of DecentralCoins that will be transferred to the account

amount

Long

\(8\)

JSON Representation of Transaction

{
  "type":1,
  "id":"2DVtfgXjpMeFf2PQCqvwxAiaGbiDsxDjSdNQkc5JQ74eWxjWFYgwvqzC4dn7iB1AhuM32WxEiVi1SGijsBtYQwn8",
  "fee":0,
  "timestamp":1465742577614,
  "signature":"2DVtfgXjpMeFf2PQCqvwxAiaGbiDsxDjSdNQkc5JQ74eWxjWFYgwvqzC4dn7iB1AhuM32WxEiVi1SGijsBtYQwn8",
  "recipient":"3PAWwWa6GbwcJaFzwqXQN5KQm7H96Y7SHTQ",
  "amount":9999999500000000,
  "height":1
}

Invoke Script Transaction Binary Format#

Learn more about invoke script transaction.

Version 2

message InvokeScriptTransactionData {
  Recipient d_app = 1;
  bytes function_call = 2;
  repeated Amount payments = 3;
};

message Recipient {
  oneof recipient {
    bytes public_key_hash = 1;
    string alias = 2;
  };
};

message Amount {
  bytes asset_id = 1;
  int64 amount = 2;
};
Invoke Script Transaction Binary Format Version 2#

Field

Size

Description

d_app.public_key_hash

\(20\) bytes

dApp account public key hash (a component of an address, see the Address binary format article).

d_app.alias

From \(4\) to \(30\) bytes

dApp alias.

function_call

Function name and arguments. Binary format of function call is the same as in version 1.

payments.asset_id

\(32\) bytes for asset. \(0\) for DecentralCoins.

ID of token in payment.

payments.amount

\(8\) bytes

Amount of token in payment, specified in the atomic units.

The maximum size of d_app + function_call + payments is \(5120\) bytes.

JSON Representation of Transaction

{
  "type":16,
  "id":"7CVjf5KGRRYj6UyTC2Etuu4cUxx9qQnCJox8vw9Gy9yq",
  "sender":"3P5rWeMzoaGBrXJDMifQDDjCMKWJGKTiVJU",
  "senderPublicKey":"4kKN9G7cZXGQujLQm9ss5gqB7TKX4A9jtFGt7DnHUoQ6",
  "fee":500000,
  "feeAssetId":null,
  "timestamp":1565537422938,
  "proofs": [
    "28s21sisoa7yHWWmmX8U78fbNHW4KXAS9GHD8XmaN77gJxbnP2Q3DssNWpmSQ6hBq6xS985W4YiTmgvENhfWPNt5"
  ],
  "version":1,
  "dApp":"3PJbknfXMsJzZmksmsKSMz56tVdDqF5GdNM",
  "payment":[],
  "call": {
    "function":"returnSellVST",
    "args": [
      {
        "type":"string",
        "value":"GiEBRfGhEeGqhPmLCjwJcYuakyvaz2GHGCfCzuinSKD"
      }
    ]
  },
  "height":1656369,
  "stateChanges": {
    "data": [
      {
        "key":"sell_GiEBRfGhEeGqhPmLCjwJcYuakyvaz2GHGCfCzuinSKD_spent",
        "type":"integer",
        "value":10000000000
      }
    ],
    "transfers": [
      {
        "address":"3P5rWeMzoaGBrXJDMifQDDjCMKWJGKTiVJU",
        "asset":"4LHHvYGNKJUg5hj65aGD5vgScvCBmLpdRFtjokvCjSL8",
        "amount":10000000000
      }
    ],
    "issues":[],
    "reissues":[],
    "burns":[],
    "sponsorFees":[],
    "leases":[],
    "leaseCancels":[],
    "invokes":[]
  }
}

Version 1

Invoke Script Transaction Binary Format Version 1#

#

Field

JSON field name

Field type

Field size in bytes

Comment

\(1\)

Version flag

Byte

\(1\)

Indicates the transaction version is \(2\) or higher. Value must be \(0\).

\(2\)

Transaction type ID

type

Byte

\(1\)

Value must be \(16\).

\(3\)

Transaction version

version

Byte

\(1\)

Value must be \(1\).

\(4\)

Chain ID

Byte

\(1\)

\(87\) — for Mainnet. \(84\) — for Testnet. \(83\) — for Stagenet.

\(5\)

Public key of the transaction sender

senderPublicKey

Array[Byte]

\(32\)

\(6\)

Address or alias

dApp

See Address Binary Format, Alias Binary Format

S

If the first byte of the field is \(1\), then it is followed by address. S in this case equals \(26\). If the first byte of the field is \(2\), then it is followed by alias. In this case \(8 <= S <= 34\).

\(7.1\)

Function presence flag

Byte

\(1\)

\(0\) — the default function of the dApp is invoked. \(1\) — function from the current transaction should be invoked in the dApp.

\(7.2\)

Function call ID

Byte

\(1\)

Constant. The value must be \(9\).

\(7.3\)

Function type ID

Byte

\(1\)

Constant. The value must be \(1\).

\(7.4\)

Function name length

Int

\(4\)

\(7.5\)

Function name

function

String

Up to \(255\)

\(7.6.1\)

Amount of arguments of the function

Int

\(4\)

\(7.6.2\)

ID of argument 1 type

type

Byte

\(1\)

\(0\) — argument type is long. \(1\) — argument type is an array of bytes. \(2\) — argument type is a string. \(6\) — argument type is logical True. \(7\) — argument type is logical False. \(11\) – argument type is list.

\(7.6.3\)

Argument 1

value

Options are: 1) Long. 2) Array[Byte]. 3) String. 4) Logical True. 5) Logical False. 6) List.

S

\(S = 8\), if argument type is long. If the argument type is an array of bytes, string, or list, the field size is limited only by the total transaction size. If the type is list, then 1) its length must not exceed \(1000\) elements. 2) amount of its elements represents first \(4\) bytes of the current field. 3) each list element is serialized similarly to the function argument: the element type ID takes first place followed by the element’s value. \(S = 0\), if argument type is logical True or False.

\(7.6.4\)

ID of argument 2 type

type

Byte

\(1\)

\(0\) — argument type is long. \(1\) — argument type is an array of bytes. \(2\) — argument type is a string. \(6\) — argument type is logical True. \(7\) — argument type is logical False. \(11\) – argument type is list.

\(7.6.5\)

Argument 2

value

Options are: 1) Long. 2) Array[Byte]. 3) String. 4) Logical True. 5) Logical False. 6) List.

S

\(S = 8\), if argument type is long. If the argument type is an array of bytes, string, or list, the field size is limited only by the total transaction size. If the type is list, then 1) its length must not exceed \(1000\) elements. 2) amount of its elements represents first \(4\) bytes of the current field. 3) each list element is serialized similarly to the function argument: the element type ID takes first place followed by the element’s value. \(S = 0\), if argument type is logical True or False.

\(7.6.[2 × N]\)

ID of argument N type

type

Byte

\(1\)

0 — argument type is long. 1 — argument type is an array of bytes. 2 — argument type is a string. 6 — argument type is logical True. 7 — argument type is logical False. 11 – argument type is list.

\(7.6.[2 × N + 1]\)

Argument N

value

Options are: 1) Long. 2) Array[Byte]. 3) String. 4) Logical True. 5) Logical False. 6) List.

S

\(S = 8\), if argument type is long. If the argument type is an array of bytes, string, or list, the field size is limited only by the total transaction size. If the type is list, then 1) its length must not exceed \(1000\) elements. 2) amount of its elements represents first \(4\) bytes of the current field. 3) each list element is serialized similarly to the function argument: the element type ID takes first place followed by the element’s value. \(S = 0\), if argument type is logical True or False.

\(8.1\)

Amount of payments

Short

\(2\)

\(8.2\)

Payment 1 length

Short

\(2\)

\(8.3\)

Amount of token in payment 1

amount

Long

\(8\)

\(8.4\)

Flag of payment 1 token

Byte

\(1\)

\(0\)DecentralCoins. \(1\) — other token.

\(8.5\)

ID of payment 1 token

Array[Byte]

\(32\)

Field is applicable if the token is not DecentralCoins.

\(8.[4 × N – 2]\)

Payment N length

Short

\(2\)

\(8.[4 × N – 1]\)

Amount of token in payment N

amount

Long

\(8\)

\(8.[4 × N]\)

Flag of payment N token

Byte

\(1\)

\(0\)DecentralCoins. \(1\) — other token.

\(8.[4 × N + 1]\)

ID of payment N token

Array[Byte]

\(32\)

Field is applicable if the token is not DecentralCoins.

\(9\)

Transaction fee

fee

Long

\(8\)

\(10.1\)

Flag of fee token

Byte

\(1\)

\(0\)DecentralCoins. \(1\) — other token.

\(10.2\)

Fee token ID

feeAssetId

Array[Byte]

S

\(S = 0\), if token is DecentralCoins. \(S = 32\), if it is other token.

\(11\)

Transaction timestamp

timestamp

Long

\(8\)

\(12\)

Transaction proofs

proofs

See transaction proofs binary format

S

If the array is empty, then \(S = 3\). If the array is not empty, then \(S = 3 + 2 × N + 64 × N\), where \(N\) is the number of proofs in the array. The maximum number of proofs in the array is \(8\). The size of each proof is \(64\) bytes.

The maximum number of payments is \(10\). The maximum size of transaction including proofs is \(5120\) bytes.

Issue Transaction Binary Format#

Learn more about issue transaction.

Version 3

message IssueTransactionData {
  string name = 1;
  string description = 2;
  int64 amount = 3;
  int32 decimals = 4;
  bool reissuable = 5;
  bytes script = 6;
};
Issue Transaction Binary Format Version 3#

Field

Size

Description

name

From \(4\) to \(16\) bytes

Token name.

description

From \(0\) to \(1000\) bytes

Token description.

amount

\(8\) bytes

Amount of token to issue, specified in the minimum fraction (“cents”).

decimals

\(1\) byte

Number of decimal places.

reissuable

\(1\) byte

Reissue availability flag.

script

Up to \(8192\) bytes

Asset script.

Version 2

Issue Transaction Binary Format Version 2#

#

Field

JSON field name

Field type

Field size in bytes

Comment

\(1\)

Version flag

Byte

\(0\)

Indicates the transaction version is \(2\) or higher. Value must be \(0\).

\(2\)

Transaction type ID

type

Byte

\(0\)

Value must be \(3\).

\(3\)

Transaction version

version

Byte

\(0\)

Value must be \(2\).

\(4\)

Chain ID

chainId

Byte

\(0\)

\(87\) — for Mainnet. \(84\) — for Testnet. \(83\) — for Stagenet.

\(5\)

Public key of the transaction sender

senderPublicKey

Array[Byte]

32

\(6.1\)

Token name length

Short

\(2\)

\(6.2\)

Token name

name

Array[Byte]

From \(4\) to \(16\)

\(7.1\)

Token description length

Short

\(2\)

\(7.2\)

Token description

description

Array[Byte]

From \(0\) to \(1000\)

\(8\)

Amount of the token that will be issued

quantity

Short

\(8\)

\(9\)

Number of decimal places of the token

decimals

Byte

\(0\)

\(10\)

Reissue flag

reissuable

Boolean

\(0\)

If the value is \(0\), then token reissue is not possible. If the value is \(1\), then token reissue is possible.

\(11\)

Transaction fee

fee

Short

\(8\)

\(12\)

Transaction timestamp

timestamp

Short

\(8\)

\(13.1\)

Script existence flag

Boolean

\(0\)

If the value is \(0\), then the token does not have a script. If the value is \(1\), then the token has a script.

\(13.2\)

Script length in bytes

Short

S

\(S = 0\) if the value of the script existence flag field is \(0\). \(S = 2\) if the value of the script existence flag field is 1.

\(13.3\)

Asset script

script

String

S

\(S = 0\) if the value of the script existence flag field is \(0\). \(0 < S ≤ 8192\), if the value of the script existence flag field is 1.

\(14\)

Transaction proofs

proofs

See transaction proofs binary format

S

If the array is empty, then \(S = 3\). If the array is not empty, then \(S = 3 + 2 × N + 64 × N\), where \(N\) is the number of proofs in the array. The maximum number of proofs in the array is \(82\). The size of each proof is \(64\) bytes.

The fields \(2\), \(3\), \(4\), \(5\), \(6.1\), \(6.2\), \(7.1\), \(7.2\), \(8\), \(9\), \(10\), \(11\), \(12\), \(13.1\), \(13.2\) and \(13.3\) are the transaction body bytes.

JSON Representation of Transaction

{
  "type":3,
  "id":"FTQvw9zdYirRksUFCKDvor3hiu2NiUjXEPTDEcircqti",
  "sender":"3PPP59J1pToCk7fPs4d5EK5PoHJMeQRJCTb",
  "senderPublicKey":"E8Y8ywedRS9usVvvcuczn9hsSg1SNkQVBMcNeQEnjDTP",
  "fee":100000000,
  "feeAssetId":null,
  "timestamp":1548666518362,
  "proofs": [
    "3X7GpKW1ztto1aJN5tQNByaGZ9jGkaxZNo4BT268obZckbXuNQHGKjAUxtqcSEes5aZNMaQi2JYBGeKpcaPTxpSC"
  ],
  "version":2,
  "assetId":"FTQvw9zdYirRksUFCKDvor3hiu2NiUjXEPTDEcircqti",
  "name":"DCVN",
  "quantity":990000000000000000,
  "reissuable":false,
  "decimals":8,
  "description":"Tài chính cho nền dân chủ",
  "script":null,
  "chainId":87,
  "height":1371069
}

Version 1

Issue Transaction Binary Format Version 1#

#

Field

Field type

Field size in bytes

Comment

\(1\)

Transaction type ID

Byte

\(1\)

Value must be \(3\).

\(2\)

Transaction signature

Array[Byte]

\(64\)

\(3\)

Transaction type ID

Byte

\(1\)

This field duplicates field 1.

\(4\)

Public key of the transaction sender

Array[Byte]

\(32\)

\(5.1\)

Token name length

Short

\(2\)

\(5.2\)

Token name

Array[Byte]

From \(4\) to \(16\)

\(6.1\)

Token description length

Short

\(2\)

\(6.2\)

Token description

Array[Byte]

From \(0\) to \(1000\)

\(7\)

Amount of the token that will be issued

Long

\(8\)

\(8\)

Number of decimal places of the token

Byte

\(1\)

\(9\)

Reissue flag

Boolean

\(1\)

\(10\)

Transaction fee

Long

\(8\)

\(11\)

Transaction timestamp

Long

\(8\)

The fields \(3\), \(4\), \(5.1\), \(5.2\), \(6.1\), \(6.2\), \(7\), \(8\), \(9\), \(10\) and \(11\) are the transaction body bytes.

Lease Cancel Transaction Binary Format#

Learn more about lease cancel transaction

Version 3

message LeaseCancelTransactionData {
  bytes lease_id = 1;
};
Lease Cancel Transaction Binary Format Version 3#

Field

Size

Description

lease_id

\(32\) bytes

Lease ID.

Version 2

Lease Cancel Transaction Binary Format Version 2#

#

Field

JSON field name

Field type

Field size in bytes

Comment

\(1\)

Version flag

Byte

\(1\)

Indicates the transaction version is \(2\) or higher. Value must be \(0\).

\(2\)

Transaction type ID

type

Byte

\(1\)

Value must be \(9\).

\(3\)

Transaction version

version

Byte

\(1\)

Value must be \(2\).

\(4\)

Chain ID

chainId

Byte

\(1\)

\(87\) — for Mainnet. \(84\) — for Testnet. \(83\) — for Stagenet.

\(5\)

Public key of the transaction sender

senderPublicKey

Array[Byte]

\(32\)

\(6\)

Transaction fee

fee

Long

\(8\)

\(7\)

Transaction timestamp

timestamp

Long

\(8\)

\(8\)

Lease ID

Array[Byte]

\(32\)

\(9\)

Transaction proofs

proofs

See transaction proofs binary format

S

If the array is empty, then \(S = 3\). If the array is not empty, then \(S = 3 + 2 × N + 64 × N\), where \(N\) is the number of proofs in the array. The maximum number of proofs in the array is \(8\). The size of each proof is \(64\) bytes.

The fields \(2\), \(3\), \(4\), \(5\), \(6\), \(7\), and \(8\) are the transaction body bytes.

JSON Representation of Transaction

{
  "type":9,
  "id":"7siEtrJAvmVzM1WDX6v9RN4qkiCtk7qQEeD5ZhE6955E",
  "sender":"3PMBXG13f89pq3WyJHHKX2m5zN6kt2CEkHQ",
  "senderPublicKey":"BEPNBjo9Pi9hJ3hVtxpwyEfXCW3qWUNk5dMD7aFdiHsa",
  "fee":100000,
  "feeAssetId":null,
  "timestamp":1548660629957,
  "proofs": [
    "3cqVVsaEDzBz367KTBFGgMXEYJ2r3yLWd4Ha8r3GzmAFsm2CZ3GeNW22wqxfK4LNRFgsM5kCWRVhf6gu2Nv6zVqW"
  ],
  "version":2,
  "leaseId":"BggRaeNCVmzuFGohzF4dQeYXSWr8i5zNSnGtdKc5eGrY",
  "chainId":87,
  "height":1370970,
  "lease": {
    "id":"BggRaeNCVmzuFGohzF4dQeYXSWr8i5zNSnGtdKc5eGrY",
    "originTransactionId":"BggRaeNCVmzuFGohzF4dQeYXSWr8i5zNSnGtdKc5eGrY",
    "sender":"3PMBXG13f89pq3WyJHHKX2m5zN6kt2CEkHQ",
    "recipient":"3PMWRsRDy882VR2viKPrXhtjAQx7ygQcnea",
    "amount":406813214,
    "height":1363095,
    "status":"canceled",
    "cancelHeight":1370970,
    "cancelTransactionId":"7siEtrJAvmVzM1WDX6v9RN4qkiCtk7qQEeD5ZhE6955E"
  }
}

Version 1

Lease Cancel Transaction Binary Format Version 1#

Field order number

Field

Field type

Field size in bytes

Comment

\(1\)

Transaction type ID

Byte

\(1\)

Value must be \(9\).

\(2\)

Public key of the transaction sender

Array[Byte]

\(32\)

\(3\)

Transaction fee

Long

\(8\)

\(4\)

Transaction timestamp

Long

\(8\)

\(5\)

Lease ID

Array[Byte]

\(32\)

\(6\)

Transaction signature

Array[Byte]

\(64\)

The fields \(1\), \(2\), \(3\), \(4\), and \(5\) are the transaction body bytes.

Lease Transaction Binary Format#

Learn more about lease transaction.

Version 3

message LeaseTransactionData {
  Recipient recipient = 1;
  int64 amount = 2;
};

message Recipient {
  oneof recipient {
    bytes public_key_hash = 1;
    string alias = 2;
  };
};
Lease Transaction Binary Format Version 3#

Field

Size

Description

recipient.public_key_hash

\(20\) bytes

Recipient’s account public key hash (a component of an address, see the address binary format article).

recipient.alias

From \(4\) to \(30\) bytes

Recipient’s alias.

amount

\(8\) bytes

Amount of DecentralCoins to lease (that is, amount of Decentralites multiplied by \(10^{8}\)).

Version 2

Lease Transaction Binary Format Version 2#

#

Field

JSON field name

Field type

Field size in bytes

Comment

\(1\)

Version flag

Byte

\(1\)

Indicates the transaction version is \(2\) or higher. Value must be \(0\).

\(2\)

Transaction type ID

type

Byte

\(1\)

Value must be \(8\).

\(3\)

Transaction version

version

Byte

\(1\)

Value must be \(2\).

\(4\)

Reserved field

Byte

\(1\)

Value must be equal to \(0\).

\(5\)

Public key of the transaction sender

senderPublicKey

Array[Byte]

\(32\)

\(6\)

address or alias of the recipient

recipient

See address binary format, alias binary format

S

If the first byte of the field is \(1\), then it is followed by address. S in this case equals \(26\). If the first byte of the field is \(2\), then it is followed by alias. In this case \(8 <= S <= 34\).

\(7\)

Amount of DecentralCoins that will be leased to the account

amount

Long

\(8\)

\(8\)

Transaction fee

fee

Long

\(8\)

\(9\)

Transaction timestamp

timestamp

Long

\(8\)

\(10\)

Transaction proofs

proofs

See transaction proofs binary format

S

If the array is empty, then \(S = 3\). If the array is not empty, then \(S = 3 + 2 × N + 64 × N\), where \(N\) is the number of proofs in the array. The maximum number of proofs in the array is \(8\). The size of each proof is \(64\) bytes.

The fields \(2\), \(3\), \(4\), \(5\), \(6\), \(7\), \(8\) and \(9\) are the transaction body bytes.

JSON Representation of Transaction

{
  "type":8,
  "id":"J6jZCzLpWJX8EDVhopKFx1mcbFizLGHVb44dvqPzH4QS",
  "sender":"3PMYNm8hshzCNjZ8GpPta5SyN7qBTEzS7Kw",
  "senderPublicKey":"GNswAY61mER5ZyUFeDBo1UyKGkPSSmmnd6yj7axN2n8f",
  "fee":100000,
  "feeAssetId":null,
  "timestamp":1548660916755,
  "proofs": [
    "2opTj7mGKXLRajkJ78wN4ctSWqTeWtvisHaR8BnL2amqJ2KB313BbcpDYJKcqr7o7EpYjL5tppMz2pGjUMWbJe9b"
  ],
  "version":2,
  "amount":14000000000,
  "recipient":"3PMWRsRDy882VR2viKPrXhtjAQx7ygQcnea",
  "height":1370973,
  "status":"canceled"
}

Version 1

Lease Transaction Binary Format Version 1#

#

Field

Field type

Field size in bytes

Comment

\(1\)

Transaction type ID

Byte

\(1\)

Value must be \(8\).

\(2\)

Public key of the transaction sender

Array[Byte]

\(32\)

\(3\)

address or alias of the recipient

See address binary format, alias binary format

S

If the first byte of the field is \(1\), then it is followed by address. S in this case equals \(26\). If the first byte of the field is \(2\), then it is followed by alias. In this case \(8 <= S <= 34\).

\(4\)

Amount of DecentralCoins that will be leased to the account

Long

\(8\)

\(5\)

Transaction fee

Long

\(8\)

\(6\)

Transaction timestamp

Long

\(8\)

\(7\)

Transaction signature

Array[Byte]

\(64\)

The fields \(1\), \(2\), \(3\), \(4\), \(5\) and \(6\) are the transaction body bytes.

Mass Transfer Transaction Binary Format#

Learn more about mass transfer transaction.

Version 2

message MassTransferTransactionData {
  message Transfer {
    Recipient recipient = 1;
    int64 amount = 2;
  };
  bytes asset_id = 1;
  repeated Transfer transfers = 2;
  bytes attachment = 3;
};

message Recipient {
  oneof recipient {
    bytes public_key_hash = 1;
    string alias = 2;
  };
}
Mass Transaction Binary Format Version 2#

Field

Size

Description

asset_id

\(32\) bytes

ID of token to transfer.

transfers.recipient.public_key_hash

\(20\) bytes

Recipient’s account public key hash (a component of an address, see the address binary format article).

transfers.recipient.alias

From \(4\) to \(30\) bytes

Recipient’s alias.

transfers.amount

\(8\) bytes

Amount of token to transfer, specified in the minimum fraction (“cents”).

attachment

Up to \(140\) bytes

Arbitrary data (typically a comment to transfer).

The maximim number of transfers is \(100\).

JSON Representation of Transaction

{
  "type":11,
  "id":"3LRfudet7avpQcW1AdauiBGb8SSRAaoCugDzngDPLVcv",
  "sender":"3P2rvn2Hpz6pJcH8oPNrwLsetvYP852QQ2m",
  "senderPublicKey":"5DphrhGy6MM4N3yxfB2uR2oFUkp2MNMpSzhZ4uJEm3U1",
  "fee":5100000,
  "feeAssetId":null,
  "timestamp":1528973951321,
  "proofs": [
    "FmGBaWABAy5bif7Qia2LWQ5B4KNmBnbXETL1mE6XEy4AAMjftt3FrxAa8x2pZ9ux391oY5c2c6ZSDEM4nzrvJDo"
  ],
  "version":1,
  "assetId":"Fx2rhWK36H1nfXsiD4orNpBm2QG1JrMhx3eUcPVcoZm2",
  "attachment":"xZBWqm9Ddt5BJVFvHUaQwB7Dsj78UQ5HatQjD8VQKj4CHG48WswJxUUeHEDZJkHgt9LycUpHBFc8ENu8TF8vvnDJCgfy1NeKaUNydqy9vkACLZjSqaVmvfaM3NQB",
  "transferCount":6,
  "totalAmount":500000000000,
  "transfers": [
    {"recipient":"3PHnjQrdK389SbzwPEJHYKzhCqWvaoy3GQB","amount":5000000000},
    {"recipient":"3PGNLwUG2GPpw74teTAxXFLxgFt3T2uQJsF","amount":5000000000},
    {"recipient":"3P5kQneM9EdpVUbFLgefD385LLYTXY5J32c","amount":5000000000},
    {"recipient":"3P2j9FZyygnVDCQvmSc41VCAKwwCQm8QUhA","amount":5000000000},
    {"recipient":"3PNBZutLvMpjzxGAiQGqQuDyanhWyLi2Fhi","amount":5000000000},
    {"recipient":"3P84vdYxzDPFbS5zj9J6yCkmKKA2QMo1DKA","amount":5000000000},
  ],
  "height":1041197
}

Version 1

Mass Transaction Binary Format Version 1#

#

Field

JSON field name

Field type

Field size in bytes

Comment

\(1\)

Transaction type ID

type

Byte

\(1\)

Value must be \(11\).

\(2\)

Transaction version

version

Byte

\(1\)

Value must be \(1\).

\(3\)

Public key of the transaction sender

senderPublicKey

Array[Byte]

\(32\)

\(4.1\)

Flag DecentralCoins/token

Byte

\(1\)

Value is \(0\) for transferring DecentralCoins. Value is \(1\) for transferring other tokens.

\(4.2\)

Token ID

assetId

Array[Byte]

S

\(S = 0\) if the value of the flag DecentralCoins/token field is \(0\). \(S = 32\) if the value of the flag DecentralCoins/token field is \(1\).

\(5.1\)

Number of transfers

transferCount

Short

\(2\)

\(5.2\)

address or alias of the recipient

recipient

See address binary format, alias binary format

S

If the first byte of the field is \(1\), then it is followed by address. S in this case equals \(26\). If the first byte of the field is \(2\), then it is followed by alias. In this case \(8 <= S <= 34\).

\(5.3\)

Amount of tokens in the transfer 1

amount

Long

\(8\)

\(5.4\)

Address or alias of the recipient

recipient

See address binary format, alias binary format

S

If the first byte of the field is \(1\), then it is followed by address. S in this case equals \(26\). If the first byte of the field is \(2\), then it is followed by alias. In this case \(8 <= S <= 34\).

\(5.5\)

Amount of tokens in the transfer 2

amount

Long

\(8\)

\(5.[2 × N]\)

Address or alias of the recipient

recipient

See address binary format, alias binary format

S

If the first byte of the field is \(1\), then it is followed by address. S in this case equals \(26\). If the first byte of the field is \(2\), then it is followed by alias. In this case \(8 <= S <= 34\).

\(5.[2 × N + 1]\)

Amount of tokens in the transferN

amount

Long

\(8\)

\(6\)

Transaction timestamp

timestamp

Long

\(8\)

\(7\)

Transaction fee

fee

Long

\(8\)

\(8.1\)

Attachment length

Short

\(2\)

\(8.2\)

Attachment

Array[Byte]

\(2\)

Arbitrary data attached to the transaction.

\(9\)

Transaction proofs

proofs

See transaction proofs binary format

S

If the array is empty, then \(S = 3\). If the array is not empty, then \(S = 3 + 2 × N + 64 × N\), where \(N\) is the number of proofs in the array. The maximum number of proofs in the array is \(8\). The size of each proof is \(64\) bytes.

The fields \(1\), \(2\), \(3\), \(4.1\), \(4.2\), \(5.1\), \(5.2\), \(5.3\), \(5.4\), \(5.5\), \(5.[2 × N]\), \(5.[2 × N + 1]\), \(6\), \(7\), \(8.1\) and \(8.2\) are the transaction body bytes.

Reissue Transaction Binary Format#

Learn more about reissue transaction.

Version 3

message ReissueTransactionData {
  Amount asset_amount = 1;
  bool reissuable = 2;
};

message Amount {
  bytes asset_id = 1;
  int64 amount = 2;
};
Reissue Transaction Binary Format Version 3#

Field

Size

Description

asset_id

\(32\) bytes

ID of token to reissue.

asset_amount.amount

\(8\) bytes

Amount of token to reissue, specified in the minimum fraction (“cents”).

reissuable

\(1\) byte

Reissue availability flag.

Version 2

Reissue Transaction Binary Format Version 2#

#

Field

JSON field name

Field type

Field size in bytes

Comment

\(1\)

Version flag

Byte

\(1\)

Indicates the transaction version is 2 or higher. Value must be \(0\).

\(2\)

Transaction type ID

type

Byte

\(1\)

Value must be \(5\).

\(3\)

Transaction version

version

Byte

\(1\)

Value must be \(2\).

\(4\)

Chain ID

chainId

Byte

\(1\)

\(87\) — for Mainnet. \(84\) — for Testnet. \(83\) — for Stagenet.

\(5\)

Public key of the transaction sender

senderPublicKey

Array[Byte]

\(32\)

\(6\)

Token ID

assetId

Array[Byte]

\(32\)

\(7\)

Amount of token that will be reissued

quantity

Long

\(8\)

\(8\)

Reissue flag

reissuable

Boolean

\(1\)

If the value is \(0\), then token reissue is not possible. If the value is \(1\), then token reissue is possible.

\(9\)

Transaction fee

fee

Long

\(8\)

\(10\)

Transaction timestamp

timestamp

Long

\(8\)

\(11\)

Transaction proofs

proofs

See transaction proofs binary format

S

If the array is empty, then \(S = 3\). If the array is not empty, then \(S = 3 + 2 × N + 64 × N\), where \(N\) is the number of proofs in the array. The maximum number of proofs in the array is \(8\). The size of each proof is \(64\) bytes.

The fields \(2\), \(3\), \(4\), \(5\), \(6\), \(7\), \(8\), \(9\) and \(10\) are the transaction body bytes.

JSON Representation of Transaction

{
  "type":5,
  "id":"27ETigYaHym2Zbdp4x1gnXnZPF1VJCqQpXmhszC35Qac",
  "sender":"3PLJciboJqgKsZWLj7k1VariHgre6uu4S2T",
  "senderPublicKey":"DjYEAb3NsQiB6QdmVAzkwJh7iLgUs3yDLf7oFEeuZjfM",
  "fee":100000000,
  "feeAssetId":null,
  "timestamp":1548521785933,
  "proofs": [
    "5mEveeUwBdBqe8naNoV5eAe5vj6fk8U743eHGkhxhs3v9PMsb3agHqpe4EtzpUFdpASJegXyjrGSbynZg557cnSq"
  ],
  "version":2,
  "assetId":"GA4gB3Lf3AQdF1vBCbqGMTeDrkUxY7L83xskRx6Z7kEH",
  "quantity":200000,
  "reissuable":true,
  "chainId":87,
  "height":1368623
}

Version 1

Reissue Transaction Binary Format Version 1#

Field order number

Field

Field type

Field size in bytes

Comment

\(1\)

Transaction type ID

Byte

\(1\)

Value must be \(5\).

\(2\)

Transaction signature

Array[Byte]

\(64\)

\(3\)

Transaction type ID

Byte

\(1\)

This field duplicates field \(1\).

\(4\)

Public key of the transaction sender

Array[Byte]

\(32\)

\(5\)

Token ID

Array[Byte]

\(32\)

\(6\)

Amount of token that will be reissued

Long

\(8\)

\(7\)

Reissue flag

Boolean

\(1\)

If the value is \(0\), then token reissue is not possible. If the value is \(1\), then token reissue is possible.

\(8\)

Transaction fee

Long

\(8\)

\(9\)

Transaction timestamp

Long

\(8\)

The fields \(3\), \(4\), \(5\), \(6\), \(7\), \(8\) and \(9\) are the transaction body bytes.

Set Asset Script Transaction Binary Format#

Learn more about set asset script transaction.

Version 2

message SetAssetScriptTransactionData {
  bytes asset_id = 1;
  bytes script = 2;
};
Set Asset Script Transaction Binary Format Version 2#

Field

Size

Description

asset_id

\(32\) bytes

ID of asset.

script

Up to \(8192\) bytes

Asset script.

The maximim number of transfers is \(100\).

JSON Representation of Transaction

{
  "type":15,
  "id":"FwYSpmVDbWQ2BA5NCBZ9z5GSjY39PSyfNZzBayDiMA88",
  "sender":"3P67JUW8Djit7hMjKhADmn6CWvKPbRuh2sQ",
  "senderPublicKey":"AwQYJRHZNd9bvF7C13uwnPiLQfTzvDFJe7DTUXxzrGQS",
  "fee":100000000,
  "feeAssetId":null,
  "timestamp":1547201038106,
  "proofs": [
    "nzYhVKmRmd7BiFDDfrFVnY6Yo98xDGsKrBLWentF7ibe4P9cGWg4RtomHum2NEMBhuyZb5yjThcW7vsCLg7F8NQ"
  ],
  "version":1,
  "assetId":"7qJUQFxniMQx45wk12UdZwknEW9cDgvfoHuAvwDNVjYv",
  "script":"base64:AQa3b8tH",
  "chainId":87,
  "height":1346345
}

Version 1

Set Asset Script Transaction Binary Format Version 1#

#

Field

JSON field name

Field type

Field size in bytes

Comment

\(1\)

Version flag

Byte

\(1\)

Indicates the transaction version is \(2\) or higher. Value must be \(0\).

\(2\)

Transaction type ID

type

Byte

\(1\)

Value must be \(15\).

\(3\)

Transaction version

version

Byte

\(1\)

Value must be \(1\).

\(4\)

Chain ID

chainId

Byte

\(1\)

\(87\) — for Mainnet. \(84\) — for Testnet. \(83\) — for Stagenet.

\(5\)

Public key of the transaction sender

senderPublicKey

Array[Byte]

\(32\)

\(6\)

Token ID to which the asset script is attached

assetId

Array[Byte]

\(32\)

\(7\)

Transaction fee

fee

Long

\(8\)

\(8\)

Transaction timestamp

timestamp

Long

\(8\)

\(9.1\)

Script existence flag

Boolean

\(1\)

If the value is \(0\), then the token does not have a script. If the value is \(1\), then the token has a script.

\(9.2\)

Script size in bytes

Short

S

\(S = 0\) if the value of the script existence flag field is \(0\). \(S = 2\) if the value of the script existence flag field is \(1\).

\(9.3\)

Asset script

script

String

S

\(S = 0\) if the value of the script existence flag field is \(0\). \(0 < S ≤ 8192\), if the value of the script existence flag field is \(1\).

\(10\)

Transaction proofs

proofs

See transaction proofs binary format

S

If the array is empty, then \(S = 3\). If the array is not empty, then \(S = 3 + 2 × N + 64 × N\), where \(N\) is the number of proofs in the array. The maximum number of proofs in the array is \(8\). The size of each proof is \(64\) bytes.

The fields \(2\), \(3\), \(4\), \(5\), \(6\), \(7\), \(8\), \(9.1\), \(9.2\) and \(9.3\) are the transaction body bytes.

Set Script Transaction Binary Format#

Learn more about set script transaction.

Version 2

message SetScriptTransactionData {
  bytes script = 1;
};
Set Script Transaction Binary Format Version 2#

Field

Size

Description

script

Up to \(32,768\) bytes

Account script or dApp script.

JSON Representation of Transaction

{
  "type":13,
  "id":"8Nwjd2tcQWff3S9WAhBa7vLRNpNnigWqrTbahvyfMVrU",
  "sender":"3PBSduYkK7GQxVFWkKWMq8GQkVdAGX71hTx",
  "senderPublicKey":"3LZmDK7vuSBsDmFLxJ4qihZynUz8JF9e88dNu5fsus5p",
  "fee":2082496,
  "feeAssetId":null,
  "timestamp":1537973512182,
  "proofs": [
    "V45jPG1nuEnwaYb9jTKQCJpRskJQvtkBcnZ45WjZUbVdNTi1KijVikJkDfMNcEdSBF8oGDYZiWpVTdLSn76mV57"
  ],
  "version":1,
  "script":"base64:AQQAAAAEaW5hbAIAAAAESW5hbAQAAAAFZWxlbmECAAAAB0xlbnVza2EEAAAABGxvdmUCAAAAC0luYWxMZW51c2thCQAAAAAAAAIJAAEsAAAAAgUAAAAEaW5hbAUAAAAFZWxlbmEFAAAABGxvdmV4ZFt5",
  "chainId":87,
  "height":1190001
}

Version 1

Set Script Transaction Binary Format Version 1#

#

Field

JSON field name

Field type

Field size in bytes

Comment

\(1\)

Version flag

Byte

\(1\)

Indicates the transaction version is \(2\) or higher. Value must be \(0\).

\(2\)

Transaction type ID

type

Byte

\(1\)

Value must be \(13\).

\(3\)

Transaction version

version

Byte

\(1\)

Value must be \(1\).

\(4\)

Chain ID

chainId

Byte

\(1\)

\(87\) — for Mainnet. \(84\) — for Testnet. \(83\) — for Stagenet.

\(5\)

Public key of the transaction sender

senderPublicKey

Array[Byte]

\(32\)

\(6.1\)

Script existence flag

Boolean

\(1\)

If the value is \(0\), then the token does not have a script. If the value is \(1,\) then the token has a script.

\(6.2\)

Script length

Short

S

\(S = 0\) if the value of the script existence flag field is \(0\). \(S = 2\) if the value of the script existence flag field is \(1\).

\(6.3\)

Script

script

String

S

\(S = 0\) if the value of the script existence flag field is \(0\). \(0 < S ≤ 32,768\), if the value of the script existence flag field is \(1\).

\(7\)

Transaction fee

fee

Long

\(8\)

\(8\)

Transaction timestamp

timestamp

Long

\(8\)

\(9\)

Transaction proofs

proofs

See transaction proofs binary format

S

If the array is empty, then \(S = 3\). If the array is not empty, then \(S = 3 + 2 × N + 64 × N\), where \(N\) is the number of proofs in the array. The maximum number of proofs in the array is \(8\). The size of each proof is \(64\) bytes.

Transfer Transaction Binary Format#

Learn more about transfer transaction.

Version 3

message TransferTransactionData {
  Recipient recipient = 1;
  Amount amount = 2;
  bytes attachment = 3;
};

message Recipient {
  oneof recipient {
    bytes public_key_hash = 1;
    string alias = 2;
  };

message Amount {
  bytes asset_id = 1;
  int64 amount = 2;
};
Transfer Transaction Binary Format Version 3#

Field

Size

Description

recipient.public_key_hash

\(20\) bytes

Recipient’s account public key hash (a component of an address, see the address binary format article).

recipient.alias

From \(4\) to \(30\) bytes

Recipient’s alias.

amount.asset_id

\(32\) bytes

ID of token to transfer.

amount.amount

\(8\) bytes

Amount of token to transfer, specified in the minimum fraction (“cents”).

attachment

Up to \(140\) bytes

Arbitrary data (typically a comment to transfer).

Version 2

Transfer Transaction Binary Format Version 2#

#

Field

JSON field name

Field type

Field size in bytes

Comment

\(1\)

Version flag

Byte

\(1\)

Indicates the transaction version is \(2\) or higher. Value must be \(0\).

\(2\)

Transaction type ID

type

Byte

\(1\)

Value must be \(4\).

\(3\)

Transaction version

version

Byte

\(1\)

Value must be \(2\).

\(4\)

Public key of the transaction sender

senderPublicKey

Array[Byte]

\(32\)

\(5.1\)

Transferring token type flag

Byte

\(1\)

Value is \(0\) for transferring DecentralCoins. Value is \(1\) for transferring other token.

\(5.2\)

Transferring token ID

assetId

Array[Byte]

S

math:S = 0 if the value of the flag 5.1 is \(0\). \(S = 32\) if the value of the flag 5.1 is \(1\).

\(6.1\)

Fee token type flag

Byte

\(1\)

Value is 0 for fee in DecentralCoins. Value is \(1\) for fee in other token.

\(6.2\)

Fee token ID

feeAssetId

Array[Byte]

S

Token to pay the fee. \(S = 0\) if the value of the flag 6.1 is \(0\). \(S = 32\) if the value of the flag 6.1 field is \(1\).

\(7\)

Transaction timestamp

timestamp

Long

\(8\)

\(8\)

Amount of token in the transfer

amount

Long

\(8\)

\(9\)

Transaction fee

fee

Long

\(8\)

\(10\)

Address or alias

recipient

See address binary format, alias binary format

S

If the first byte of the field is \(1\), then it is followed by address. S in this case equals \(26\). If the first byte of the field is \(2\), then it is followed by alias. In this case \(8 <= S <= 34\)

\(11.1\)

Attachment length

Short

\(2\)

\(11.2\)

Attachment

attachment

Array[Byte]

Up to \(140\) bytes

Arbitrary data attached to the transaction.

\(12\)

Transaction proofs

proofs

See transaction proofs binary format

S

If the array is empty, then \(S = 3\). If the array is not empty, then \(S = 3 + 2 × N + 64 × N\), where N is the number of proofs in the array. The maximum number of proofs in the array is \(8\). The size of each proof is \(64\) bytes.

JSON Representation of Transaction

{
  "type":4,
  "id":"2UMEGNXwiRzyGykG8voDgxnwHA7w5aX5gmxdcf9DZZjL",
  "sender":"3PCeQD3nAyHmzDSYBUnSPDWf9qxqzVU2sjh",
  "senderPublicKey":"6kn1XPDh2XUjVAgznxNousHq3EnKKLx7BRWyJzVFU76J",
  "fee":100000,
  "feeAssetId":null,
  "timestamp":1583160322998,
  "proofs": [
    "2z5fnoigbsCBqRPWqTDeDmGJF6qJwnm2WLspen6c6qziTc73sBh9Kh81kPhUT9DGg7ANwqsXMxQauEvyw3RxNH7z"
  ],
  "version":2,
  "recipient":"3P45uRnyVygTnbEJNxc2CHLUiC4izQxbuuS",
  "assetId":"51LxAtwBXapvvTFSbbh4nLyWFxH6x8ocfNvrXxbTChze",
  "feeAsset":null,
  "amount":30077000000,
  "attachment":"2d6RhvQATwGbyv7dKT3L77758iJx",
  "height":1954598
}

Version 1

Transfer Transaction Binary Format Version 1#

#

Field

Field type

Field size in bytes

Comment

\(1\)

Transaction type ID

Byte

\(1\)

Value must be \(4\).

\(2\)

Transaction signature

Array[Byte]

\(64\)

\(3\)

Transaction type ID

Byte

\(1\)

This field duplicates field \(1\).

\(4\)

Public key of the transaction sender

Array[Byte]

\(32\)

\(5.1\)

Transferring token type flag

Byte

\(1\)

Value is \(0\) for transferring DecentralCoins. Value is 1 for transferring other token.

\(5.2\)

Transferring token ID

Array[Byte]

S

\(S = 0\) if the value of the flag 5.1 is \(0\). \(S = 32\) if the value of the flag 5.1 is \(1\).

\(6.1\)

Fee token type flag

Byte

\(1\)

Value is \(0\) for fee in DecentralCoins. Value is \(1\) for fee in other token.

\(6.2\)

Fee token ID

Array[Byte]

S

Token to pay the fee. \(S = 0\) if the value of the flag 6.1 is 0. \(S = 32\) if the value of the flag 6.1 field is \(1\).

\(7\)

Transaction timestamp

Long

\(8\)

\(8\)

Amount of token in the transfer

amount

Long

\(8\)

\(9\)

Transaction fee

fee

Long

\(8\)

\(10\)

Address or alias

recipient

See address binary format, alias binary format

S

\(11.1\)

Attachment length

Short

\(2\)

\(11.2\)

Attachment

attachment

Array[Byte]

Up to \(140\) bytes.

Update Asset Info Transaction Binary Format#

Learn more about update asset info transaction.

Version 1

message UpdateAssetInfoTransactionData {
  bytes asset_id = 1;
  string name = 2;
  string description = 3;
}
Update Asset Info Transaction Binary Format Version 1#

Field

Size

Description

asset_id

\(32\) bytes

Token ID.

name

From \(4\) to \(16\) bytes

Token name.

description

From \(0\) to \(1000\) bytes

Token description.

Transaction Proofs Binary Format#

Transaction Proofs Binary Format#

#

Field

Type

Size in bytes

Comment

\(1\)

Proofs version

Byte

\(1\)

Value is 1.

\(2\)

Proofs count

Short

\(2\)

\(3\)

Proof 1 length

Short

\(2\)

Value is 64.

\(4\)

Proofs 1

Array[Byte]

\(64\)

\(5\)

Proof 2 length

Short

\(2\)

\(6\)

Proof 2

Array[Byte]

\(64\)

The maximum number of proofs is \(8\).