# Block
Block is a unit of a blockchain. The block contains transactions and the header that includes fields related to the block as a whole.
The block header contains transactions root hash, which is a proof that the block includes all its transactions in the proper order. The block header also contains the hash of header of the previous block in the chain. Thus, all blocks in the chain are linked by cryptographic hashes. This guarantees the integrity of blockchain data: changing the data in any block in the history would invalidate all subsequent blocks, so the nodes in the blockchain network will reject the change.
# Block Generation
Any Waves node with a balance of 1000 WAVES or more, either owned or leased, can become a block generator. The next block generator is selected by the Leased Proof of Stake (LPoS) consensus algorithm.
New blocks appear on the Waves blockchain on average once a minute. However, the transaction hit the blockchain on average after 2 seconds thanks to the unique Waves-NG mechanism. The current block generator continues adding transactions to the block from the UTX pool — that is a pool of waiting transactions — until the next block appears (or a limitation on block size or complexity is reached).
# Limitations
The maximum block size is 1 MB.
The maximum total complexity of scripts in transactions of the block is 2,500,000. The complexity of all executed scripts is taken into account: dApp scripts, account scripts, and asset scripts. (Before activation of feature #16 “Ride V5, dApp-to-dApp invocations”, the maximum total complexity of scripts was 1,000,000.)
# JSON Representation
Node REST API provides block data in JSON.
Here is an example of JSON representation:
{
"version": 5,
"timestamp": 1684931016547,
"reference": "7sG6CU6ZS38V9VEDW5bgrCVcPeF9zFpoC6PNV7guRfp1",
"nxt-consensus": {
"base-target": 167,
"generation-signature": "qm7dYre31XLfQtnKiF5PL2MYmyYvn3ZrqcdH94TkUkfBdVgTW5BxMAiwfHmywXX9yMhZE7H67snGiXq4LQaezPt5JV291Z9MTvPbNEDjtyHBxG216Xv69PcEug2Wpao7KyT"
},
"transactionsRoot": "6dxKpvH6mSXAXuyd2we3BhDoqDWRn7jpyP8kt1JcwncT",
"id": "27b4mbGgxYe8bcqPQy1ddwcg2DoYKaeX356QpZjkrhAM",
"features": [],
"desiredReward": -1,
"generator": "3PA1KvFfq9VuJjg45p2ytGgaNjrgnLSgf4r",
"generatorPublicKey": "EFgn12TgFqn3cRthHnLAPr11g7urqchXEpjGspgLYskc",
"stateHash": "Diz914FQYj6QUUhUoWByUyLrQKE8BaKCmtoiNZBzvbUu",
"signature": "22m2xEzPgh1E29nKJJwJ6h7hoRxoLEQnE4Eh4Mcfyx4sTn3DEeBHMZ4Rda7jhGeTBUgcnNdtUmm3dzzMXb8aVsMg",
"blocksize": 15265,
"transactionCount": 25,
"height": 3657525,
"totalFee": 8900000,
"reward": 600000000,
"rewardShares": {
"3PA1KvFfq9VuJjg45p2ytGgaNjrgnLSgf4r": 600000000
},
"VRF": "9YyxDdJdzGJ3aSPSZ2BP3HXU3JAj2wR2B9znGT7g5rre",
"fee": 8900000,
"transactions": [
...
]
]
}
Field | Description |
---|---|
version | Block version: 5 for all the blocks since activation of feature #15 “Ride V4, VRF, Protobuf, Failed transactions” |
timestamp | Block timestamp: Unix time in milliseconds. When receiving a new block from a peer, each node verifies that the block timestamp does not outpace the current time by more than 100 milliseconds |
reference | ID of the previous block |
nxt-consensus.base-target | Parameter that adjusts the average block generation time to 60 seconds. See details in the Leased Proof-of-Stake article |
nxt-consensus.generation-signature | Parameter used in calculating the time delay the generator must have waited after the previous block before being eligible to release the next one. See details in the Leased Proof-of-Stake article |
transactionsRoot | Root hash of the Merkle tree of transactions of the block. The root hash is the proof that the block includes all its transactions in the proper order, so it is enough to sign only the block header. See details in the Transactions Root Hash article |
id | Block ID: BLAKE2b-256 hash of the block header |
features | List of node features supported by the block generator. See details in the Activation Protocol article |
desiredReward | Desired block reward size specified by the block generator, in WAVELETs. If the value is greater than the current reward size, then the block generator votes for the reward size increase; if the value is smaller — for the decrease. Default value of -1 is equivalent to a vote to keep the current reward size. See details in the Community-Driven Monetary Policy article |
generator | Address of the block generator: base58 encoded byte array |
generatorPublicKey | Public key of the block generator: base58 encoded byte array |
signature | Digital signature of the block header bytes with the block generator private key |
blocksize | Block size in bytes |
transactionCount | Number of transactions in the block |
height | Sequence number of the block |
totalFee | The total fees for transactions in the block, including the sponsored fees in terms of WAVELETs |
reward | Block reward in WAVELETs |
rewardShares | Block reward beneficiary addresses and the amounts in WAVELET they receive |
VRF | Parameter used in calculating the time delay the generator must have waited after the previous block before being eligible to release the next one. See details in the Leased Proof-of-Stake article |
fee | The total fees for transactions in the block, excluding the sponsored fees |
transactions | Transactions added to the block. See the Transaction article for the fields description |
stateHash | Hash of the blockchain state changes resulting from the block's transactions. See details in the Waves 1.5: Light Node article. The field is enabled by feature #22 “Light Node” |
challenged_header | Header fields of the block being challenged, in case the current block challenges another one. See details in the Waves 1.5: Light Node article. The field is enabled by feature #22 “Light Node” |
# Obtain Block Data
You can get the block header or the entire block by its ID or height:
- In Waves Explorer.
- Using Node REST API endpoints.
# Binary Format
See the Block binary format article.