Docs0Overview

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.

One payment top to bottom
Your process
Agent codeCalls wallet.fetch and wallet.pay.
MCP clientThe model calls one of five tools.
Doei SDK
AgentWalletChecks the policy, adds the fee, pays, keeps the receipt.
PaywallProvider side: issues the 402 challenge and verifies the proof.
Rail
RingsRailAdapter over @heliuslabs/spr. Holds the key.
MemoryRailThe same interface in memory, for tests and dry runs.
Network
Helius Privacy RingsShielded balances for SPL tokens.
SolanaSettlement. Addresses stay public.
Fig. D1The path of one payment. The wallet reaches the chain only through the rail.

0.3Contents

0.4Conventions

  • Amounts in code are either bigint base units or decimal strings such as "0.0042". USDC has six decimals, so "0.0042" is 4200n.
  • Addresses are base58 Solana addresses. They are public wherever they appear.
  • Error codes are written in capitals, for example POLICY_DENIED. Branch on error.code, never on a message.
  • Every code sample is a region of a file in the SDK's examples directory. Those files are typechecked against the SDK.