Section 0
Overview
Doei gives an AI agent a private balance on Solana, behind the owner's spending policy. Amounts are confidential on-chain. Addresses are not.
0.1Status
0.2How the parts fit
Every payment goes through the policy first, then through one interface, the rail. The rail has two implementations: one over Helius Privacy Rings, and one in memory that needs no network.
Your process
Agent codeCalls wallet.fetch and wallet.pay.1
MCP clientThe model calls one of five tools.
Doei SDK
AgentWalletChecks the policy, adds the fee, pays, keeps the receipt.2
PaywallProvider side: issues the 402 challenge and verifies the proof.
Rail
RingsRailAdapter over @heliuslabs/spr. Holds the key.3
MemoryRailThe same interface in memory, for tests and dry runs.
Network
Helius Privacy RingsShielded balances for SPL tokens.4
SolanaSettlement. Addresses stay public.5
0.3Contents
1ConceptsPrivate balance, agent wallet, policy, rail, receipt, viewing key.2QuickstartA dry run with no network, then the same code on Privacy Rings.3SDK referencecreateAgentWallet, pay, fetch, owner actions, errors.4HTTP 402The challenge body, the payment header, and what the server checks.5MCP toolsThe five tools a model sees, their inputs, and how to run the server.6PoliciesThe policy file, the order rules are checked in, the rolling budget.7Privacy modelExactly what is hidden, from whom, and what is not.8StatusWhat is tested and verified, and how the SDK behaves at its edges.
0.4Conventions
- Amounts in code are either
bigintbase units or decimal strings such as"0.0042". USDC has six decimals, so"0.0042"is4200n. - Addresses are base58 Solana addresses. They are public wherever they appear.
- Error codes are written in capitals, for example
POLICY_DENIED. Branch onerror.code, never on a message. - Every code sample is a region of a file in the SDK's
examplesdirectory. Those files are typechecked against the SDK.