Raxol Payments
Agent payment protocols for Elixir. Autonomous agents that can pay for things -- x402/MPP auto-pay, Xochi cross-chain intents, stealth addresses, ZKSAR attestation, spending controls.
Install
{:raxol_payments, "~> 0.1"}Features
- Protocol behaviour -- pluggable payment protocols (x402, MPP, Xochi, Riddler)
- Wallet behaviour --
Wallets.Env(env var) andWallets.Op(1Password via GenServer) - AutoPay -- Req response step handling HTTP 402 transparently
- Xochi -- cross-chain intent settlement (quote -> sign -> execute -> poll)
- Stealth -- ERC-5564/ERC-6538 stealth addresses (~300 LOC, secp256k1)
- ZKSAR -- zero-knowledge attestation verification (6 proof types)
- TrustScore -- diminishing-returns trust aggregation (0-100)
- PrivacyTier -- Glass Cube model (6 tiers, attestation-gated)
- Router -- auto-select protocol based on chain, privacy, trust score
- SpendingPolicy + Ledger -- per-request/session/lifetime spending limits
- PXE Bridge -- Aztec Private eXecution Environment client (JSON-RPC 2.0)
Quick Start
alias Raxol.Payments.{Router, Req.AgentPlugin}
# Router auto-selects protocol
Router.select(cross_chain: true) # => :xochi
Router.select(privacy: :stealth) # => :xochi
Router.select() # => :x402
# Wire auto-pay into agent HTTP backend
plugin = AgentPlugin.auto_pay(
wallet: Raxol.Payments.Wallets.Env,
ledger: ledger_pid,
policy: SpendingPolicy.dev(),
agent_id: :my_agent
)Architecture
Raxol.Payments.Protocol-- behaviour for payment protocol detection + signingRaxol.Payments.Wallet-- behaviour for key managementRaxol.Payments.Router-- protocol selection + settlement routingRaxol.Payments.PrivacyTier-- trust score to tier mappingRaxol.Payments.Zksar-- attestation proof verificationRaxol.Payments.Xochi.Stealth-- ERC-5564/6538 implementation
See Agentic Commerce docs for the full design.