Link Search Menu Expand Document

Serialization

Basic Types

Amount
8 ubytes
Height
8 ubytes
Timestamp
4 ubytes
Address
40 ubytes
Hash256
32 ubytes
PublicKey
32 ubytes
Signature
64 ubytes

Enumerations

NetworkType

Size: 1 byte = 0x1
schema

enumeration of network types

0x68
MAINNET

main network

0x98
TESTNET

test network

TransactionType

Size: 4 bytes = 0x4
schema

enumeration of transaction types

0x101
TRANSFER

transfer transaction

0x801
ACCOUNT_KEY_LINK

account key link trasaction alternatively called importance transfer transaction

0x1001
MULTISIG_ACCOUNT_MODIFICATION

multisig account modification transaction alternatively called multisig consignatory modification transaction

0x1002
MULTISIG_COSIGNATURE

multisig cosignature transaction alternatively called multisig signature transaction

0x1004
MULTISIG_TRANSACTION

multisig transaction

0x2001
NAMESPACE_REGISTRATION

namespace registration transaction alternatively called provision namespace transaction

0x4001
MOSAIC_DEFINITION

mosaic definition transaction alternatively called mosaic definition creation transaction

0x4002
MOSAIC_SUPPLY_CHANGE

mosaic supply change transaction

BlockType

Size: 4 bytes = 0x4
schema

enumeration of block types

0xffffffff
NEMESIS

nemesis block

0x1
NORMAL

normal block

LinkAction

Size: 4 bytes = 0x4
schema

enumeration of link actions

0x1
LINK

unlink account

0x2
UNLINK

link account

MosaicTransferFeeType

Size: 4 bytes = 0x4
schema

enumeration of mosaic transfer fee types

0x1
ABSOLUTE

fee represents an absolute value

0x2
PERCENTILE

fee is proportional to a percentile of the transferred mosaic

MosaicSupplyChangeAction

Size: 4 bytes = 0x4
schema

enumeration of mosaic supply change actions

0x1
INCREASE

increases the supply

0x2
DECREASE

decreases the supply

MultisigAccountModificationType

Size: 4 bytes = 0x4
schema

enumeration of multisig account modification types

0x1
ADD_COSIGNATORY

add a new cosignatory

0x2
DELETE_COSIGNATORY

delete an existing cosignatory

MessageType

Size: 4 bytes = 0x4
schema

enumeration of message types this is a hint used by the client but ignored by the server

0x1
PLAIN

plain message

0x2
ENCRYPTED

encrypted message

Structures

Block

Size: 160+ bytes = 0xa0+ (variable)
schema

binary layout for a block

 
 
 
type
BlockType

block type

EntityBody112 bytes = 0x70
 
 
 
version
byte[1]

entity version

 
 
 
entity_body_reserved_1
byte[2]
reserved 0

reserved padding between version and network type

 
 
 
network
NetworkType

entity network

 
 
 
timestamp
Timestamp

entity timestamp

 
 
 
signer_public_key_size
byte[4]
reserved 32

entity signer public key size

 
 
 
signer_public_key
PublicKey

entity signer public key

 
 
 
signature_size
byte[4]
reserved 64

entity signature size

 
 
 
signature
Signature

entity signature

 
 
 
previous_block_hash
Hash256

previous block hash

 
 
 
height
Height

block height

 
 
 
transactions_count
byte[4]

transactions count

 
 
 
transactions
Transaction​[transactions_count]

transactions

AccountKeyLinkTransaction

Size: 173 bytes = 0xad
schema

binary layout for an account key link transaction

 
 
 
TRANSACTION_VERSION
byte[1]
const 1
 
 
 
TRANSACTION_TYPE
TransactionType
const ACCOUNT_KEY_LINK (0x801)
Transaction128 bytes = 0x80
 
 
 
type
TransactionType

transaction type

EntityBody112 bytes = 0x70
 
 
 
version
byte[1]

entity version

 
 
 
entity_body_reserved_1
byte[2]
reserved 0

reserved padding between version and network type

 
 
 
network
NetworkType

entity network

 
 
 
timestamp
Timestamp

entity timestamp

 
 
 
signer_public_key_size
byte[4]
reserved 32

entity signer public key size

 
 
 
signer_public_key
PublicKey

entity signer public key

 
 
 
signature_size
byte[4]
reserved 64

entity signature size

 
 
 
signature
Signature

entity signature

 
 
 
fee
Amount

