You've built the loop. Your agent runs autonomously — researching, deciding, acting. But the moment it needs to pay for something, you hit a wall:
- Every on-chain transaction is public (competitors see your strategy)
- Wallets require seed phrases (agents can't manage those safely)
- Payment APIs require KYC (agents don't have IDs)
Here's how to solve all three in 5 minutes.
The Problem: Transparent Transactions Kill Agent Autonomy
When your agent pays a data provider, the entire world sees:
- Who paid whom
- How much
- When
- The token used
That's not just a privacy problem. It's a competitive intelligence leak. If your trading agent pays for alpha, competitors can front-run you by watching your transactions.
The Solution: BearerSwap
BearerSwap is a commit-reveal protocol on Ethereum that breaks the on-chain link between sender and recipient.
npm install @flatcash/bearerswap ethers
import { BearerSwap } from '@flatcash/bearerswap';
const bs = new BearerSwap({
privateKey: process.env.AGENT_WALLET_KEY,
rpcUrl: 'https://eth.drpc.org',
});
// Agent pays data provider privately
const { secret, nonce } = await bs.commit(
FLAT_TOKEN, '10.0', dataProviderAddress
);
// Share secret off-chain (API call, encrypted message, etc.)
await fetch(providerAPI + '/payment', {
method: 'POST',
body: JSON.stringify({ secret, nonce })
});
// Provider claims tokens (arrives in 2-45 min with privacy delay)
That's it. Three function calls. No KYC. No seed phrase management. No public transaction trail.
How It Works Under the Hood
Agent → commit(hash, token, amount) → Smart Contract
↓ (off-chain: share secret)
Provider → deliver(secret, address, nonce) → Relayer
↓ (random 2-45 min delay)
Relayer → reveal() → Contract → tokens arrive
Privacy guarantees:
- The commit contains only a hash — no recipient info on-chain
- Random delay (exponential distribution, 2-45 min) breaks timing correlation
- Recipient also gets 0.0004 ETH gas stipend
- Zero protocol fees
Real Use Cases in Agent Loops
1. Pay-per-query data access
// In your agent's research loop:
async function buyData(query: string) {
const { secret, nonce } = await bs.commit(FLAT, '1.0', dataVendor);
const data = await fetch(vendorAPI, {
headers: { 'X-Payment-Secret': secret, 'X-Payment-Nonce': nonce },
body: JSON.stringify({ query })
});
return data.json();
}
2. Agent-to-agent service payments
// Your orchestrator pays specialist agents
for (const task of completedTasks) {
const { secret, nonce } = await bs.commit(FLAT, task.bounty, task.agentAddress);
await notifyAgent(task.agentId, { secret, nonce });
}
3. Anonymous content tipping
// Tip a creator without linking your identity
const { secret, nonce } = await bs.commit(FLAT, '5.0', creatorAddress);
await postComment(articleId, `Tipped! Claim: flat.cash/bearer?s=${secret}&n=${nonce}`);
Why This Beats Alternatives
| Feature | BearerSwap | Direct Transfer | Tornado Cash | Payment APIs |
|---|---|---|---|---|
| Privacy | ✅ Full | ❌ Public | ✅ Full | ❌ KYC required |
| Agent-friendly | ✅ No KYC | ✅ | ❌ Sanctioned | ❌ Human verification |
| Cost | Free (gas only) | Gas only | High | Fees |
| Speed | 2-45 min | Instant | Hours | Instant |
| Permissionless | ✅ | ✅ | ❌ | ❌ |
Get Started
- Install:
npm install @flatcash/bearerswap ethers - Get FLAT tokens: flat.cash/buy-flat
- Read the docs: flat.cash/agents/docs
- Try the UI: flat.cash/bearer
Contract: 0x5de315Dab49012c5bbeC41d7a3B25c6829a3e566 (Ethereum Mainnet)
Built by the FLAT Protocol team. Zero fees. Zero KYC. Zero compromises on privacy.
If you're building agent loops that need financial primitives, check out the full MCP integration — your agent can earn, spend, and transact without ever needing a human.
Top comments (0)