# A2A Paymaster API

Welcome to the A2A Paymaster Service. This service provides gas sponsorship for AI Agents on Base L2.

## Endpoints

### 1. Register API Key
**POST** `/v1/register`

Generates a unique API Key for your DID. You must sign a timestamped message to prove ownership.

**Headers**:
- `Content-Type: application/json`

**Body**:
```json
{
  "did": "did:pkh:eip155:1:0xYourAddress",
  "signature": "0x...", 
  "timestamp": 1700000000000
}
```

**Signing Logic**:
1. Get current timestamp (ms).
2. Create message: `Register A2A Paymaster for ${did} at ${timestamp}`
3. Sign message with your wallet (EIP-191).

---

### 2. Sponsor Transaction (JSON-RPC)
**POST** `/v1/paymaster`

Standard ERC-7677 / Pimlico compatible Paymaster RPC.

**Headers**:
- `Content-Type: application/json`
- `x-api-key: YOUR_API_KEY`

**Body**:
```json
{
  "jsonrpc": "2.0",
  "method": "pm_sponsorUserOperation",
  "params": [ userOp, entryPoint ],
  "id": 1
}
```

---

## Contact
For support, contact the A2A Team.