← Protocols
Mina Protocol
ZK / Privacy·Mina · Multi-chain

Mina Protocol

01Description

Mina is a succinct L1 whose entire chain state is verified by a constant-size (~22KB) recursive zk-SNARK. zkApps are TypeScript smart contracts written with the o1js framework and proven client-side before submission.

02Best for
  • 01TypeScript-native ZK smart contracts
  • 02succinct light-client verification
  • 03off-chain computation with on-chain settlement
  • 04privacy-preserving applications
  • 05recursive ZK proofs
03Install
  • npm install -g zkapp-cli
  • zk config
  • zk project my-zkapp
  • pnpm add o1js
04Environment variables
VariableScopeDescription
MINA_NETWORKClientNetwork endpoint, e.g. `devnet` or `mainnet` Mina node URL.
DEPLOYER_PRIVATE_KEYServerMina private key (base58 EKE…) used to deploy and fund the zkApp account.
05Prompt snippet
Use Mina + o1js for client-side proven smart contracts. Scaffold with `zk project my-zkapp`, then write a `SmartContract` subclass in TypeScript that uses `Field`, `Bool`, `PublicKey`, and `@method` decorators. Compile circuits with `await MyContract.compile()` (this can take 30s+) and create a transaction with `Mina.transaction(sender, async () => { await contract.myMethod(input); })`, then `tx.prove()` and `tx.sign([key]).send()`. The proof is generated entirely in the user's browser via WASM and the chain only verifies the resulting recursive SNARK. Deploy with `zk deploy <network>` after configuring `config.json`.
06Gotchas
  • `Contract.compile()` is slow (often 10–60s) and large circuits can OOM mobile browsers — cache the verification key and pre-compile in a Web Worker.
  • o1js values (`Field`, `UInt64`, …) are not regular JS numbers; mixing them with native arithmetic silently produces non-provable code.
  • Each zkApp account holds at most 8 on-chain `Field` state slots — design for off-chain state with Merkle trees or actions/reducers when you need more.
  • Account updates have strict authorization rules (proof / signature / none); misconfiguring `permissions` can permanently brick a zkApp.
  • o1js APIs have evolved rapidly (snarkyjs → o1js, sync → async methods); pin a major version and read the migration guide before upgrading.
07Alternatives