Ark-backed Cashu mint — Chaumian ecash where issued tokens are backed by Ark VTXOs instead of Lightning channel liquidity. Users get Cashu-style privacy; backing sits in unilateral-exit-capable VTXOs rather than a hot Lightning node.
⚠️ Legal noticeOperating a mint may constitute regulated financial activity in many jurisdictions. This is experimental software with no warranty. See docs/DISCLAIMER.md before deploying for others.
Status: active scaffold. Default dev mode uses mock ASP + mock BDHKE. Production-shaped paths are wired: barkd and Arkade ASP clients, cdk-signatory remote signing, optional exit auto-claim, and live melt payout when
ark.backend = barkd./v1/infopubkey metadata remains scaffolded.
Most Cashu mints today custody bitcoin in Lightning — channel management, liquidity balancing, and node uptime become the operator's problem. Minerva Mint explores a different backing model:
| Layer | Role |
|---|---|
| Cashu | Chaumian ecash (NUT HTTP API, blind signatures) |
| Ark VTXOs | Off-chain UTXOs with unilateral exit to L1 |
| Bitcoin Core | Chain truth, fee estimation, exit broadcast |
| Transparency | PoL + PoR + OpenTimestamps — inflation detectable, not invisible |
The goal is freedom-tech infrastructure: ecash issuance and redemption where no single vendor controls the full stack — open protocols, auditable liabilities, and an exit path that does not depend on the mint staying online.
┌─────────────┐ ┌──────────────────────────┐ ┌─────────────┐
│ Cashu │────▶│ Minerva Mint (Rust) │────▶│ Ark ASP │
│ wallet │ │ · NUT API (axum) │ │ │
└─────────────┘ │ · SignatoryPolicy │ └─────────────┘
│ · VTXO inventory (SQL) │
│ · PoL ledger + OTS │
└────────────┬─────────────┘
│
┌────────────┴─────────────┐
│ Bitcoin Core (your node) │
│ sync · fees · broadcast │
└──────────────────────────┘
- Mint — User pays (bolt11 via ASP) → mint issues blinded tokens → batch mapped to a backing VTXO. Auto-boards sats when free reserve is low.
- Swap — Standard Cashu refresh; no Ark interaction.
- Melt — Proofs burned → payout through ASP (LN or Ark offboarding).
- Refresh — Scheduler rolls VTXOs before expiry; mappings updated atomically.
- Exit —
POST /ark/exitbroadcasts unilateral exit txs if the ASP fails.
Details: docs/trust-model.md
Requirements: Rust stable, SQLite (bundled via rusqlite).
git clone https://github.com/Z0rlord/minervamnt.git
cd minervamnt
cp .env.example .env # set secrets locally — never commit .env
cargo build
cargo test # unit + HTTP integration tests
cargo run # listens on 0.0.0.0:3338 by defaultSmoke test:
curl -s localhost:3338/health | jq
curl -s localhost:3338/v1/info | jq
curl -s localhost:3338/transparency/summary | jqOut of the box the mint uses a deterministic mock ASP — no external services required for development.
Non-secret defaults live in config.toml. Secrets and overrides use
environment variables (see .env.example).
| Section | Keys | Purpose |
|---|---|---|
[mint] |
name, url, description |
Identity on /v1/info |
[server] |
host, port |
HTTP bind address |
[ark] |
backend, server_url, barkd_url / wallet_url, exit claim |
ASP + wallet daemon |
[signatory] |
backend, url |
BDHKE signing (mock / remote / local) |
[bitcoin] |
rpc_url (+ env user/password) |
Your Bitcoin Core RPC |
[liquidity] |
reserve / board thresholds | VTXO sizing policy |
[database] |
path |
SQLite file location |
[trust] |
vtxo_verify_mode, pol_enabled, … |
Verification & PoL |
[trust.ots] |
enabled, calendar_urls |
OpenTimestamps stamping |
[melt] |
backend |
Melt payout: inherit, mock, or barkd |
Common env vars: BITCOIN_RPC_URL, BITCOIN_RPC_USER, BITCOIN_RPC_PASSWORD,
MINERVA_CONFIG, MINERVA_MINT_URL, RUST_LOG.
Your infrastructure, your rules. Run Bitcoin Core on any host you control (home server, VPS, colo). Reach it however you prefer — localhost, VPN, SSH tunnel, or private network. The mint only needs a standard JSON-RPC endpoint.
| Method | Path | NUT |
|---|---|---|
| GET | /v1/info |
NUT-06 |
| POST | /v1/mint/quote/bolt11 |
NUT-04 |
| POST | /v1/mint/bolt11 |
NUT-04 |
| POST | /v1/melt/quote/bolt11 |
NUT-05 |
| POST | /v1/melt/bolt11 |
NUT-05 |
| POST | /v1/swap |
NUT-03 |
| Method | Path | Purpose |
|---|---|---|
| GET | /ark/vtxo/{token_id} |
Backing VTXO for an issuance batch |
| POST | /ark/exit |
Unilateral exit for a token's VTXO |
| GET | /ark/refresh/status |
Refresh queue and expiry horizon |
| Method | Path | Purpose |
|---|---|---|
| GET | /transparency/summary |
Ecash vs VTXO backing, PoL/OTS status |
| GET | /v1/pol/status |
Current PoL epoch totals |
| GET | /v1/pol/roots/{keyset_id} |
Closed epoch Merkle roots |
| GET | /v1/pol/ots/{epoch_day} |
OpenTimestamps proof for an epoch |
| GET | /health |
ASP connectivity, reserve, optional Bitcoin sync |
Minerva implements dual attestation:
- Proof of Liabilities (PoL) — every mint and melt logged; daily epochs with chained Merkle roots, anchored via OpenTimestamps.
- Proof of Reserves (PoR) — outstanding ecash reconciled against allocated
VTXO msat (
GET /transparency/summary). - Signatory policy — blind signing gated on paid quote + VTXO allocation.
- V-PACK verification — structural checks on boarded VTXOs (
scaffoldorvpackmode via libvpack-rs).
Full spec: docs/trust-model.md
This repo ships reference material under deploy/ — adapt to your environment:
| Path | Contents |
|---|---|
deploy/systemd/ |
Example systemd unit for the mint binary |
deploy/cloudflared/ |
Example Cloudflare Tunnel config (optional) |
deploy/cloudflare-pages/ |
Static landing page deploy notes |
deploy/pi/ |
Example bare-metal / edge notes (optional reference) |
Typical production layout:
- Build release binary:
cargo build --release - Run behind reverse proxy or tunnel with TLS termination
- Point
[bitcoin].rpc_urlat your synced node (mainnet or signet) - Connect a real Ark ASP — signet via barkd (docs/signet-asp.md)
or Arkade (docs/arkade-asp.md); set
[trust] vtxo_verify_mode = "vpack"on mainnet - Set
signatory.backend = "remote"and run cdk-signatory on a separate host - Expose
/transparency/summarypublicly for third-party reconciliation
Never commit RPC passwords, ASP keys, or tunnel tokens to git.
| Milestone | Status |
|---|---|
| NUT HTTP scaffold + mock ASP | Done |
| VTXO inventory + refresh scheduler | Done |
| SignatoryPolicy + PoL epochs + OTS | Done |
| V-PACK verify at insert | Done |
Signet ASP via barkd (BarkdArkClient) |
Done (signet) |
Arkade ASP client (ArkadeArkClient) |
Done |
CDK BDHKE + remote signatory (BlindSigner) |
Done |
| Exit claim automation (barkd wallet API) | Done |
| Signet melt payout via barkd lightning pay | Done (signet) |
| Mainnet ASP hardening + melt at scale | Planned |
| NUT-20 signed quotes | Planned |
| User-delivered V-PACK at mint | Planned |
| PostgreSQL backend option | Planned |
Contributions and design discussion welcome on these:
- Who pays Ark refresh fees — operator or users?
- Mint-held vs user-held unilateral exit proofs?
- Redemption policy when a VTXO expires before melt?
- Dual backend (Ark + LN gateway) or Ark-only melts?
- VTXO granularity — few large vs many small VTXOs?
Issues and PRs welcome. Please do not commit secrets or operator-specific infrastructure details (hostnames, IPs, credentials) into the public tree.
cargo fmt
cargo clippy -- -D warnings
cargo testGNU Affero General Public License v3.0 or later — see LICENSE.
If you run a modified version of this software as a public network service (e.g. a mint API), AGPL requires you to offer corresponding source to users interacting with that service.
Regulatory disclosures: docs/DISCLAIMER.md