Skip to main content

SNARK Workers Getting Started

note

Before following this guide, complete the Validator Node setup — from Requirements through Connect to Mainnet or Devnet. You should have a synced node and a key pair before proceeding.

There are two modes for running SNARK work:

  • Embedded worker — the daemon runs a single SNARK worker internally. Simpler to set up, no external processes needed.
  • Coordinator with external workers — the daemon runs a SNARK coordinator that distributes work to one or more external SNARK worker processes. Use this to scale across multiple machines or cores.

In both modes, the daemon also participates in the network as a normal validator.

Embedded SNARK worker

Run the daemon with --run-snark-worker to produce SNARK proofs directly within the daemon process:

mina daemon \
--peer-list-url https://bootnodes.minaprotocol.com/networks/mainnet.txt \
--run-snark-worker $SNARK_WORKER_PUBLICKEY \
--snark-worker-fee 0.001 \
--work-selection seq
FlagDescription
--run-snark-workerPublic key to receive SNARK work fees
--snark-worker-feeFee (in MINA) to charge per SNARK proof
--work-selectionWork selection method: seq, rand, or roffset
--snark-worker-parallelismNumber of threads for SNARK work (does not affect block production)

Coordinator with external workers

Start the coordinator

Run the daemon with --run-snark-coordinator. The coordinator distributes work to external SNARK worker processes, propagates the generated proofs to the network, and sets the public key that receives SNARK work fees from those workers:

mina daemon \
--peer-list-url https://bootnodes.minaprotocol.com/networks/mainnet.txt \
--run-snark-coordinator $SNARK_WORKER_PUBLICKEY \
--snark-worker-fee 0.001 \
--work-selection seq
FlagDescription
--run-snark-coordinatorPublic key to receive SNARK work fees from external workers
--snark-worker-feeFee (in MINA) to charge per SNARK proof
--work-selectionWork selection method: seq, rand, or roffset

Connect workers to the coordinator

caution

The protocol between the coordinator and workers is not secure. Only run workers on the same intranet as the coordinator — do not expose the coordinator port to the public internet.

On each worker machine, run:

mina internal snark-worker \
--proof-level full \
--shutdown-on-disconnect false \
--daemon-address <COORDINATOR_IP:PORT>

The default coordinator port is 8301. Use --snark-worker-parallelism on the worker to set the number of threads used for SNARK work.

For a Docker Compose example that sets up a coordinator and worker together, see Docker Compose Example.