What is A2A?
A2A (Agent-to-Agent) is a JSON-RPC 2.0 based protocol that enables AI agents to discover and communicate with each other. Snack Money implements A2A with the X402 extension, combining agent discovery with cryptocurrency payments.Key Features
- Agent Discovery - Automatic service discovery via agent cards
- JSON-RPC 2.0 - Standard protocol for agent communication
- X402 Extension - Integrated crypto payment capabilities
- Multi-Network - Support for both Base and Solana networks
- Task-Based Flow - Asynchronous payment processing
- 6 Payment Platforms - Twitter, Farcaster, GitHub, Email, Web, Instagram
How A2A Works with Snack Money
1. Discovery Phase
Agents discover Snack Money’s capabilities through the agent card:- Available payment skills (e.g.,
snack-money.pay.twitter) - Required parameters and schemas
- Supported X402 extension
2. Payment Request
Agents send JSON-RPC requests to initiate payments:3. Payment Requirements
Snack Money responds with payment requirements:4. On-Chain Payment
The agent executes the USDC transfer on the specified network (Base or Solana).5. Payment Proof Submission
After blockchain confirmation, the agent resubmits with proof:6. Completion
Snack Money verifies the payment and returns success:Available Skills
Snack Money exposes the following A2A skills:Single Payments
snack-money.pay.twitter- Send to Twitter/X userssnack-money.pay.farcaster- Send to Farcaster userssnack-money.pay.github- Send to GitHub userssnack-money.pay.email- Send to email addressessnack-money.pay.web- Send to web domainssnack-money.pay.instagram- Send to Instagram users
Batch Payments
snack-money.batch-pay.twitter- Batch payments to Twitter userssnack-money.batch-pay.farcaster- Batch payments to Farcaster userssnack-money.batch-pay.github- Batch payments to GitHub userssnack-money.batch-pay.email- Batch payments to email addressessnack-money.batch-pay.web- Batch payments to web domainssnack-money.batch-pay.instagram- Batch payments to Instagram users
Required Headers
When making A2A requests, include:Network Support
Base (EVM)
- Network ID:
eip155:8453 - Token: USDC (
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913) - Use EVM private key for signing
Solana (SVM)
- Network ID:
solana:mainnet - Token: USDC SPL token
- Use Solana private key for signing
Integration Example
For complete working examples, see the A2A Examples page or check out the snack-money-examples/a2a repository.Why A2A + X402?
The combination of A2A and X402 protocols provides:- Agent Interoperability - Agents can discover and use services automatically
- Payment Integration - Native crypto payments without manual setup
- Standardized Communication - JSON-RPC 2.0 ensures compatibility
- Decentralized - No central authority or intermediary required
- Multi-Chain - Support for different blockchain networks
Learn More
- A2A Protocol Specification
- X402 Protocol - Payment protocol details
- A2A Examples - Implementation examples
- Agent Card API - Live agent card