Skip to content

About

Self-hosted native Aztec tx prover (bb/accelerator) with Docker + Helm for k3s

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

aztec-prover

Self-hosted native Aztec transaction proving for browsers and dApps.

This repo packages Aztec Accelerator’s headless accelerator-server (runs native bb) behind a tiny Go edge proxy, with Docker and a Helm chart for k3s/Kubernetes.

It is the deployable counterpart to pointing Dark Forest Aztec (or any Accelerator-enabled dApp) at a local prover URL.

Not a classic Dark Forest snarker.
DF Aztec does not use Circom/snarkjs. Proving is Aztec PXE + native bb via Accelerator.

Why this exists

Approach Speed Notes
Browser WASM proving Slow Default fallback when no accelerator
Accelerator on laptop Fast Great UX, machine must be on
aztec-prover on NUC/k3s Fast + always-on This repo

Native bb is already the fast path. This project does not reimplement the prover in Go/TS. It:

  1. Runs official accelerator-server (Rust) + cached bb
  2. Adds a Go proxy so Kubernetes can reach a process that binds loopback
  3. Ships Docker + Helm for one-command deploys

Architecture

Browser dApp (e.g. https://aztec.dfpunk.xyz)
    │  POST /prove   (Accelerator SDK)
    ▼
SSH tunnel / port-forward / private ingress
    │  http://127.0.0.1:59833  (or Service via proxy)
    ▼
┌──────────────────────────────────────────┐
│  Pod: aztec-prover                       │
│                                          │
│  :8080  Go edge proxy                    │
│           │ rewrites Host → 127.0.0.1    │
│           ▼                              │
│  :59833 accelerator-server (loopback)    │
│           │                              │
│           ▼                              │
│         bb 5.x (native, multi-thread)    │
└──────────────────────────────────────────┘

Why a proxy?

accelerator-server binds 127.0.0.1 only and rejects non-loopback Host headers (anti DNS-rebinding). That is correct for desktop use, but a Kubernetes Service dials the pod IP, so probes//prove never hit the process.

The Go proxy listens on 0.0.0.0:8080, forwards to 127.0.0.1:59833, and sets Host: 127.0.0.1:59833. Proving stays native; only the edge is Go.

Quick start (Docker)

docker build -t aztec-prover:local .

docker run --rm -p 8080:8080 \
  -e ALLOWED_ORIGINS='https://aztec.dfpunk.xyz,http://127.0.0.1:5173' \
  -e AZTEC_VERSION=5.0.1 \
  -e ACCELERATOR_VERSION=1.0.7 \
  aztec-prover:local

Health:

curl -sS http://127.0.0.1:8080/healthz
curl -sS http://127.0.0.1:8080/readyz
curl -sS -H 'Host: 127.0.0.1:59833' http://127.0.0.1:8080/health

Browser clients talk to whatever URL you tunnel/port-forward as http://127.0.0.1:59833 because the Accelerator JS SDK requires a loopback host. Use SSH/kubectl port-forward on the client machine, not a public 0.0.0.0 bind in the browser config.

Dark Forest Aztec

  1. Deploy this chart on your NUC/k3s (or run Docker on a always-on box).
  2. On the machine running the browser:
    # example: port-forward Service to local 59833
    kubectl -n aztec-prover port-forward svc/aztec-prover 59833:8080
    # or SSH tunnel to the node
    ssh -N -L 59833:127.0.0.1:30080 user@nuc
  3. In DF Connection settings → Accelerator / prover URL: http://127.0.0.1:59833
  4. Send a tx. Confirm in pod logs: Received /prove → Starting bb prove → Proving succeeded.

Helm (k3s / Kubernetes)

helm upgrade --install aztec-prover ./charts/aztec-prover \
  --namespace aztec-prover --create-namespace \
  --set allowedOrigins='https://aztec.dfpunk.xyz,http://127.0.0.1:5173' \
  --set resources.requests.cpu=4 \
  --set resources.requests.memory=8Gi \
  --set resources.limits.cpu=8 \
  --set resources.limits.memory=16Gi

Key values (charts/aztec-prover/values.yaml):

Value Default Purpose
allowedOrigins DF + localhost Browser origins allowed by accelerator
aztecVersion 5.0.1 bb version to pre-cache / request
acceleratorVersion 1.0.7 Headless server release
persistence.enabled true PVC for ~/.aztec-accelerator bb cache
resources CPU/mem heavy bb is multi-threaded CPU
service.type ClusterIP Prefer tunnel/port-forward; avoid public LB
proxy.authToken "" Optional bearer for non-browser callers

Performance tips

  1. Give it real CPU — bb scales with cores; 4–8+ cores recommended.
  2. Persist the bb cache PVC — avoid re-downloading on every pod restart.
  3. Pin aztecVersion to the dApp SDK line (DF Aztec uses 5.0.1 today).
  4. One busy prover per node first; horizontal scale only after measuring queueing.
  5. Keep witnesses off the public internet — ClusterIP + SSH/port-forward/Tailscale.

Security model

  • Accelerator still enforces loopback Host (proxy rewrites it on the internal hop).
  • ALLOWED_ORIGINS deny-by-default for browser Origins.
  • Optional PROXY_AUTH_TOKEN on the edge for non-browser callers.
  • Do not put this on a public LoadBalancer without TLS + auth + threat review.
  • /prove carries private witness material — treat like a secret-handling service.

Repository layout

cmd/proxy/           Go edge proxy
Dockerfile           Multi-stage: build proxy + fetch accelerator + bb
docker-entrypoint.sh Start accelerator then proxy
charts/aztec-prover  Helm chart
scripts/             Helper scripts (download, kind smoke)

Language choice

Component Language Why
Prover Official Accelerator + bb (Rust/C++) Fastest correct path; don’t rewrite
Edge proxy Go Tiny static binary, great for k8s sidecars/edges
Packaging Docker + Helm k3s-native deploy

Rewriting the prover in TypeScript would be slower (WASM). A from-scratch Rust prover duplicates Accelerator without benefit.

Verify native proving

Pod / container logs should look like:

Received /prove request
Requested Aztec version version=5.0.1
Starting bb prove ...
Proving succeeded

Browser console (DF) should show Accelerator phases ending in Phase: proved without fallback.

License

  • This repo: MIT
  • Aztec Accelerator: AGPL-3.0 (upstream binary downloaded at image build/runtime — comply with upstream terms when distributing images that bundle it)
  • bb / Aztec packages: see AztecProtocol/aztec-packages

Credits

About

Self-hosted native Aztec tx prover (bb/accelerator) with Docker + Helm for k3s

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages