A custom Avalanche VM for privacy-preserving prediction markets, built on HyperSDK.
Not a fork of Subnet-EVM — a purpose-built execution environment with native ZK proof verification, commit-reveal batch auctions, and a shielded ledger.
ChainId 22207 · Built in Go · Avalanche L1
EVM-based chains leak information. Order flow is visible in the mempool, trade sizes are public, and market manipulation is trivial. VeilVM solves this at the execution layer:
- Encrypted order commitments —
VEILENC1envelopes; window key revealed onRevealBatch - Proof-gated settlement —
ClearBatchrequires groth16shielded-ledger-v1(digest-bound public slots, not in-circuit matching) - Threshold tx gossip — VTG2 Shamir + X25519, fail-closed
t>=2. Local 2-of-3. Shared AES is not a private mempool. - Native fee routing — 70/20/10 MSRB / COL / ops, plus native VAI and AMM (actions 7–14)
| ID | Action | Description |
|---|---|---|
| 0 | Transfer |
Transfer VEIL tokens |
| 1 | CreateMarket |
Create a prediction market |
| 2 | CommitOrder |
Submit encrypted order commitment |
| 3 | RevealBatch |
Submit decryption share for batch reveal |
| 4 | ClearBatch |
Clear batch auction (proof-gated) |
| 5 | ResolveMarket |
Resolve with oracle attestation |
| 6 | Dispute |
Dispute a market resolution |
| 7 | RouteFees |
Split fees across MSRB/COL/Ops |
| 8 | ReleaseCOLTranche |
Release treasury COL by epoch cap |
| 9–10 | MintVAI / BurnVAI |
VAI stablecoin operations |
| 11–14 | CreatePool / AddLiquidity / RemoveLiquidity / SwapExactIn |
Native UniV2-style DEX |
| 15–16 | UpdateReserveState / SetRiskParams |
Governance updates |
| 17 | SubmitBatchProof |
Submit ZK proof + Vellum proof blob |
| 18 | SetProofConfig |
Governance proof requirements |
v1 is these 19 actions. IDs 19–41 in older ANIMA/handshake docs are spec-only and are not in this binary. Public copy must say 19, not 22/41/42. See veil-docs/architecture/VEIL_STACK.md.
Prover VeilVM Consensus
│ │
├─ Compute clearPrice, volume, │
│ fillsHash from revealed orders │
│ │
├─ Hash: sha256("VEIL_CLEAR_V1" ║ │
│ marketID ║ windowID ║ clearPrice │
│ ║ totalVolume ║ fillsHash) │
│ │
├─ Generate Groth16 proof ──────────►│
│ (SubmitBatchProof) │── Verify proof (gnark BN254)
│ │── Store in Vellum proof storage
│ │── Mint Glyph inscription
│ │── Update Bloodsworn profile
│ │
├─ ClearBatch ──────────────────────►│
│ │── Verify proof record exists
│ │── Match public_inputs_hash
│ │── Verify Vellum blob integrity
│ │── Execute settlement (fail-closed)
Proof Envelopes: VZK1 (proof + witness) and VZK2 (+ circuit ID). Circuit identity enforced at consensus when VEIL_ZK_REQUIRED_CIRCUIT_ID is set.
Companion EVM is rails, not a second protocol. v1 rails: WVEIL, intent gateways, bridge minter, test faucet. Native VAI/AMM/COL live only as VeilVM actions. Local Teleporter is a mock. Olympus / Maker / meme contracts in veil-contracts are parked.
See veil-contracts for the full Solidity suite.
# Build
go build ./...
# Run the VM
go run ./cmd/veilvm
# Generate ZK fixture keys
go run ./cmd/veilvm-zktool -out ./zk-fixture
go run ./cmd/veilvm-zktool -circuit shielded-ledger-v1 -out ./zk-fixture-shielded
# Run ZK benchmarks with real Groth16 proofs
PROOF_MODE=groth16 GROTH16_PK_PATH=./zk-fixture/groth16_clearhash_pk.bin \
go run ./cmd/veilvm-zkbench
# Docker (local profile with strict verifier)
docker compose -f docker-compose.local.yml up -d --build
# Smoke test
node scripts/smoke-local.mjs --chain-id <CHAIN_ID>| Method | Description |
|---|---|
clearinputshash |
Compute canonical public-input hash |
batchproof |
Get batch proof metadata |
vellumproof |
Get stored proof blob |
bloodsworn |
Read validator trust profile |
glyph |
Read proof-derived inscription metadata |
| Component | Repo |
|---|---|
| Smart Contracts | veil-contracts |
| Frontend | veil-frontend |
| Identity (ZK) | zeroid |
| Agent Runtime | anima-runtime |
| Documentation | veil-docs |
- Protocol: veil.markets
- Lab: thesecretlab.app
- Research: LatentSync Paper
Markets that can't be front-run. Proofs that can't be faked.