Shield. Swap. Lend. Bridge. All private. All gasless.
b402 wraps Railgun's ZK privacy pool with an agent-friendly SDK and MCP server. On-chain observers see "RelayAdapt called a DEX" — not your wallet, not your strategy.
bash
npx b402-mcp@latest --claude
This generates a wallet at ~/.b402/wallet.json, patches your Claude Desktop config, and registers the MCP server. Fund the wallet with USDC on Base to start.
ToolWhat it doescheck_pool_balanceShow shielded balances, wallet state, vault positionsshield_usdcMove USDC into the Railgun privacy pool (gasless)private_swapSwap tokens inside the pool via ZK proof (USDC↔WETH, etc.)lend_privatelyDeposit into Morpho vault from pool (~4-8% APY)redeem_privatelyWithdraw from Morpho vault back to poolcross_chain_privatelyPrivate cross-chain transfer or swap via LI.FI (Base→Arb, etc.)get_swap_quotePreview swap rates without executingrun_strategyMulti-step: swap + lend + reserve in one call
text
Agent prompt → MCP tool call → b402-sdk
→ Railgun ZK proof (client-side, 10-30s)
→ RelayAdapt atomic tx (unshield → DeFi op → reshield)
→ On-chain: only RelayAdapt visible. No wallet linked.
Cross-chain: LI.FI routes through ~30 bridges + ~20 DEXes. Source and destination are unlinkable.
ChainIDPrivacy poolCross-chainBase8453Yes (0% fee)Source + destArbitrum42161Yes (0% fee)Dest only (v1)BSC56Yes (0% fee)Dest only (v1)
typescript
import { B402 } from '@b402ai/sdk'
const b402 = new B402({ privateKey: process.env.WORKER_PRIVATE_KEY! })
// Shield into privacy pool (gasless)
await b402.shieldFromEOA({ token: 'USDC', amount: '10' })
// Private swap inside pool
await b402.privateSwap({ from: 'USDC', to: 'WETH', amount: '5' })
// Private cross-chain (LI.FI routing)
await b402.privateCrossChain({
toChain: 'arbitrum',
fromToken: 'USDC',
toToken: 'ARB',
amount: '1',
destinationAddress: '0x...',
})
// Private lend (Morpho vaults, 4-8% APY)
await b402.privateLend({ amount: '10', vault: 'steakhouse' })