npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dorafactory/maci-cli

v0.1.1

Published

Public CLI tool for MACI circuit registry and proof verification

Readme

@dorafactory/maci-cli

A public CLI tool for verifying aMACI (Anonymous Minimal Anti-Collusion Infrastructure) rounds and circuit registries on Dora Vota.

Anyone can run this tool to independently verify that a MACI round's proofs were accepted on-chain and that commitments are consistent — without requiring any private key or special permissions.

Installation

npm install -g @dorafactory/maci-cli
# or
pnpm add -g @dorafactory/maci-cli

Requirements: Node.js >= 18.0.0

Quick Start

# Check if a round's proofs all passed on-chain (fast, no local computation)
maci round dora1abc...xyz

# Fully re-verify proofs locally with snarkjs (thorough, slower)
maci round dora1abc...xyz --recheck

# Inspect what circuits the CLI knows about
maci registry list

# Compare on-chain vkeys against the bundled registry
maci registry check dora1abc...xyz

Commands

maci registry list

Lists all aMACI circuits bundled in this CLI, including their power string, status, and a brief description.

maci registry list

Example output:

┌─────────────┬────────────┬──────────────────────────────────────────────────────────────────┐
│ Power       │ Status     │ Description                                                      │
├─────────────┼────────────┼──────────────────────────────────────────────────────────────────┤
│ 9-4-3-125   │ Production │ The only circuit accepted by the live aMACI contract              │
│ 2-1-1-5     │ Test-only  │ Accepted only when compiled with feature="test-vkeys"             │
└─────────────┴────────────┴──────────────────────────────────────────────────────────────────┘

maci registry show <power>

Shows detailed parameters, verification key fingerprints, and zkey download information for a specific circuit.

maci registry show 9-4-3-125
maci registry show 2-1-1-5

The output includes:

  • Circuit parameters (state tree depth, message batch size, vote option tree depth, etc.)
  • SHA-256 fingerprints of each vkey (processMessages, tally, deactivate, addNewKey)
  • Links to download the corresponding .zkey files

maci registry check <contract>

Fetches the verification keys stored on-chain for a round contract and compares them against the bundled circuit registry. Reports MATCH or MISMATCH for each vkey type.

# Mainnet (default)
maci registry check dora1abc...xyz

# Testnet
maci registry check dora1abc...xyz --network testnet

Example output:

Checking vkeys for dora1abc...xyz on mainnet...

  processMessages  ✔ MATCH    (9-4-3-125)
  tally            ✔ MATCH    (9-4-3-125)
  deactivate       ✔ MATCH    (9-4-3-125)
  addNewKey        ✔ MATCH    (9-4-3-125)

All vkeys match the bundled registry.

If any vkey does not match, the command exits with code 1.


maci round <contract>

Verifies all proofs and commitments for an aMACI round. Supports two verification levels.

Layer 1 (default) — Commitment Audit

Fast commitment audit via the indexer and RPC. No local ZK computation required.

Checks performed:

  • All submitted proofs were accepted by the smart contract (verifyResult = true)
  • On-chain MSG_CHAIN_LENGTH matches the count of indexed messages
  • Batch coverage: total processed messages ≥ chain length
  • Last message proof's state commitment matches on-chain QueryCurrentStateCommitment
  • Last tally proof's commitment matches on-chain current_tally_commitment
# Mainnet
maci round dora1abc...xyz

# Testnet
maci round dora1abc...xyz --network testnet

# Override specific endpoints
maci round dora1abc...xyz \
  --rpc https://vota-rpc.dorafactory.org \
  --indexer https://maci-graphql.dorafactory.org

Layer 2 (--recheck) — Local ZK Re-verification

Thorough re-verification using snarkjs. Skips trusting the contract's on-chain Groth16 verifier and re-runs it locally.

Additional checks performed:

  • Downloads all indexed messages and rebuilds the MSG_HASHES chain locally
  • Fetches on-chain vkeys and reconstructs public signals (input_hash)
  • Runs snarkjs.groth16.verify() for every processMessage and tally proof
maci round dora1abc...xyz --recheck
maci round dora1abc...xyz --network testnet --recheck

Note: Layer 2 verification downloads proof data and runs local ZK verification, which may take several minutes depending on the number of messages in the round.


Options Reference

| Option | Commands | Default | Description | |--------|----------|---------|-------------| | --network | registry check, round | mainnet | Network to connect to (mainnet or testnet) | | --rpc | round | (see Network Defaults) | Override the CosmWasm RPC endpoint | | --indexer | round | (see Network Defaults) | Override the MACI GraphQL indexer endpoint | | --recheck | round | false | Enable Layer 2 local ZK re-verification |

Verification Levels

| Level | Flag | Speed | What it checks | |-------|------|-------|----------------| | Layer 1 | (default) | Fast | Commitment chain audit via indexer + RPC | | Layer 2 | --recheck | Slower | Full local ZK proof re-verification using snarkjs |

Network Defaults

| Network | RPC | Indexer | |---------|-----|---------| | mainnet (default) | https://vota-rpc.dorafactory.org | https://maci-graphql.dorafactory.org | | testnet | https://vota-testnet-rpc.dorafactory.org | https://maci-testnet-graphql.dorafactory.org |

Supported Circuits

| Power | Status | Description | |-------|--------|-------------| | 9-4-3-125 | Production | The only circuit accepted by the live aMACI contract | | 2-1-1-5 | Test-only | Accepted only when the contract is compiled with feature="test-vkeys" |

Trust Model

  • Circuit registry: The bundled vkeys are version-controlled in this package's git history and sourced directly from maci/contracts/amaci/src/circuit_params.rs. If you trust the CLI's npm provenance, you trust these vkeys.
  • Round verification: Data is read directly from the CosmWasm RPC (chain) and the indexer. The chain is the ultimate source of truth — the smart contract itself verifies proofs on submission.
  • Layer 2: The --recheck flag skips relying on the contract's on-chain Groth16 verification and re-runs it locally using the same snarkjs library that the operator used to generate the proofs.

Exit Codes

| Code | Meaning | |------|---------| | 0 | All checks passed | | 1 | One or more checks failed (mismatch, rejected proof, etc.) | | 2 | Invalid arguments or usage error |

Development

# From maci/packages/cli
pnpm build          # compile with tsup
pnpm dev            # watch mode
pnpm lint           # TypeScript type check
pnpm clean          # remove dist/