Confidential payments for AI agents

Give your agent a private balance.

It pays APIs, tools and other agents in USDC on Solana. Anyone can see that it paid. Only you and the payee see how much.

Fig. 1The chain as anyone reads it: who paid whom, and when. The ring is a viewing key, and it follows your pointer. A scripted run of the SDK.

1How it works

A paid request is one extra round trip.

The provider answers 402 with a price. The wallet pays it, and the same request goes through.

1/7

Request

A normal request. No account, no API key.

agent to provider
GET /v1/search?q=gpu+spot+price HTTP/1.1
Host: search.example
Fig. 2One run of the SDK’s wallet against its paywall. The 402 format is Doei’s own.

2Limits

The agent spends. You set the limits.

A policy is a small JSON file. The wallet checks every payment against it, and one call stops them all.

Spending policy checked in the wallet
  1. search api0.0042paid
  2. price feed0.001paid
  3. page fetch0.035paid
  4. summarizer agent0.12refused at the payee check
  5. page fetch0.08refused at the per payment check
  6. page fetch0.035paid
  7. search api0.0042paid
  8. page fetch0.035refused at the daily budget check
Spent in 24 h0.080194 / 0.10 USDC
Fig. 3Decisions made by the SDK’s policy engine. The wallet checks every payment before anything is signed.

3Privacy

What the chain sees, and what it doesn’t.

Confidential, not anonymous. Who paid whom, and when, stays public. Deposits and withdrawals show their amounts.

One payment three readers
From
5G7o…S6To
To
BAmB…ti6z
When
09:30:02 slot 418203613

Printed on the slip. The same for every reader.

Amount0.0042
Fee0.000042
Balance after24.995758
Fig. 4One transfer from a run of the SDK. The viewing key reads; it cannot spend.

Privacy model

4Interface

A wallet for your code. Five tools for your model.

Both spend through the same wallet, so the same policy applies. Keys never enter a prompt.

  • doei_balancereads
  • doei_quotereads
  • doei_payspends
  • doei_fetchspends
  • doei_receiptsreads
examples/hero.ts
const wallet = createAgentWallet({ rail, asset: USDC, policy });

// The API answers 402 with a price. The wallet checks your policy,
// pays from the private balance, and retries with proof.
const response = await wallet.fetch(
  "https://api.example.com/v1/search?q=priority+fees",
);

5Token

A fee on each payment funds buybacks of DOEI.

1% per payment, 100% of it to buybacks. And part of every trade of DOEI is set aside for the agents that pay through Doei.

Agent walletpays amount hidden USDC
Providergets its price in full

One transaction, two outputs. Both amounts sealed.

Fee collectorholds amount hidden USDC
Buyback100% of fees buy DOEI
Fig. 5The SDK adds the fee output to the same transaction as the payment.

Fee and token parameters

6Status

What exists today.

The wallet, the paywall and the Privacy Rings adapter have carried a real USDC payment end to end on Solana mainnet.

  • Policy engineImplemented
  • HTTP 402 client and paywallImplemented
  • MCP serverImplemented
  • Privacy Rings adapterVerified on mainnet
  • Wallet page and command lineLive
  • Paid resource and fee checkLive
  • Package releaseInstallable
Is this anonymous?

No. Amounts and balances are hidden. Addresses and timing are public, and deposits and withdrawals show their amounts.

Where does the policy run?

In the wallet process, before anything is signed. It is not an on-chain program, so it only limits an agent that spends through the wallet.

Is this x402?

Same HTTP 402 pattern, its own wire format. It is not compatible with x402 clients or facilitators.

Can I install the SDK today?

Yes. The quickstart has the install line.