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:
| File | Purpose | Size (approx.) |
|---|---|---|
transaction2.wasm | Witness calculator | ~3 MB |
transaction2.zkey | Proving 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.tsSources (first match wins):
dome-sdk-evm/circuits/transaction2.{wasm,zkey}dome-core-evm/build/circuits/transaction2_js/transaction2.wasm+transaction2_final.zkey
Hosting options
| Provider | Notes |
|---|---|
| Cloudflare R2 | Cheap egress; public bucket or signed URLs |
| AWS S3 + CloudFront | Standard static CDN |
| GitHub Releases | Simple for testnet; not ideal for production bandwidth |
| Same origin as backend | Serve /circuits/* from nginx/Caddy in front of @dome/backend |
| Cloudflare Tunnel | Static 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.zkeyR2 (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.zkeyExpose 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/transactionCORS
Browsers fetch .wasm and .zkey cross-origin during proving. Allow:
GETfrom client originsAccess-Control-Allow-Origin: *(or your app origin)
The bundled static server (scripts/circuits/serve-static.cjs) sets CORS headers for local/tunnel hosting.
Integrity (recommended)
Publish SHA-256 checksums:
sha256sum dome-sdk-evm/circuits/transaction2.wasm dome-sdk-evm/circuits/transaction2.zkeyHosted testnet checksums: https://circuits.getdome.app/SHA256SUMS
Future clients can verify artifacts before proving.
Testnet checklist
-
transaction2.wasmover HTTPS —https://circuits.getdome.app/transaction2.wasm -
transaction2.zkeyover HTTPS —https://circuits.getdome.app/transaction2.zkey - CORS headers (via
scripts/circuits/serve-static.cjs) -
keyBasePathinbase-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.shMobile / SDK:
DOME_CIRCUIT_KEY_BASE_PATH=https://circuits.getdome.app/transaction
DOME_EVM_INDEXER_URL=https://api.getdome.app