transaction fee

 
 
 
deadline
Timestamp

transaction deadline

 
 
 
link_action
LinkAction

link action

 
 
 
remote_public_key_size
byte[4]
reserved 32

remote account public key size

 
 
 
remote_public_key
PublicKey

public key of remote account to which importance should be transferred

NamespaceId

Size: 4+ bytes = 0x4+ (variable)
schema

binary layout for a namespace id

 
 
 
name_size
byte[4]

name size

 
 
 
name
byte[name_size]

name

MosaicId

Size: 8+ bytes = 0x8+ (variable)
schema

binary layout for a mosaic id

 
 
 
namespace_id
NamespaceId

namespace id

 
 
 
name_size
byte[4]

name size

 
 
 
name
byte[name_size]

name

Mosaic

Size: 16+ bytes = 0x10+ (variable)
schema

binary layout for a mosaic

 
 
 
mosaic_id
MosaicId

mosaic id

 
 
 
amount
Amount

quantity

MosaicLevy

Size: 64+ bytes = 0x40+ (variable)
schema

binary layout for a mosaic levy

 
 
 
transfer_fee_type
MosaicTransferFeeType

mosaic fee type

 
 
 
recipient_address_size
byte[4]
reserved 40

recipient address size

 
 
 
recipient_address
Address

recipient address

 
 
 
mosaic_id
MosaicId

levy mosaic

 
 
 
fee
Amount

amount of levy mosaic to transfer

MosaicProperty

Size: 8+ bytes = 0x8+ (variable)
schema

binary layout for a mosaic property supported property names are: divisibility, initialSupply, supplyMutable, transferable

 
 
 
name_size
byte[4]

property name size

 
 
 
name
byte[name_size]

property name

 
 
 
value_size
byte[4]

property value size

 
 
 
value
byte[value_size]

property value

MosaicDefinition

Size: 120+ bytes = 0x78+ (variable)
schema

binary layout for a mosaic definition

 
 
 
owner_public_key_size
byte[4]
reserved 32

owner public key size

 
 
 
owner_public_key
PublicKey

owner public key

 
 
 
id
MosaicId

mosaic id referenced by this definition

 
 
 
description_size
byte[4]

description size

 
 
 
description
byte[description_size]

description

 
 
 
properties_count
byte[4]

number of properties

 
 
 
properties
MosaicProperty​[properties_count]

properties

 
 
 
levy_size
byte[4]

size of the serialized levy

 
 
 
levy
MosaicLevy

optional levy that is applied to transfers of this mosaic

MosaicDefinitionTransaction

Size: 305+ bytes = 0x131+ (variable)
schema

binary layout for an importance transfer transaction

 
 
 
TRANSACTION_VERSION
byte[1]
const 1
 
 
 
TRANSACTION_TYPE
TransactionType
const MOSAIC_DEFINITION (0x4001)
Transaction128 bytes = 0x80
 
 
 
type
TransactionType

transaction type

EntityBody112 bytes = 0x70
 
 
 
version
byte[1]

entity version

 
 
 
entity_body_reserved_1
byte[2]
reserved 0

reserved padding between version and network type

 
 
 
network
NetworkType

entity network

 
 
 
timestamp
Timestamp

entity timestamp

 
 
 
signer_public_key_size
byte[4]
reserved 32

entity signer public key size

 
 
 
signer_public_key
PublicKey

entity signer public key

 
 
 
signature_size
byte[4]
reserved 64

entity signature size

 
 
 
signature
Signature

entity signature

 
 
 
fee
Amount

transaction fee

 
 
 
deadline
Timestamp

transaction deadline

 
 
 
mosaic_definition
MosaicDefinition

mosaic definition

 
 
 
rental_fee_sink_size
byte[4]
reserved 40

mosaic rental fee sink public key size

 
 
 
rental_fee_sink
Address

mosaic rental fee sink public key

 
 
 
rental_fee
Amount

mosaic rental fee

MosaicSupplyChangeTransaction

Size: 153+ bytes = 0x99+ (variable)
schema

binary layout for an mosaic supply change transaction

 
 
 
TRANSACTION_VERSION
byte[1]
const 1
 
 
 
TRANSACTION_TYPE
TransactionType
const MOSAIC_SUPPLY_CHANGE (0x4002)
Transaction128 bytes = 0x80
 
 
 
type
TransactionType

transaction type

EntityBody112 bytes = 0x70
 
 
 
version
byte[1]

entity version

 
 
 
entity_body_reserved_1
byte[2]
reserved 0

reserved padding between version and network type

 
 
 
network
NetworkType

entity network

 
 
 
timestamp
Timestamp

entity timestamp

 
 
 
signer_public_key_size
byte[4]
reserved 32

entity signer public key size

 
 
 
signer_public_key
PublicKey

entity signer public key

 
 
 
signature_size
byte[4]
reserved 64

entity signature size

 
 
 
signature
Signature

entity signature

 
 
 
fee
Amount

transaction fee

 
 
 
deadline
Timestamp

transaction deadline

 
 
 
mosaic_id
MosaicId

mosaic id

 
 
 
action
MosaicSupplyChangeAction

supply change action

 
 
 
delta
Amount

change amount

MultisigAccountModification

Size: 40 bytes = 0x28
schema

binary layout for a multisig account modification

 
 
 
modification_type
MultisigAccountModificationType

modification type

 
 
 
cosignatory_public_key_size
byte[4]
reserved 32

cosignatory public size

 
 
 
cosignatory_public_key
PublicKey

cosignatory public key

MultisigAccountModificationTransaction2

Size: 146+ bytes = 0x92+ (variable)
schema

binary layout for a multisig account modification transaction (V2)

 
 
 
TRANSACTION_VERSION
byte[1]
const 2
MultisigAccountModificationTransaction137+ bytes = 0x89+ (variable)
 
 
 
TRANSACTION_VERSION
byte[1]
const 1
 
 
 
TRANSACTION_TYPE
TransactionType
const MULTISIG_ACCOUNT_MODIFICATION (0x1001)
Transaction128 bytes = 0x80
 
 
 
type
TransactionType

transaction type

EntityBody112 bytes = 0x70
 
 
 
version
byte[1]

entity version

 
 
 
entity_body_reserved_1
byte[2]
reserved 0

reserved padding between version and network type

 
 
 
network
NetworkType

entity network

 
 
 
timestamp
Timestamp

entity timestamp

 
 
 
signer_public_key_size
byte[4]
reserved 32

entity signer public key size

 
 
 
signer_public_key
PublicKey

entity signer public key

 
 
 
signature_size
byte[4]
reserved 64

entity signature size

 
 
 
signature
Signature

entity signature

 
 
 
fee
Amount

transaction fee

 
 
 
deadline
Timestamp

transaction deadline

 
 
 
modifications_count
byte[4]

number of modifications

 
 
 
modifications
MultisigAccountModification​[modifications_count]

multisig account modifications

 
 
 
min_approval_delta_size
byte[4]
reserved 4

the size of the min_approval_delta

 
 
 
min_approval_delta
byte[4]

relative change of the minimal number of cosignatories required when approving a transaction

Cosignature

Size: 217 bytes = 0xd9
schema

cosignature attached to an aggregate transaction

 
 
 
TRANSACTION_VERSION
byte[1]
const 1
 
 
 
TRANSACTION_TYPE
TransactionType
const MULTISIG_COSIGNATURE (0x1002)
Transaction128 bytes = 0x80
 
 
 
type
TransactionType

transaction type

EntityBody112 bytes = 0x70
 
 
 
version
byte[1]

entity version

 
 
 
entity_body_reserved_1
byte[2]
reserved 0

reserved padding between version and network type

 
 
 
network
NetworkType

entity network

 
 
 
timestamp
Timestamp

entity timestamp

 
 
 
signer_public_key_size
byte[4]
reserved 32

entity signer public key size

 
 
 
signer_public_key
PublicKey

entity signer public key

 
 
 
signature_size
byte[4]
reserved 64

entity signature size

 
 
 
signature
Signature

entity signature

 
 
 
fee
Amount

transaction fee

 
 
 
deadline
Timestamp

transaction deadline

 
 
 
multisig_​transaction_​hash_​outer_​size
byte[4]
reserved 36

multisig transaction hash outer size

 
 
 
multisig_transaction_hash_size
byte[4]
reserved 32

multisig transaction hash size

 
 
 
multisig_transaction_hash
Hash256

multisig transaction hash

 
 
 
multisig_account_address_size
byte[4]
reserved 40

multisig account address size

 
 
 
multisig_account_address
Address

multisig account address

MultisigTransaction

Size: 269+ bytes = 0x10d+ (variable)
schema

binary layout for a multisig transaction

 
 
 
TRANSACTION_VERSION
byte[1]
const 1
 
 
 
