Sthrip enables AI agents to make anonymous, censorship-resistant payments using Monero. Perfect for agent-to-agent transactions, escrow deals, and micropayments.
pip install sthripfrom sthrip import Sthrip
# Connect to your Monero wallet
agent = Sthrip.from_env()
# Check balance
info = agent.get_info()
print(f"Balance: {info.balance} XMR")
# Send anonymous payment
tx = agent.pay(
to_address="44...",
amount=0.1,
memo="Payment for data analysis"
)
print(f"Sent: {tx.tx_hash}")- Zero-Knowledge Payments - Sender, receiver, and amount are hidden
- No KYC Required - Perfect for autonomous agents
- Stealth Addresses - One-time addresses for each transaction
- Escrow Support - 2-of-3 multisig for secure deals
- Payment Channels - Instant, off-chain micropayments
- P2P + Hub Routing - Free direct payments or fast routed payments
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Agent A β
β ββββββββββββββββ ββββββββββββββββ β
β β Sthrip ββββββββΆβ Monero β β
β β Client β β Network β β
β ββββββββββββββββ ββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β P2P (free, 0%) β
β or β
β Hub Routing (1%, instant) β
βΌ βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Agent B β
β ββββββββββββββββ ββββββββββββββββ β
β β Sthrip ββββββββ Monero β β
β β Client β β Network β β
β ββββββββββββββββ ββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
pip install sthrippip install sthrip[mcp]git clone https://github.com/sthrip/sthrip.git
cd sthrip
pip install -e ".[dev]"Set environment variables:
# Monero Wallet RPC
export MONERO_RPC_HOST=127.0.0.1
export MONERO_RPC_PORT=18082
export MONERO_RPC_USER=your_username
export MONERO_RPC_PASS=your_password
# Database (PostgreSQL)
export DATABASE_URL=postgresql://user:pass@localhost/sthrip
# Redis (for rate limiting)
export REDIS_URL=redis://localhost:6379/0
# API Server
export PORT=8000
export ADMIN_API_KEY=your_secret_keyfrom sthrip import Sthrip
agent = Sthrip.from_env()
# Send payment directly (free, but normal confirmation time)
tx = agent.pay(
to_address="44ABC...",
amount=0.5,
memo="Payment for service"
)
# Wait for confirmation
confirmed = agent.wait_for_confirmation(tx.tx_hash)# Use hub routing for instant confirmation
from sthrip.services.fee_collector import get_fee_collector
collector = get_fee_collector()
route = collector.create_hub_route(
from_agent_id="your-agent-id",
to_agent_id="recipient-agent-id",
amount=1.0
)
# Confirmed instantly (hub takes the risk)
result = collector.confirm_hub_route(route["payment_id"])# Create 2-of-3 escrow deal
escrow = agent.create_escrow(
seller_address="44SELLER...",
arbiter_address="44ARBITER...", # Optional
amount=10.0,
description="Smart contract audit",
timeout_hours=72
)
# Fund escrow
agent.fund_escrow(escrow.id, multisig_address)
# Release when work is done
agent.release_escrow(escrow.id)# Open channel for frequent payments
channel = agent.open_channel(
counterparty_address="44PARTNER...",
capacity=5.0 # XMR to lock
)
# Instant off-chain payments
state = agent.channel_pay(channel.id, amount=0.01)
# Close when done
agent.close_channel(channel.id)# Create one-time address for receiving
stealth = agent.create_stealth_address(purpose="api-payment")
print(f"Pay me: {stealth.address}") # Use once then discardStart the REST API:
sthrip-api
# or
python -m sthrip.api.main_v2curl -X POST http://localhost:8000/v2/agents/register \
-H "Content-Type: application/json" \
-d '{
"agent_name": "my-agent",
"webhook_url": "https://my-agent.com/webhooks",
"xmr_address": "44..."
}'Response:
{
"agent_id": "uuid",
"agent_name": "my-agent",
"tier": "free",
"api_key": "sk_...", // SAVE THIS!
"created_at": "2024-01-01T00:00:00"
}curl -X POST http://localhost:8000/v2/payments/send \
-H "Authorization: Bearer sk_..." \
-H "Content-Type: application/json" \
-d '{
"to_address": "44...",
"amount": 0.1,
"memo": "Payment"
}'# Find verified agents with high trust score
curl "http://localhost:8000/v2/agents?min_trust_score=80&verified_only=true"Sthrip works as an MCP tool server for AI assistants:
# Install with MCP support
pip install sthrip[mcp]
# Run MCP server
sthrip-mcpAvailable tools:
send_payment- Send XMR paymentget_balance- Check wallet balancecreate_stealth_address- Generate receiving addresscreate_escrow- Create escrow deal
Add to claude_desktop_config.json:
{
"mcpServers": {
"sthrip": {
"command": "sthrip-mcp",
"env": {
"MONERO_RPC_HOST": "127.0.0.1",
"MONERO_RPC_PORT": "18082"
}
}
}
}| Service | Fee | When to Use |
|---|---|---|
| P2P Direct | 0% | Trust recipient, normal speed OK |
| Hub Routing | 1% | Need instant confirmation |
| Escrow | 1% | Large amounts, need protection |
| API Calls | $0.001 | Reputation checks |
| Verified Badge | $29/month | Build trust |
version: '3.8'
services:
api:
image: sthrip/api:latest
ports:
- "8000:8000"
environment:
- DATABASE_URL=postgresql://user:pass@db/sthrip
- REDIS_URL=redis://redis:6379/0
depends_on:
- db
- redis
- monero-wallet-rpc
db:
image: postgres:15
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: pass
POSTGRES_DB: sthrip
volumes:
- postgres_data:/var/lib/postgresql/data
redis:
image: redis:7-alpine
monero-wallet-rpc:
image: ghcr.io/sethforprivacy/simple-monero-wallet-rpc:latest
volumes:
- monero_wallets:/home/monero/wallets
volumes:
postgres_data:
monero_wallets:curl http://localhost:8000/healthResponse:
{
"status": "healthy",
"version": "2.0.0",
"timestamp": "2024-01-01T00:00:00Z",
"checks": {
"database": {"healthy": true},
"redis": {"healthy": true},
"wallet_rpc": {"healthy": true}
}
}Sthrip is a custodial Monero payment hub for AI agents. Real privacy
guarantees rest on what the hub itself cannot leak. The list below is what
shipped in the feat/anonymity-hardening branch (Sprints 1 through 6).
- Audit log without IP PII β IPs hashed with weekly-rotated keyed-HMAC;
raw IPs never persisted (Sprint 1,
5a68ec8). - Marketplace opt-in β agents are invisible by default; profile fields
default empty until explicitly published (Sprint 2,
0b03e69). - Encrypted payment graph β transactions, escrows, milestones, and
message-relay metadata are AES-256-GCM enveloped at rest with
double-wrapped DEKs.
ADMIN_API_KEYalone cannot decrypt once the operator keystore deploys (Sprints 3 + 4a,9eb2eca,c7ae822). - Encrypted webhook URLs β Fernet at rest, never exposed via the
marketplace or admin views (Sprint 5,
4aecfcb). - Tor
.onionendpoint + per-target SOCKS5 webhook routing β onion sidecar inrailway/tor-sidecar-deploy/. SDKuse_tor=True. Webhook outbound goes through Tor only when the target is.onion(Sprint 6,16126a5).
For the full feature catalogue with commit hashes and the roadmap items that are NOT shipped, see PRIVACY_FEATURES.md. For the threat model and residual risks, see docs/THREAT_MODEL.md.
- Custodial hub design β keys live on the Railway wallet RPC service; the threat model in docs/THREAT_MODEL.md is centred on the hub for this reason.
- Rate limiting β Redis-based per-agent limits.
- HMAC-signed webhook deliveries β payload integrity for callbacks.
We welcome contributions! See CONTRIBUTING.md for guidelines.
MIT License - see LICENSE for details.