AI Agent Payment Rails built on the Stellar blockchain.
The fastest, cheapest way to give AI agents autonomous payment capabilities.
AI agents need money. Today, giving an agent a wallet means dealing with:
- π΄ Ethereum gas fees that cost more than the payment itself
- π΄ Slow finality that breaks real-time workflows
- π΄ No spend controls β agents can drain wallets
- π΄ No audit trail for compliance
StellarAgent fixes all of this. Stellar's 2.5s finality and near-zero fees mean an agent can pay $0.001 per API call without the fee eating the payment. Our Soroban contracts add spend limits, escrow, and full audit trails on top.
stellaragent/
βββ contracts/ # Soroban smart contracts (Rust)
β βββ agent_wallet_factory/
β βββ payment_channel/
β βββ escrow/
β βββ rate_limiter/
β βββ circuit_breaker/
β βββ price_oracle/
β βββ amm_swap/
βββ packages/
β βββ core/ # @stellaragent/core β the TypeScript SDK
β βββ react/ # @stellaragent/react β hooks
β βββ indexer/ # Audit ledger, reports, exports, delivery
β βββ cli/ # @stellaragent/cli
βββ python/ # stellaragent β the Python SDK
βββ services/
β βββ signer/ # stellaragent-signer β the remote signing service
βββ dashboard/ # React + Tailwind business dashboard
βββ fixtures/ # Shared TS β Python β Rust determinism fixtures
βββ scripts/ # Deployment and fixture tooling
βββ zk/ # Solvency-proof circuits (Rust)
βββ docs/ # Documentation
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Your AI Agent β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β stellaragent SDK
ββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββ
β SDK Layer (TypeScript/Python) β
β createAgentWallet() β payForAPI() β requestWork() β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β Soroban RPC
ββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββ
β Soroban Smart Contracts (Rust) β
β AgentWalletFactory β PaymentChannel β Escrow β
β RateLimiter β AuditLog β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β Stellar Network
ββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββ
β Stellar Blockchain β
β USDC Β· XLM Β· 2.5s finality Β· ~$0 β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
npm install @stellaragent/sdkimport { StellarAgent } from '@stellaragent/sdk';
const agent = await StellarAgent.create({
network: 'testnet',
});
await agent.createAgentWallet('research-agent');
await agent.openChannel({
token: 'XLM',
deposit: '10',
limitPerPeriod: '5',
period: 'hourly',
});
// Pay for an API call
await agent.payForAPI({
endpoint: 'https://api.example.com/inference',
recipient: 'G...API_PROVIDER_ADDRESS',
amount: '0.001',
asset: 'XLM',
});
// Agent-to-agent escrow job
const job = await agent.requestWork({
workerAgent: 'G...AGENT_ADDRESS',
task: 'Summarize this document',
escrowAmount: '0.05',
asset: 'XLM',
});Agents can also pay from the channel asset while the recipient receives a
different asset. Configure AMM/path-payment providers, call agent.quote() to
preview the deterministic route and cost, then pass that quote unchanged to
payForAPI(). Multi-hop execution is atomic and the TypeScript/Python selector
is verified against shared fixtures. See the
multi-asset routing guide.
Contract IDs must be configured through contracts or the
STELLARAGENT_<NETWORK>_* environment variables described in the deployment
guide. Friendly non-XLM asset codes also need an assetContracts mapping to
their deployed Stellar Asset Contract ID.
Holding a raw secret in a long-lived process is a real risk once an agent has
funds. Pass a signer instead β the key stays behind a network boundary and
never enters this process:
import { StellarAgent, RemoteSigner } from '@stellaragent/sdk';
const agent = await StellarAgent.create({
network: 'mainnet',
signer: new RemoteSigner({
url: 'https://signer.internal',
token: process.env.SIGNER_TOKEN,
expectedPublicKey: process.env.AGENT_ADDRESS,
}),
});
agent.holdsSecretKey; // falseSee docs/signing.md for the protocol, the hardware-wallet adapter, and why a signing service rather than Ledger.
Full API reference (generated from the SDKs' own TSDoc comments, pnpm docs:api): docs/api. For how @stellaragent/core is
put together and where new code belongs, see
docs/architecture/core-modules.md.
pip install stellaragentfrom stellaragent import StellarAgent, SpendLimit, PayForAPIParams
agent = StellarAgent.create(
network="testnet",
spend_limit=SpendLimit(amount="10", asset="USDC", period="hourly"),
)
agent.pay_for_api(
PayForAPIParams(
endpoint="https://api.example.com/inference",
amount="0.001",
asset="USDC",
)
)The Python SDK's deterministic math is a strict semantic port of the TypeScript one β both are verified byte-identical against 643 shared fixtures as a required CI check, so a mixed TS/Python agent fleet cannot disagree about a bid score. See python/README.md.
An agent with real funds should not hold a raw secret. services/signer is the
server side of the RemoteSigner protocol the SDKs already speak β KMS-backed,
policy-enforcing, and audited:
cd services/signer
cargo run -- issue-token # a credential
cargo run -- check --config config.toml # validate before binding a port
cargo run -- serve --config config.tomlconst agent = await StellarAgent.create({
network: 'testnet',
signer: new RemoteSigner({ url: 'https://signer.internal', token: process.env.SIGNER_TOKEN }),
});
agent.holdsSecretKey; // falseIt decodes every envelope before signing it, refuses anything it cannot fully understand, enforces per-key spend caps and allowlists, and writes a hash-chained audit record for every request β granted or refused. Runbook and threat model: docs/signer-deployment.md.
There are seven contracts, and four of them need initializing in a specific order before three others can be wired to them β so deploy them with the script rather than by hand:
pnpm deploy:contracts --network testnet --source aliceIt builds every WASM, deploys, initializes, cross-wires, and writes
deployments/testnet.json plus a matching .env block. Full runbook:
docs/deployment.md.
A PaymentChannel owner can prove, without revealing individual payments,
that a private payment history is a valid explanation for the channel's
public limit_per_period and total_spent. The PaymentChannel contract
verifies that proof on-chain through Soroban's native BLS12-381
pairing_check host function.
cd zk && cargo build --release --bin solvency-prover
./target/release/solvency-prover setup --out-dir ./keys
./target/release/solvency-prover prove --pk ./keys/pk.bin --history history.json \
--limit 500000 --total 750000 --out proof.json
./target/release/solvency-prover verify --vk ./keys/vk.bin --proof proof.jsonStep-by-step walkthrough, including the on-chain set_solvency_vk and
verify_solvency_proof invocations and measured timings:
docs/zk-solvency-walkthrough.md.
Design and threat model: docs/zk-solvency-design.md.
cd dashboard
npm install
npm run devThe Reports view builds agent/owner statements, attaches exact on-chain balance reconciliation, streams CSV/JSON Lines/IIF, drills to transaction proof, and administers schedules/dead letters. See the explicit proof limits, deployment, verification, and recovery guide in docs/audit-trail.md.
The Rate Limits view reads live on-chain ceilings through the
useRateLimitStatus hook: per-transaction, hourly, daily, and hourly
transaction-count limits with exact headroom, an estimate of when each rolling
window resets, and a local "would this payment go through?" check. It needs
contract addresses at build time:
VITE_STELLAR_NETWORK=testnet \
VITE_CONTRACT_RATE_LIMITER=C... \
VITE_CONTRACT_PAYMENT_CHANNEL=C... \
npm run buildWithout them the page says so instead of showing zeros. See dashboard/src/lib/agentRuntime.tsx.
- Project scaffolding & architecture
-
AgentWalletFactorySoroban contract -
PaymentChannelSoroban contract -
EscrowSoroban contract -
RateLimiterSoroban contract - TypeScript SDK core
- Python SDK
- Rust SDK
- Business dashboard (React + Tailwind)
- Stellar Community Fund grant application
- Mainnet deployment
We welcome contributors! See CONTRIBUTING.md for how to get started.
Good first issues are labeled good first issue.
MIT Β© StellarAgent Contributors