ArcMint
Federated accountable-anonymous e-cash on Bitcoin.
ArcMint issues Cryptographic Bearer Notes (CBNs) — private, threshold-signed bearer instruments backed by BTC and redeemable via the Lightning Network. No wrapped token. No custodian. No trusted third party. Target: institutional OTC desk settlement and high-value private payments.
Live on Bitcoin mainnet. Federation running. Notes in production.
Table of Contents
How It Works
CBN Lifecycle
- Registration — User samples identity scalar
θ_u ∈ Z_q, computes commitment T_u = g^θ_u, registers with the gateway, and receives an HMAC token bound to θ_u.
- Issuance — Cut-and-choose: user submits
k candidates with Pedersen bit commitments, coordinator challenges k−1 to open, threshold FROST signs the unopened candidate. Notes carry a 90-day validity window.
- Spending — User presents note + signature; merchant issues a random challenge vector; user produces a selective opening proof; coordinator checks the double-spend registry atomically.
- Double-spend detection — A second spend of the same serial triggers identity recovery: XOR of blinding factors at differing-challenge positions recovers
θ_u, identifying the cheating party without touching honest users.
- Anchoring — Merkle roots of issued and spent serial sets are committed to Bitcoin via
OP_RETURN every 600 seconds.
Cryptographic Primitives
| Primitive |
Choice |
Rationale |
| Group |
Ristretto255 |
Prime-order, cofactor-free, DL-hard |
| Threshold signing |
FROST (frost-ristretto255) |
EUF-CMA secure, no trusted dealer in production |
| Commitments |
Pedersen C = g^b · h^r |
Perfectly hiding, computationally binding |
| MAC |
HMAC-SHA256 |
Gateway token binding |
| Hash |
SHA-256 with domain separation |
arcmint:identity:v1, arcmint:note:v1, arcmint:theta:v1 |
Architecture
Workspace Crates
| Crate |
Role |
arcmint-core |
Cryptographic primitives — FROST, Ristretto255, Pedersen commitments |
arcmint-federation |
Coordinator and Signer binaries |
arcmint-gateway |
User registration, HMAC token issuance, IP rate limiting |
arcmint-merchant |
Note verification, spend proof verification, payment acceptance |
arcmint-wallet |
CLI wallet — identity, issuance, spending, atomic file writes |
arcmint-loadtest |
Real HTTP load testing — register → issue → spend → double-spend |
arcmint-adversary |
Protocol attack testing |
arcmint-dkg |
Distributed key generation ceremony tooling |
arcmint-monitor |
Ratatui TUI — Bitcoin node, service health, anchoring status |
Services
| Service |
Port |
Role |
| coordinator |
7000 |
Orchestrates signing rounds, double-spend registry, anchoring |
| signer-1 |
7001 |
FROST signer with individual key package |
| signer-2 |
7002 |
FROST signer with individual key package |
| signer-3 |
7003 |
FROST signer with individual key package |
| gateway |
7002 (internal) |
User registration, token issuance, identity resolution |
| merchant |
7003 (internal) |
Note and spend proof verification |
| bitcoind |
18443 |
Bitcoin Core (regtest) or mainnet pruned |
| lnd |
8080, 10009 |
LND node 1 |
| lnd-2 |
10009 (internal) |
LND node 2 |
| certgen |
— |
CA + mTLS certificate generation (init container) |
Separation Invariants
- Signers only trust requests authenticated by the coordinator's secret. They do not interact with end users.
- The coordinator observes only blinded commitments, serial numbers, and spend proofs — never user identities.
- The gateway manages identity registration and rate limiting but never sees note serials or spend proofs.
- The wallet never shares long-term secrets; it communicates exclusively via the public HTTP APIs.
- The merchant is untrusted by the federation; it must prove note validity through the coordinator's spend verification API.
All inter-service communication uses mutual TLS. The certificate authority is generated by the certgen init container; each service has its own cert signed by the federation CA.
Security Properties
| Property |
Status |
Mechanism |
| Unforgeability |
Proven |
Reduction to DL hardness + FROST EUF-CMA |
| Traceability |
Proven |
Pedersen binding — double-spender identified with probability 1 − 2^{−ℓ} |
| Blindness |
Heuristic |
Holds under static corruption; formal proof under adaptive corruption is an open problem |
| Double-spend prevention |
Enforced |
BEGIN IMMEDIATE transaction with rollback coverage; atomic registry check |
| Secret isolation |
Enforced |
zeroize on all sensitive types (Scalar, BlindingFactor, UnsignedNote) |
| Timing safety |
Enforced |
subtle::ConstantTimeEq for all secret comparisons; all OPERATOR_SECRET variants checked without early return |
| Replay protection |
Enforced |
Spend proofs bound to merchant nonce + timestamp |
| Note expiry |
Enforced |
90-day validity window; reissuance protocol included |
| Protocol versioning |
Enforced |
protocol_version: u8 on all message types |
| Input bounds |
Enforced |
MAX_CANDIDATES = 512 on issuance |
| Metrics authentication |
Enforced |
Bearer OPERATOR_SECRET required on all /metrics routes |
Completed Audit Resolutions
- C1 Hardcoded Bitcoin RPC credentials → env vars, no defaults
- C2 Weak default secrets → blanks with comments;
validate_secret() enforced at startup (min 32 chars)
- C3 TLS validation disabled in test clients →
danger_accept_invalid_certs removed; CA cert required
- C4 Unauthenticated Prometheus metrics → bearer token required on all
/metrics routes
- H1 Services binding
0.0.0.0 → default 127.0.0.1; Docker sets BIND_ADDR=0.0.0.0
- H2
MERCHANT_INSECURE=true plaintext option → removed; TLS mandatory
Quick Start (Docker)
Prerequisites
Steps
# 1. Configure secrets
cp .env.example .env
# Edit .env — all secrets must be ≥ 32 random bytes; no dev- prefixes in production
# 2. Build and start
docker compose up --build
# 3. Run the load test to verify the stack
docker compose --profile loadtest run --rm arcmint-loadtest
All services expose /health for liveness checks wired into Docker health checks.
Default endpoints (host-side ports configurable via .env):
Wallet CLI
arcmint-wallet register --identity-id alice
arcmint-wallet generate-note --denomination 1000 --k 32
arcmint-wallet list-notes
arcmint-wallet spend --serial <note-serial-hex> --merchant-url https://localhost:7003
Key Management
Development
In development, FROST keys are generated by the keygen binary using a trusted dealer. Keys are written into a shared volume and mounted read-only into signers, coordinator, and merchant. Development keys are not suitable for production. The trusted dealer path is gated behind #[cfg(feature = "dev-keygen")].
Production (DKG Ceremony)
Production deployments must establish FROST keys via the distributed key generation ceremony using dkg_coordinator and dkg_participant. INIT_DEV_KEYS must be disabled.
Ceremony procedure:
- Each of the
n federation operators runs on a separate machine in a separate jurisdiction. The internal CA certificate is distributed to all operators out-of-band.
- Operator 1 starts the ceremony with
--create-ceremony, specifying the agreed threshold t and signer count n.
- All operators run
dkg_participant with their --participant-id, --operator-token, and coordinator URL.
- On completion, each operator prints a transcript hash. Operators verify the hash out-of-band (voice call or secure channel). A differing hash indicates a compromised ceremony — abort and restart.
- Each operator's
signer_{id}_key.json must be stored at mode 0600 and never transmitted off-machine. The shared public_key.json is safe to distribute to coordinator, gateway, and merchant.
Key rotation requires a full DKG ceremony. Old keys remain active until the new ceremony is confirmed live across all services.
Operator tokens must be high-entropy (≥ 32 random bytes), never reused across ceremonies, and destroyed after the ceremony completes.
TLS and Certificates
Development (Docker)
The certgen init container generates an internal CA, signer server certificates, coordinator and gateway server certificates, and mTLS client certificates. All services mount the /certs volume automatically.
Production Gateway TLS
Set ACME_DOMAIN to the externally reachable hostname for automatic Let's Encrypt certificate provisioning. The internal mesh (signers and coordinator) continues to use the internal CA.
ACME_DOMAIN=gateway.example.com
ACME_EMAIL=ops@example.com
ACME_CACHE_DIR=/var/lib/arcmint/acme
Certificate Rotation
Rotate internal certificates by re-running the certgen service and performing a rolling restart of signers, coordinator, and gateway. Long-lived clients must refresh their TLS configuration to trust the new CA before old certificates are revoked.
Bitcoin Anchoring
The coordinator anchors federation state to Bitcoin via OP_RETURN every 600 seconds.
Wallet setup:
bitcoin-cli createwallet anchor
bitcoin-cli -rpcwallet=anchor getnewaddress
# Fund the address with ≥ 0.001 BTC
bitcoin-cli -rpcwallet=anchor dumpprivkey <address>
Set ANCHOR_WALLET_WIF and ANCHOR_CHANGE_ADDRESS in .env.
Cost estimate: ~500–2000 satoshis per anchor at normal fee rates (1 input, 2 outputs, OP_RETURN).
Monitoring
docker compose --profile monitoring up
Auto-provisioned dashboards:
arcmint-federation.json — issuance, sessions, DB latency, anchor status
arcmint-lightning.json — channel balances, LN payment latency, mint-in/mint-out
arcmint-security.json — double-spend attempts, verification failures, rate limiting (default home)
/metrics endpoints are only exposed on the internal Docker network.
Load Testing
# Smoke (CI)
cargo run -p arcmint-loadtest -- run-all --config loadtest/smoke.toml --output report.json
# Standard (pre-release)
cargo run -p arcmint-loadtest -- run-all --config loadtest/standard.toml
# Stress
cargo run -p arcmint-loadtest -- run-all --config loadtest/stress.toml
# Docker
docker compose --profile loadtest up arcmint-loadtest
# Spend race only
cargo run -p arcmint-loadtest -- run-spend-race --config loadtest/standard.toml
Service-level objectives:
| Metric |
Smoke |
Standard |
Stress |
| issuance p99 |
5000 ms |
2000 ms |
10000 ms |
| spend p99 |
3000 ms |
1000 ms |
5000 ms |
| signer RPC p99 |
1000 ms |
500 ms |
2000 ms |