TRANSACTION_TYPE
TransactionType
const MULTISIG_TRANSACTION (0x1004)
Transaction128 bytes = 0x80
 
 
 
type
TransactionType

transaction type

EntityBody112 bytes = 0x70
 
 
 
version
byte[1]

entity version

 
 
 
entity_body_reserved_1
byte[2]
reserved 0

reserved padding between version and network type

 
 
 
network
NetworkType

entity network

 
 
 
timestamp
Timestamp

entity timestamp

 
 
 
signer_public_key_size
byte[4]
reserved 32

entity signer public key size

 
 
 
signer_public_key
PublicKey

entity signer public key

 
 
 
signature_size
byte[4]
reserved 64

entity signature size

 
 
 
signature
Signature

entity signature

 
 
 
fee
Amount

transaction fee

 
 
 
deadline
Timestamp

transaction deadline

 
 
 
inner_transaction_size
byte[4]

inner transaction size

 
 
 
inner_transaction
Transaction

inner transaction

 
 
 
cosignatures_count
byte[4]

number of attached cosignatures

 
 
 
cosignatures
Cosignature​[cosignatures_count]

cosignatures

NamespaceRegistrationTransaction

Size: 193+ bytes = 0xc1+ (variable)
schema

binary layout for a namespace registration transaction

 
 
 
TRANSACTION_VERSION
byte[1]
const 1
 
 
 
TRANSACTION_TYPE
TransactionType
const NAMESPACE_REGISTRATION (0x2001)
Transaction128 bytes = 0x80
 
 
 
type
TransactionType

transaction type

EntityBody112 bytes = 0x70
 
 
 
version
byte[1]

entity version

 
 
 
entity_body_reserved_1
byte[2]
reserved 0

reserved padding between version and network type

 
 
 
network
NetworkType

entity network

 
 
 
timestamp
Timestamp

entity timestamp

 
 
 
signer_public_key_size
byte[4]
reserved 32

entity signer public key size

 
 
 
signer_public_key
PublicKey

entity signer public key

 
 
 
signature_size
byte[4]
reserved 64

entity signature size

 
 
 
signature
Signature

entity signature

 
 
 
fee
Amount

transaction fee

 
 
 
deadline
Timestamp

transaction deadline

 
 
 
rental_fee_sink_size
byte[4]
reserved 40

mosaic rental fee sink public key size

 
 
 
rental_fee_sink
Address

mosaic rental fee sink public key

 
 
 
rental_fee
Amount

mosaic rental fee

 
 
 
name_size
byte[4]

new namespace name size

 
 
 
name
byte[name_size]

new namespace name

 
 
 
parent_name_size
byte[4]

size of the parent namespace name

 
 
 
parent_name
byte[parent_name_size]

parent namespace name

Message

Size: 8+ bytes = 0x8+ (variable)
schema

binary layout for a message

 
 
 
message_type
MessageType

message type

 
 
 
message_size
byte[4]

message size

 
 
 
message
byte[message_size]

message payload

TransferTransaction2

Size: 202+ bytes = 0xca+ (variable)
schema

binary layout for a transfer transaction (V2)

 
 
 
TRANSACTION_VERSION
byte[1]
const 2
TransferTransaction197+ bytes = 0xc5+ (variable)
 
 
 
TRANSACTION_VERSION
byte[1]
const 1
 
 
 
TRANSACTION_TYPE
TransactionType
const TRANSFER (0x101)
Transaction128 bytes = 0x80
 
 
 
type
TransactionType

transaction type

EntityBody112 bytes = 0x70
 
 
 
version
byte[1]

entity version

 
 
 
entity_body_reserved_1
byte[2]
reserved 0

reserved padding between version and network type

 
 
 
network
NetworkType

entity network

 
 
 
timestamp
Timestamp

entity timestamp

 
 
 
signer_public_key_size
byte[4]
reserved 32

entity signer public key size

 
 
 
signer_public_key
PublicKey

entity signer public key

 
 
 
signature_size
byte[4]
reserved 64

entity signature size

 
 
 
signature
Signature

entity signature

 
 
 
fee
Amount

transaction fee

 
 
 
deadline
Timestamp

transaction deadline

 
 
 
recipient_address_size
byte[4]
reserved 40

recipient address size

 
 
 
recipient_address
Address

recipient address

 
 
 
amount
Amount

XEM amount

 
 
 
message_envelope_size
byte[4]

message envelope size

 
 
 
message
Message

