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