SNARK Workers in Mina Protocol

Alperen Tunçkıran
6 min readOct 28, 2024

--

Mina Protocol is a unique blockchain project designed to stay lightweight and efficient. Mina focuses on quick verification, ensuring that anyone can easily participate by keeping the blockchain succinct.

In this article, we will explore how SNARK Workers play an essential role in maintaining Mina’s lightweight nature without the need for storing vast amounts of historical data.

1. SNARK Workers?

Imagine you have a large book filled with pages of important information, but you need to prove to someone that you have read and understood all of it, without showing them the book.

Instead, you provide a summary that can be verified as correct by anyone, without the need to read the whole book.

This is essentially what SNARK Workers do for Mina’s blockchain.

Mina Protocol uses zk-SNARKs (Zero-Knowledge Succinct Non-Interactive Arguments of Knowledge) to keep its blockchain size to a constant and manageable 22kb. SNARK Workers are specialized participants who create cryptographic summaries, or proofs, that validate transactions. This ensures that Mina’s blockchain remains extremely lightweight and that anyone, anywhere can run a node without needing vast computing resources.

2. zk-SNARKs in Mina

A zk-SNARK proof allows one party to prove that a statement is true without revealing any details beyond the fact that it is true. Imagine a person claiming they have a golden key that fits a specific lock, but without ever showing the key. Instead, they present proof that’s cryptographically impossible to fake, showing they possess the key. This form of verification of the data is crucial to Mina Protocol.

The primary purpose of zk-SNARKs in Mina is not to make transaction details secret, but to ensure quick verification while keeping the blockchain size small.

Instead of storing every transaction, Mina compresses its entire blockchain to a constant size of about 22kb.

This is equivalent to storing all the records of a big bank on a small USB drive.

SNARK Workers are the reason this is possible — they generate zk-SNARK proofs to confirm the validity of transactions without requiring the blockchain to carry all historical data.

3. The Role of SNARK Workers

So, what exactly do SNARK Workers do? Let’s break down their role:

3.1 Generating Proofs for Transactions

When a new transaction is submitted to the network, it needs to be validated. Instead of requiring every node to store and validate every detail of the transaction, SNARK Workers step in to generate a zk-SNARK proof for it.

This cryptographic proof confirms the transaction’s validity without storing the raw data on the blockchain.

3.2 Enabling Block Production

Block Producers on the Mina network require these proofs to add transactions to new blocks.

This is like a security guard needing proper documentation before allowing someone into a building.

SNARK Workers provide this documentation in the form of zk-SNARK proofs.

3.3 Maintaining Blockchain Efficiency

Generating zk-SNARK proofs requires heavy computation. SNARK Workers do the heavy lifting, ensuring that block producers can work efficiently and the entire blockchain remains lightweight and easy to access.

4. Incentives for SNARK Workers

In the real world, why would someone take up this tedious task? Well, SNARK Workers earn rewards for their work. The pricing of SNARK work in the Snarketplace follows simple laws of supply and demand, making it a dynamic market.

SNARK Workers need to price their work strategically. Here are some key factors affecting SNARK work pricing:

  • Market Pricing Strategy: If the market price for SNARK work is X, it can be effective to sell for any price below X, provided it remains profitable after considering operating expenses. SNARK Workers compete by setting attractive prices to ensure their work is purchased by block producers.
  • Bundled Sales Incentive: Block Producers are incentivized to buy multiple units of SNARK work from the same SNARK Worker. This is because payments are processed through fee transfers, which are special types of transactions that need to be added to a block. By buying in bulk from one worker, block producers minimize the number of fee transfers, reducing overhead and making the block production process more efficient.
  • Prioritizing Certain SNARK Work: Some SNARK work can be more valuable if it helps free up memory faster or optimizes the state of the network. The Snarketplace dynamics allow block producers to prioritize work that offers the most benefit to the blockchain’s efficiency.

The process of creating zk-SNARK proofs and selling them takes place in the Snarketplace — a decentralized market where SNARK Workers offer their proofs to block producers.

Imagine a busy auction house where artwork (proofs) is sold to collectors (block producers) who need them to complete their collections (blocks).

5. Real-World Analogy: SNARK Workers as Specialized Artisans

To help visualize this concept, think of SNARK Workers as specialized artisans who create security seals for every item sold in a marketplace. These security seals prove that the item is genuine without revealing how it was made. The block producers are like shipping companies, they need these security seals to validate their packages before sending them off.

The snarketplace acts as the exchange where artisans offer their seals to the shipping companies.

In this system, the shipping companies (block producers) prefer artisans who provide high-quality seals quickly and at a good price. If an artisan creates a faulty seal (an invalid proof), the shipping company can’t use it and the artisan ends up wasting time and resources.

This is why SNARK Workers are incentivized to always generate valid, high-quality proofs — it’s the only way they get paid.

6. How the Snarketplace Works

The Snarketplace is an integral part of the Mina Protocol’s efficiency. Here’s how it operates:

  • Accessing the Proof Pool: Block producers look at the available pool of zk-SNARK proofs offered by SNARK Workers in the Snarketplace.
  • Evaluating Prices and Quality: Each proof comes with a price, and block producers want the best deal. They prioritize proofs that are affordable, efficient, and can help minimize the number of fee transfers.
  • Making Purchases: Once block producers find the right proofs, they buy them using the Mina Protocol’s native token. They prefer to purchase multiple units from the same SNARK Worker to reduce the number of fee transfers, thereby optimizing block production efficiency.

7. The Process of Proof Generation

The proof generation process in Mina involves two key operations — parallel generation and sequential composition.

Imagine SNARK Workers working in a workshop, each worker responsible for crafting part of a security seal for different transactions. They work in parallel, making sure that multiple proofs are generated simultaneously, which speeds up the overall process.

Once all the individual proofs are ready, they are combined into a single, aggregated proof that represents all transactions in a batch. This aggregated proof is then included in the new block.

Thanks to recursive zk-SNARKs, the size of this aggregated proof remains small, ensuring the blockchain stays lightweight.

8. Ensuring Integrity: No Direct Penalization, but Effective Deterrents

In many Proof-of-Stake networks, participants are punished for bad behavior through slashing — losing part of their staked tokens. In Mina, SNARK Workers aren’t directly penalized for generating invalid proofs. Instead, they face natural disincentives:

  • No Payment for Invalid Proofs: Block producers must verify every proof before including it in a block. If a proof turns out to be invalid, the SNARK Worker doesn’t get paid.
  • Reputation Matters: Just like a marketplace, SNARK Workers who frequently provide invalid or faulty proofs gain a bad reputation, making block producers less likely to buy from them in the future.

These disincentives are effective. The entire system relies on economic motivation: SNARK Workers waste time and computational resources on an invalid proof, losing both potential income and market trust.

Thanks for reading. Follow me on X to catch up next articles.

My X account : @blockofchain

--

--

No responses yet