Block

The central element of every cryptocurrency is a public ledger called the blockchain, which links blocks together.

Since the blocks in the chain are ordered, the complete transaction history is held in the blockchain. Subsequent blocks in the blockchain have increasing heights that differ by one.

Blocks are stored in a database as permanent medium. NEM calls the first block in the chain the nemesis block.

NEM blocks complete every 15 seconds, making transactions confirm quickly enough for everyday use.

Note

Configuration parameters are editable. Public network configuration may differ.

Block creation

Blocks are created by accounts. The process of creating new blocks is called harvesting. The harvesting account - called the harvester - gets the fees for the transactions in the block. This gives the harvester an incentive to add as many transactions to the block as possible.

Guides

Schemas

BlockHeader

Inlines:

Property Type Description
height uint64 The height of the blockchain. Each blockchain has a unique height. Subsequent blocks differ in height by 1.
timestamp uint64 The number of seconds elapsed since the creation of the nemesis block.
difficulty uint64 The average difficulty divided by the average block creation time for the last 60 blocks. If the new difficulty is more than 5% greater or smaller than the difficulty of the last block, then the change is capped to 5%. Additionally, difficulties are kept within certain bounds. The new difficulty is clamped to the boundaries if it is greater than 1015 or smaller than 1013.
feeMultiplier uint32 The fee multiplier applied to transactions contained in block.
previousBlockHash 32 bytes (binary) The hash of the previous block.
blockTransactionHash 32 bytes (binary) The transactions included in a block are hashed forming a merkle tree. The root of the tree summarizes them.
blockReceiptsHash 32 bytes (binary) The collection of receipts are hashed into a merkle tree and linked to a block. The block header stores the root hash.
stateHash 32 bytes (binary) For each block, the state of the blockchain is stored in RocksDB, forming a patricia tree. The root of the tree summarizes the state of the blockchain for a given block.
beneficiaryPublicKey 32 bytes (binary) The public key of the optional beneficiary designated by harvester.

Version: The higher byte represents the network identifier.

Id Description
0x68 (MAIN_NET) Public main network
0x98 (TEST_NET) Public test network
0x60 (MIJIN) Private network
0x90 (MIJIN_TEST) Private test network

Type: The type of the block.

Id Description
0x8043 Nemesis block
0x8143 Block

VerifiableEntity

Property Type Description
signature 64 bytes (binary) The entity signature generated by the signer.

EntityBody

Property Type Description
signer 32 bytes (binary) The entity signer’s public key.
version uint16 The version of the structure.
type uint16 The entity type. For transaction types, see transaction types.