Block structure & serialization
Last updated
Last updated
A zkopru block is submitted to the layer1 in a serialized form. Then, the checksum of the proposal becomes the proposal ID and is used for the challenge system.
The zkopru block includes a header and a body.
Edit diagram here
The first 372 bytes of the data should be the block header. The block header contains the following data:
Property | type |
Proposer's address | address |
Parent block hash | bytes32 |
Metadata | uint256 |
Fee | uint256 |
Latest UTXO tree's root | uint256 |
Latest UTXO tree's leaf index | uint256 |
Nullifier tree's root | bytes32 |
Latest withdrawal tree's root | uint256 |
Latest withdrawal tree's leaf index | uint256 |
Transactions' root | bytes32 |
Deposits' root | bytes32 |
Migrations' root | bytes32 |
A block body consists of transactions, mass deposits, and mass migrations. Moreover, the block header should contain correct information from the body. If the header does not have the correct value, the proposer will get slashed through the challenge system.