Skip to content

Faucet API

The /v1/faucet/* endpoints provide a custodial eCash Mainnet faucet. It dispenses small amounts of real mainnet ECX (real market value — the SideShift ECX→USDC rate, the same feed dashboard.ecash.com publishes, was $32.77/ECX on 2026-11-29) so users can bootstrap a wallet.

⚠️ This is a NAMED EXCEPTION to AGENTS.md rule 5 (custody). The full custody model, threat model, and abuse-mitigation stack live in packages/faucet/DESIGN.md.

Parameter Value
Amount per claim 0.001 ECX (100,000 szat)
Daily hard cap 0.1 ECX (10,000,000 szat) per UTC day
Cooldowns 24 h per destination address + 24 h per IP
Proof of work SHA-256 hashcash; difficulty scales proportionally with the live Mainnet network difficulty (~1-5 min typical solve)
Chain eCash Mainnet (fork at block 973,728)

Public config: amount, cooldowns, daily cap, Turnstile site key, difficulty target, plus the faucet’s public wallet address and best-effort confirmed balance (send mainnet ECX there to top up the float).

GET /v1/faucet/challenge?turnstileToken=…

Section titled “GET /v1/faucet/challenge?turnstileToken=…”

Issues a single-use proof-of-work challenge (seed, required leading-zero bits, TTL). Requires a valid Cloudflare Turnstile token (action faucet, hostname allowlist). Rate-limited per IP.

{ "seed": "…", "nonce": 123456, "address": "bc1q…", "network": "l1" }

Verifies the PoW, per-address/per-IP cooldowns, and the daily cap, then signs and broadcasts a real payout from the faucet’s self-held HD wallet (BIP-84 P2WPKH, mnemonic in the FAUCET_MNEMONIC_MAINNET Wrangler secret) via the public mainnet esplora API. Returns the broadcast txid. Until the operator funds the wallet, claims fail closed with “no spendable UTXOs — needs a manual top-up”.

Operator/debug: wallet address, confirmed balance, live mainnet network stats (height, difficulty, subsidy).

Layered: Cloudflare Turnstile (challenge issuance gate) → proof-of-work (server-re-verified) → per-address + per-IP 24 h cooldowns → hard daily payout cap (atomic D1 ledger) → single-use challenges (consumed before the payout attempt, so a solved PoW can never be replayed) → per-IP challenge rate limit. See packages/faucet/DESIGN.md §3-4 for the difficulty model.