DOME Docs

Circuit Hosting

Host Groth16 proving artifacts (WASM and zkey) for browser and SDK clients.

Clients (@dome/sdk-evm, web, mobile) load Groth16 proving keys over HTTPS:

FilePurposeSize (approx.)
transaction2.wasmWitness calculator~3 MB
transaction2.zkeyProving key~16 MB

The SDK resolves paths as {keyBasePath}{inputCount}.wasm / .zkey. With keyBasePath /circuits/transaction, standard 2-input transactions use transaction2.*.

Build or sync locally

node scripts/web/sync-circuit-artifacts.ts

Sources (first match wins):

  1. dome-sdk-evm/circuits/transaction2.{wasm,zkey}
  2. dome-core-evm/build/circuits/transaction2_js/transaction2.wasm + transaction2_final.zkey

Hosting options

ProviderNotes
Cloudflare R2Cheap egress; public bucket or signed URLs
AWS S3 + CloudFrontStandard static CDN
GitHub ReleasesSimple for testnet; not ideal for production bandwidth
Same origin as backendServe /circuits/* from nginx/Caddy in front of @dome/backend
Cloudflare TunnelStatic server on :8790 via up-sepolia.sh

nginx static snippet

location /circuits/ {
  alias /var/lib/dome/circuits/;
  add_header Access-Control-Allow-Origin *;
  add_header Cache-Control "public, max-age=86400";
}
install -D dome-sdk-evm/circuits/transaction2.wasm /var/lib/dome/circuits/transaction2.wasm
install -D dome-sdk-evm/circuits/transaction2.zkey /var/lib/dome/circuits/transaction2.zkey

R2 (wrangler)

wrangler r2 object put dome-circuits/transaction2.wasm --file dome-sdk-evm/circuits/transaction2.wasm
wrangler r2 object put dome-circuits/transaction2.zkey --file dome-sdk-evm/circuits/transaction2.zkey

Expose via a public custom domain, e.g. https://circuits.example.com/transaction2.wasm.

Upload script: bash scripts/cloudflare/upload-circuits-r2.sh

Client keyBasePath

Set one base URL/path without trailing slash:

# Browser / Node (testnet)
DOME_CIRCUIT_KEY_BASE_PATH=https://circuits.getdome.app/transaction

# Same-origin in dome-web
DOME_CIRCUIT_KEY_BASE_PATH=/circuits/transaction

CORS

Browsers fetch .wasm and .zkey cross-origin during proving. Allow:

  • GET from client origins
  • Access-Control-Allow-Origin: * (or your app origin)

The bundled static server (scripts/circuits/serve-static.cjs) sets CORS headers for local/tunnel hosting.

Publish SHA-256 checksums:

sha256sum dome-sdk-evm/circuits/transaction2.wasm dome-sdk-evm/circuits/transaction2.zkey

Hosted testnet checksums: https://circuits.getdome.app/SHA256SUMS

Future clients can verify artifacts before proving.

Testnet checklist

  • transaction2.wasm over HTTPS — https://circuits.getdome.app/transaction2.wasm
  • transaction2.zkey over HTTPS — https://circuits.getdome.app/transaction2.zkey
  • CORS headers (via scripts/circuits/serve-static.cjs)
  • keyBasePath in base-sepolia-deploy.json / SDK env template
  • CDN cache invalidation plan for circuit upgrades

Hosted on getdome.app

bash scripts/cloudflare/setup-circuits-route.sh
bash scripts/cloudflare/up-sepolia.sh

Mobile / SDK:

DOME_CIRCUIT_KEY_BASE_PATH=https://circuits.getdome.app/transaction
DOME_EVM_INDEXER_URL=https://api.getdome.app

On this page