Autonomous payment infrastructure for the x402 economy
AuditAgent is the first production-ready implementation of autonomous agents on Solana that handle micropayments for premium APIs. Built on the HTTP 402 Payment Required standard with Visa TAP integration.
Traditional API monetization is broken:
- โ Complex subscription models
- โ High payment processing fees
- โ No micropayment support
- โ Lack of payment auditability
AuditAgent solves this with:
- โ Autonomous Payments - Agents pay for APIs without human intervention
- โ Micropayments - Pay only for what you use, starting at $0.01
- โ Cryptographic Proofs - Every payment is verified and auditable
- โ On-Chain Settlement - Instant, transparent transactions on Solana
- โ Developer-Friendly - Simple SDK, beautiful dashboard, comprehensive docs
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ Web UI โโโโโโโบโ AuditAgent โโโโโโโบโ Solana PDA โ
โ Dashboard โ โ Orchestrator โ โ Wallet โ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ
โโโโบ Premium x402 APIs
โโโโบ VisaTAP Module
โโโโบ On-chain Telemetry
- Solana Program (
solana-program/) - Rust program managing PDA wallet state - Web Dashboard (
web/) - Next.js UI with agent orchestration - SDK (
sdk/) - Reusable TypeScript client - Demo (
demo/) - Standalone CLI demo - Scripts (
scripts/) - Deployment and management tools
- Autonomous x402 payment handling
- PDA wallet with USDC support
- On-chain deposit tracking
- Dynamic priority fees
- Chained payment requests
- Visa TAP proof generation
- Authority-based access control
- Rent-exempt account management
- Cryptographic payment signatures
- Beautiful real-time dashboard
- Solana Explorer integration
- Payment history with TAP proofs
- Comprehensive TypeScript SDK
See SETUP.md for complete instructions.
# 1. Deploy Solana program
./scripts/deploy-program.sh
# 2. Configure environment
cp web/.env.example web/.env.local
# Edit web/.env.local with your program ID and authority secret
# 3. Initialize agent
cd scripts && npx ts-node initialize-agent.ts
# 4. Fund agent with devnet USDC
./scripts/fund-agent.sh
# 5. Run dashboard
cd web && npm run devVisit http://localhost:3000 and click "Trigger Agent" to see it in action!
AuditAgent/
โโโ solana-program/ # Rust on-chain program
โ โโโ src/lib.rs # PDA wallet logic
โ โโโ Cargo.toml
โโโ web/ # Next.js dashboard
โ โโโ src/
โ โ โโโ app/ # Pages and API routes
โ โ โโโ components/ # React components
โ โ โโโ lib/ # Agent orchestration
โ โโโ package.json
โโโ sdk/ # TypeScript SDK
โ โโโ src/index.ts # AuditAgentClient
โ โโโ package.json
โโโ demo/ # CLI demo
โ โโโ src/demo.ts
โโโ scripts/ # Deployment tools
โ โโโ deploy-program.sh
โ โโโ initialize-agent.ts
โ โโโ fund-agent.sh
โโโ docs/ # Documentation
โโโ TAP-architecture.md
-
Agent Initialization
- Deploy Solana program to devnet
- Create PDA wallet from seed
"aax4-agent" - Fund PDA with devnet USDC
-
Payment Flow
- Agent requests premium data
- Receives 402 Payment Required
- Automatically pays from PDA wallet
- Records transaction on-chain
- Generates TAP proof
- Receives premium data
-
Dashboard Updates
- Real-time balance monitoring
- Payment history with Explorer links
- TAP proof verification
- Transaction fee analytics
# Install dependencies
npm install
# Run tests
npm run test
# Format code
npm run format
# Lint
npm run lint
# Build all workspaces
npm run buildThe project includes comprehensive tests:
- Unit tests for core features (25+ tests)
- Integration with Vitest
- Test coverage for telemetry, TAP, instructions
Run tests:
npm run testSee TESTING.md for details.
import { AuditAgentClient } from '@auditagent/sdk';
const client = new AuditAgentClient({
programId: process.env.SOLANA_AGENT_PROGRAM_ID!,
authoritySecret: process.env.SOLANA_AGENT_AUTHORITY_SECRET!,
usdcMint: '4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU',
premiumApiBase: 'http://localhost:3000',
});
const result = await client.runAudit({
resourcePath: '/api/premium-data'
});
console.log('Transaction:', result.signature);
console.log('Data:', result.primary);
console.log('TAP Proof:', result.tapProof);// GET /api/premium-data
// Without payment โ 402 Payment Required
{
"x402Version": 1,
"resource": "http://localhost:3000/api/premium-data",
"accepts": [{
"method": "solana-pay",
"network": "devnet",
"asset": "USDC",
"amount": 1,
"payTo": "<agent-pda>"
}]
}
// With payment โ 200 OK
{
"data": { ... },
"nextResource": "/api/premium-insights", // optional chaining
"nextResourceLabel": "premium-x402-insights"
}Follow SETUP.md
-
Update environment to mainnet:
NEXT_PUBLIC_SOLANA_CLUSTER=mainnet-beta NEXT_PUBLIC_SOLANA_RPC_URL=https://api.mainnet-beta.solana.com NEXT_PUBLIC_SOLANA_USDC_MINT=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
-
Deploy program to mainnet:
solana config set --url mainnet-beta solana program deploy solana-program/target/deploy/solana_program.so -
Fund with real USDC
- Monetize any API with micropayments
- Pay-per-use model - no subscription complexity
- Instant settlement on Solana
- Built-in fraud prevention with cryptographic proofs
- Build autonomous agents that consume paid APIs
- No payment UI needed - agents handle everything
- Transparent costs - see exactly what you're paying
- Full audit trail - every payment is on-chain
- ๐ค AI agents consuming premium data feeds
- ๐ Real-time analytics and market data APIs
- ๐ Paywalled content and research
- ๐น Trading algorithms with paid signals
- ๐ฎ Game APIs with item/data access
See CHANGELOG.md for release history.
- Autonomous x402 payment handling
- Solana PDA wallet with USDC
- On-chain deposit tracking
- TAP proof generation
- Real-time dashboard & SDK
- Multi-asset support
- Withdrawal functionality
- Rate limiting and controls
- Production facilitator
- API provider dashboard
This is a hackathon project. Contributions welcome!
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
MIT License - see LICENSE for details
Built on proven, production-ready infrastructure:
- Solana - High-performance blockchain for instant settlement
- @faremeter/payment-solana - Battle-tested x402 payment library
- Visa TAP - Trusted Agent Protocol for payment identity
- Next.js - Modern React framework for the dashboard
- TypeScript - Type-safe development across the stack
- ๐ Documentation: See
/docsfor guides - ๐ฌ Discussions: GitHub Discussions
- ๐ Issues: Report bugs
- ๐ค Contributing: See CONTRIBUTING.md
Interested in production deployment or integration support?
Create an issue labeled enterprise or email the maintainers.
- Demo Video (coming soon)
- Documentation
- Setup Guide
- Testing Guide
- Solana Explorer (Devnet)
For questions or issues:
- Open an issue on GitHub
- Check SETUP.md for troubleshooting
- Review docs/TAP-architecture.md for technical details
Built with โค๏ธ for the Solana ecosystem