ZK-proof mechanism and ZK-snarks
Last updated
Was this helpful?
Last updated
Was this helpful?
Mina is a succinct and lightweight PoS blockchain that weighs only 22 kBytes and allows to run a node ever from an I-phone. This became possible due to the fact that, unlike in PoW protocols, where data storage, computation and block production are performed by all nodes, which requires a growing amount of CPU, in Mina, these roles are separated between archive nodes, ZK-snarkers (snark-workers) and validators (block producers) (see Figure 1). For more information on accounts in Mina, please, go to .
Validators are full nodes that broadcast transactions and produce blocks. ZK-snarkers, on the other hand, are not full nodes, but they aren’t light clients either. ZK-snarkers are seen as a special type of nodes - non-consensus nodes, which are designed to have access to full historical information in the Mina blockchain and process these data for validators. To operate ZK-snarkers need 5 types of data in store:
Verification key - this is used for verifying the protocol state and a ZK proof.
Protocol state - a clear an unambiguous representation of the state of the network.
ZK-snark proof - an object we can verify if we have the verification key and the protocol state.
Account information.
Merkle path - a path of the account in the Merkle tree in Mina, which convinces a node that this account is part of the ledger (see Figure 2).
Mina Protocol uses the Zero-Knowledge proof mechanism to prove the validity of transactions. This doesn't require nodes to maintain the full history of the blockchain like other cryptocurrency protocols. Unlike Bitcoin, where all nodes have to engage a lot of CPU to produce new blocks and approve transactions, in Mina this work is done by special nodes: ZK-snarkers or snark workers. In Mina protocol each block producer, when it proposes a new block to the network, must also include a zk-SNARK along with that block. The full name of SNARK stands for “succinct non-interactive argument of knowledge” - it is proof that a transaction is valid and its previous states have been checked and verified. Using ZK-proofs allows nodes to discard all historical data about transactions that have been finalized, and retain just the snark.
In Mina, those are ZK-snarkers that do snark works. What snarkers actually do is they tell validators that the original state of the transaction is valid when new blocks are produced. Literally, a snarker approves all previous states of a transaction and provides proof to a validator that the transaction is valid by showing a “snapshot“ of the first and the last states of the transaction (see Figure 3). An act of doing so is called a snark or a snark work. To do snark works a ZK-snark, unlike validators, needs to have a substantial CPU. In Mina Protocol 2 snark-works are enveloped in 1 snark job. ZK-snarks can be merged, and they are identical, regardless of the order merged (see Figure 1). This parallelism means that anybody can do snark works, and they will be the same.
A snark coordinator coordinates snark jobs among many snark workers. The coordinator is responsible for sending new work to the snark workers, ensuring they do not duplicate the same work. The snark workers communicate with the snark coordinator via RPC calls. Figure 4 shows the mechanism of ZK-proof in the Mina Protocol.
See .
What allows decoupling the production of transaction SNARKs from block producers to snark workers is a specific data structure - the scan state. For more information on the scan state please go to
See .
In Mina block producers are encouraged to participate in including transactions in a block through transaction fees and gaining block production reward, they are responsible for offsetting the transactions by purchasing an equal number of completed snark work, thereby creating demand for snark work. Snark workers, for their part, charge a fee from a validator for providing snark works. Some fees can equal zero, but normally this is a particular amount of nanoMina funds. To add a transaction in a block a validator chooses a transaction from the mempool with the highest amount and aims to select a snark work from the snark pool with the lowest fee. Validators use their block rewards to purchase snark work from snark workers. Validators and snark workers together, therefore, make up a market called snarketplace, where snark fees are balanced by the economic mechanism of demand and supply. For more information on Mina Protocol please go to .
See .