Mina Block Production
Last updated
Was this helpful?
Last updated
Was this helpful?
In the Mina blockchain validators are nodes that produce blocks in the course of Consensus. In Mina Consensus is run on the Ouroboros Samasika Consensus mechanism. A validator in the blockchain which will produce a new block is chosen randomly based on its stake. The bigger stake a validator has, the more chances there are that this validator will win a new block. For producing blocks validators and their delegators win a reward. The selection mechanism is random in its nature and is built around a VRF (verifiable random function), that is any node can be selected for block production, though the chances depend on the validator stake.
When a block is added to the blockchain, the winning block producer generates a hash, which contains a part of the previous block hash. In the course of the Consensus validators sign the block, and if it receives the majority of signatures (51% and over), it enters the blockchain. In Mina, unlike other blockchains, it’s OK if there are multiple signatures with one public key, meaning that one account can sign a block twice or more.
The process of block creation is rather straightforward and it looks as follows:
Block production starts at the beginning of an epoch. Each time a transaction is carried out, it enters the mempool.
Each transaction in the mempool is validated. If it’s not valid, it gets deleted from the mempool.
A validator selects a valid transaction with the highest amount.
Then the validator selects a ZK-snarker (snark producer) with the lowest fee for the valid transaction at the snarketplace.
The selected ZK-snarker makes a ZK-snark (snark-work) for the selected transaction to prove its validity.
When the transaction-ZK-snark pairs reach a particular set value, a new block is ready. Overall, there can be 128 transactions in one block. Once it is ready, the produced block is added to the blockchain.
The queue state and the ZK-snark state are updated.
The produced block is validated. If it’s invalid, it is withdrawn, and the validator receives no rewards for the block. If a new block is valid, it is further approved in the blockchain.
The validator receives a reward for the produced block. If the validator’s account is unlocked, it gets a supercharged reward, which is 2X of a normal reward. A normal reward is 720 Mina tokens, whereas a supercharged reward is 1440 Mina tokens.
The validator distributes the reward between its delegators according to their share in the validator’s total stake. For staking delegated tokens the validator charges a fee from the delegators.
The diagram in Figure 1 shows the process of block production in Mina (Figure 1).
When added to the blockchain, a new block then becomes a canonical, or an on-chain, block. However, there can be more than one block producer per slot due to the way block producers are selected. So if two or more blocks are produced for the same slot, it will cause a short fork, and only one branch will be chosen - the winner in this instance is random based on the VRF output for each block producer. The Mina protocol uses both blocks until one chain has more verified blocks than the other. When this happens, the blocks in the longer chain will be canonical, and the blocks in the shorter chain are orphaned, or off-chain, blocks. Technically it means that Mina can have no forks. Figure 2 shows the canonical chain, which goes back to the Genesis. The green blocks are canonical blocks, the blue blocks are orphaned blocks.
See .
See .