In the Pactus, a block is a set of data that contains a header, the certificate of the previous block and list of the transactions. Once a block comes with a valid certificate, it is committed and added to the blockchain, and the certificate will be included in the next block. A committed block is immutable, and any modifications to the block will invalidate the certificate.
The block header is a data structure in the Pactus blockchain that contains important information about the block.
The block header is 138 bytes long and consists the following fields:
Size | Field |
---|---|
1 byte | Version |
4 bytes | Timestamp |
32 bytes | Previous Block Hash |
32 bytes | State Hash |
48 bytes | Sortition Seed |
21 bytes | Proposer Address |
A block certificate is a proof of commitment for the block in the Pactus blockchain. It is the result of the Pactus consensus algorithm and ensures that the block has been agreed upon by committee members.
The block certificate consists the following fields:
Size | Field |
---|---|
2 bytes | Round |
Variant | Committers |
Variant | Absentees |
48 bytes | Signature |
Each block in the Pactus blockchain contains a list of transactions. The maximum number of transactions in a block is determined by the consensus parameters, and currently set to 1000. The first transaction in each block is the reward transaction. Once a block is committed and added to the blockchain, all the transactions inside the block will be executed. This means that the state of the blockchain will be updated based on the transactions in the committed block.
The block hash is a unique identifier for each block, which is computed by hashing the following data:
The previous certificate hash and the Merkle root hash of transactions are included in the block hash to ensure that they cannot be modified. The block hash is used to link the blocks together in the blockchain.
There is no completely empty block in Pactus. Each block contains at least one transaction, which is the reward transaction.
In the Pactus blockchain, a validator called a Proposer is responsible for collecting all transactions and creating a block every 10 seconds. The Proposer broadcasts the proposed block to other validators inside the committee. Other validators verify the proposed block, and if it is valid, they cast their votes in favor of the proposed block by signing the combination of the block hash and the consensus round. More details about the consensus mechanism can be found in the consensus protocol document.
To issue a valid certificate, signatures from validators who hold more than ⅔ of the stake in the committee are required. Once enough votes are collected, the signatures are aggregated and combined into a single signature, and the certificate is issued.
To verify a certificate for a block, the block hash is computed, and the aggregated public key can be formed using the Committers and Absentees list. Then, the signature can be verified using the aggregated public key and the aggregated signature inside the certificate.