Skip to main content
Work in progress

This page is actively being written and will be updated over time as we document the codebase. For comprehensive API details, refer to the Rust API documentation.

Node architecture

This page describes what happens when the node starts and where to find key functionality in the codebase.

Node startup

When you run mina node, the Node::run method initializes logging, configuration, P2P identity, SNARK verifiers (see Verifier), optional services, and starts the event loop.

Runtime services

Services run in separate threads and communicate with the state machine via channels. The main service container is NodeService.

ServicePurposeModule
ArchiveStores blockchain historynode/common/src/service/archive/
Block producerVRF evaluation and block provingnode/common/src/service/block_producer/
Ledger managerManages ledger database operationsnode/src/ledger/
P2PNetwork connectivity (libp2p + WebRTC)p2p/
RPCExternal API (GraphQL, JSON-RPC)node/common/src/service/rpc/
SNARK workerGenerates transaction proofsnode/common/src/service/snark_worker.rs
VerifierVerifies SNARK proofsnode/common/src/service/snarks.rs

Verifier

The verifier runs in a dedicated thread and validates SNARK proofs using Kimchi. At startup, it generates verification keys from circuit definitions; these keys are required by the proving system to verify proofs: BlockVerifier for consensus-layer block proofs and TransactionVerifier for transaction and zkApp proofs.

The verifier handles three types of proofs:

  • Block proofs - validates that a block was produced correctly according to consensus rules (verify_block())
  • Transaction proofs - validates payment and delegation transactions (verify_transaction())
  • zkApp proofs - validates smart contract executions (verify_zkapp())