optional message

 
 
 
mosaics_count
byte[4]

number of attached mosaics

 
 
 
mosaics
Mosaic​[mosaics_count]

attached mosaics notice that mosaic amount is multipled by transfer amount to get effective amount

Inner Structures

These are structures only meant to be included inside other structures. Their description is already present in the containing structures above and is only repeated here for completeness.

EntityBody

Size: 112 bytes = 0x70
schema

binary layout for a blockchain entity (block or transaction)

 
 
 
version
byte[1]

entity version

 
 
 
entity_body_reserved_1
byte[2]
reserved 0

reserved padding between version and network type

 
 
 
network
NetworkType

entity network

 
 
 
timestamp
Timestamp

entity timestamp

 
 
 
signer_public_key_size
byte[4]
reserved 32

entity signer public key size

 
 
 
signer_public_key
PublicKey

entity signer public key

 
 
 
signature_size
byte[4]
reserved 64

entity signature size

 
 
 
signature
Signature

entity signature

Included in:

Transaction

Size: 128 bytes = 0x80
schema

binary layout for a transaction

 
 
 
type
TransactionType

transaction type

EntityBody112 bytes = 0x70
 
 
 
version
byte[1]

entity version

 
 
 
entity_body_reserved_1
byte[2]
reserved 0

reserved padding between version and network type

 
 
 
network
NetworkType

entity network

 
 
 
timestamp
Timestamp

entity timestamp

 
 
 
signer_public_key_size
byte[4]
reserved 32

entity signer public key size

 
 
 
signer_public_key
PublicKey

entity signer public key

 
 
 
signature_size
byte[4]
reserved 64

entity signature size

 
 
 
signature
Signature

entity signature

 
 
 
fee
Amount

transaction fee

 
 
 
deadline
Timestamp

transaction deadline

Included in:

MultisigAccountModificationTransaction

Size: 137+ bytes = 0x89+ (variable)
schema

binary layout for a multisig account modification transaction (V1)

 
 
 
TRANSACTION_VERSION
byte[1]
const 1
 
 
 
TRANSACTION_TYPE
TransactionType
const MULTISIG_ACCOUNT_MODIFICATION (0x1001)
Transaction128 bytes = 0x80
 
 
 
type
TransactionType

transaction type

EntityBody112 bytes = 0x70
 
 
 
version
byte[1]

entity version

 
 
 
entity_body_reserved_1
byte[2]
reserved 0

reserved padding between version and network type

 
 
 
network
NetworkType

entity network

 
 
 
timestamp
Timestamp

entity timestamp

 
 
 
signer_public_key_size
byte[4]
reserved 32

entity signer public key size

 
 
 
signer_public_key
PublicKey

entity signer public key

 
 
 
signature_size
byte[4]
reserved 64

entity signature size

 
 
 
signature
Signature

entity signature

 
 
 
fee
Amount

transaction fee

 
 
 
deadline
Timestamp

transaction deadline

 
 
 
modifications_count
byte[4]

number of modifications

 
 
 
modifications
MultisigAccountModification​[modifications_count]

multisig account modifications

Included in:

TransferTransaction

Size: 197+ bytes = 0xc5+ (variable)
schema

binary layout for a transfer transaction (V1)

 
 
 
TRANSACTION_VERSION
byte[1]
const 1
 
 
 
TRANSACTION_TYPE
TransactionType
const TRANSFER (0x101)
Transaction128 bytes = 0x80
 
 
 
type
TransactionType

transaction type

EntityBody112 bytes = 0x70
 
 
 
version
byte[1]

entity version

 
 
 
entity_body_reserved_1
byte[2]
reserved 0

reserved padding between version and network type

 
 
 
network
NetworkType

entity network

 
 
 
timestamp
Timestamp

entity timestamp

 
 
 
signer_public_key_size
byte[4]
reserved 32

entity signer public key size

 
 
 
signer_public_key
PublicKey

entity signer public key

 
 
 
signature_size
byte[4]
reserved 64

entity signature size

 
 
 
signature
Signature

entity signature

 
 
 
fee
Amount

transaction fee

 
 
 
deadline
Timestamp

transaction deadline

 
 
 
recipient_address_size
byte[4]
reserved 40

recipient address size

 
 
 
recipient_address
Address

recipient address

 
 
 
amount
Amount

XEM amount

 
 
 
message_envelope_size
byte[4]

message envelope size

 
 
 
message
Message

optional message

Included in: