x402 · agent payments · zk-style privacy

Agents pay per request.
Fees go dark.

ZECX402 is a payment rail for AI agents built on HTTP 402. No API keys, no accounts, no invoices. An agent asks, gets a price, signs, and gets the answer. Pay with a blind note and the node never learns who you are. Every protocol fee is swept into shielded ZEC.

CA0xf2a6adf1242370ab6ad0c71d6f7fde276eec6879
Node: checking Settlement: devnet Token: $ZECX402
RESPONSEzecx402-devnet
HTTP/1.1 402 Payment Required
x-accepts:      exact · shielded
x-amount:       0.001000
x-pay-to:       zx1provider0entropy
x-fee-bps:      100
x-fee-route:    zs1qqqqqqq shielded
x-payer:        anon-agent
402
01 · Live console

A real 402 handshake, in your browser.

Your browser just generated a P-256 key. Pick an agent, send the request, and watch the node refuse, quote, verify your signature, do the work, then settle. Switch to SHIELDED to pay with a blind-signed note instead. Nonces are single-use, quotes expire in 60 seconds, and a failed job is never charged.

PAYER
BALANCE 5.000000 USDG (faucet)
NOTES 0 unspent
// select an agent and press SEND REQUEST
Requests0
Paid calls0
Volume · USDG0.000000
Routed to shield + buyback0.000000
02 · Privacy

The node gets paid. It never learns by whom.

Shielded mode uses the same note and nullifier model as Zcash. An agent deposits in public, walks away with a note the node signed without seeing, and later spends it with no link back to the deposit.

Mint

Blind deposit

The agent picks a random serial, blinds it, and pays a public deposit. The node signs the blinded value: s' = (H(serial) · r^e)^d. It has signed a note it cannot read.

Unblind

A note nobody has seen

The agent strips the blinding factor: s = s' · r⁻¹. The result is a valid signature on a serial that has never left the agent. One key per denomination, so every note of a size looks alike.

Spend

Nullifier, not identity

The note goes into X-PAYMENT. The node checks the signature, checks the nullifier set for double spends, does the work, and settles. No address, no key, no account.

What the node sees at mint
payer zx1a3f…c21e
amount 0.001000 USDG
note blinded-beyond-recovery
What the node sees at spend
payer nobody-knows-who
amount 0.001000 USDG
nullifier 0980a2bd60c3…
Notes minted0
Notes spent0
Anonymity set · unspent notes0

Straight talk: this build uses RSA blind signatures (Chaum), not a zk-SNARK. Mint and spend are unlinkable by construction, but your anonymity set is only the other unspent notes of the same denomination, and minting right before spending leaks timing. A SNARK note circuit over a Merkle commitment tree is the upgrade path.

03 · The loop

Usage in, shielded ZEC out.

The flywheel is not driven by people trading a ticker. It is driven by machines buying work from other machines, one request at a time.

01

Agent calls

Any agent hits any ZECX402 endpoint with a plain HTTP request.

02

402 quote

The node answers with a price, a recipient and a single-use nonce.

03

Sign and retry

The agent signs the authorization and resends it in X-PAYMENT.

04

Work, then settle

99% goes to the provider. 1% goes to the protocol. No result, no charge.

05

Fees go dark

Half the fee is swept into a shielded ZEC treasury, half buys back $ZECX402.

04 · Compare

Same ZEC thesis. Different engine.

Launchpads and fee-funded miners both run on trading volume. ZECX402 runs on requests.

Launchpad modelFee-mining modelZECX402
Revenue sourceNew coin launchesTrading fees on the tokenPer-request payments from agents
Who paysTradersTradersSoftware buying a service
Works with flat volumeNoNoYes, as long as endpoints are called
Outcome varianceDepends on each launchDepends on finding a blockEvery paid call routes a fee
Open to buildersLaunch a coinHold onlyPaywall any endpoint in three lines
Payer privacyCreator hidden, traders publicNoneBlind notes: payer unlinkable per request
ZEC linkProceeds paid shieldedBlock rewards fund buybacksFees swept shielded, plus buyback
05 · Build

Two files. Zero dependencies.

The node and the autonomous agent in this repo are the whole protocol. Read them in ten minutes.

Provider · paywall an endpoint
// server.js
AGENTS.summarize = {
  price: 3_000,          // 0.003 USDG
  payTo: 'zx1yourwallet',
  run: (q) => summarize(q),
};
// GET /api/agents/summarize/run
// -> 402 quote -> X-PAYMENT -> 200
Agent · pay without thinking
// agent.js
let res = await fetch(url);
if (res.status === 402) {
  const { accepts: [quote] } = await res.json();
  if (quote.maxAmountRequired > budget) throw 'over budget';
  res = await fetch(url, {
    headers: { 'x-payment': sign(quote) },
  });
}

$ node server.js  ·  $ node agent.js (shielded)  ·  $ PUBLIC=1 node agent.js

06 · Ledger

Settlements on this node.

Public payments show a payer. Shielded payments show only a nullifier.