# Solana Agent

> Paid AI agent for Solana blockchain analysis — query accounts, check balances, inspect blocks, look up transactions, and monitor validators across mainnet-beta, devnet, and testnet. Powered by solana CLI. Accepts USDC payment via x402 protocol.

## Skills

| Skill | Price | Description |
|-------|-------|-------------|
| Account Info | $0.001 | Look up any Solana account — balance, owner program, data size, and executable status across mainnet/devnet/testnet. |
| Transaction Lookup | $0.001 | Look up transaction history for a Solana address or confirm a transaction signature. |
| Block Inspect | $0.001 | Inspect a Solana block by slot number — transactions, rewards, and block metadata. |
| Network Status | $0.001 | Get Solana network status — current epoch info, total supply, and circulating supply. |
| Validator Info | $0.001 | Query Solana validators and stake accounts — active validators, stake delegation, and deactivation status. |

- **Account Info** (`account_info`, $0.001): Look up any Solana account — balance, owner program, data size, and executable status across mainnet/devnet/testnet.
  - Examples: "Show account info for So11111111111111111111111111111111111111112", "What's the balance of this address on devnet?"
- **Transaction Lookup** (`transaction_lookup`, $0.001): Look up transaction history for a Solana address or confirm a transaction signature.
  - Examples: "Show transaction history for this address", "Confirm transaction signature 5abc..."
- **Block Inspect** (`block_inspect`, $0.001): Inspect a Solana block by slot number — transactions, rewards, and block metadata.
  - Examples: "Show block at slot 250000000", "What's the current slot on devnet?"
- **Network Status** (`network_status`, $0.001): Get Solana network status — current epoch info, total supply, and circulating supply.
  - Examples: "What epoch are we in on mainnet?", "Show the total SOL supply"
- **Validator Info** (`validator_info`, $0.001): Query Solana validators and stake accounts — active validators, stake delegation, and deactivation status.
  - Examples: "List current validators on mainnet", "Show stake account details for this address"

## Payment

- Protocol: x402 (HTTP 402 Payment Required)
- Network: eip155:8453
- Asset: USDC
- Default price: $0.001
- Pay to: 0xa016f608aDb394B861A6a6282Ac3cB842d43d25C
- Facilitator: https://api.cdp.coinbase.com/platform/v2/x402

### Flow

1. POST / with A2A JSON-RPC task request
2. Receive HTTP 402 + `PAYMENT-REQUIRED` header with payment details
3. Sign USDC authorization (EIP-712) on eip155:8453
4. Retry the same request with `X-PAYMENT` header containing signed proof
5. Receive 200 response with task result

## Endpoints

| Method | Path | Paid | Description |
|--------|------|------|-------------|
| POST | / | Yes ($0.001) | A2A JSON-RPC task execution |
| GET | /.well-known/agent-card.json | No | A2A agent card |
| GET | /discovery | No | JSON service discovery |
| GET | /llms.txt | No | This document |
| GET | /health | No | Health check |

## Integration

```python
import httpx

resp = httpx.post("https://aliasai.io/solana/", json={
    "jsonrpc": "2.0",
    "method": "message/send",
    "params": {
        "message": {
            "role": "user",
            "parts": [{"kind": "text", "text": "YOUR PROMPT HERE"}]
        }
    },
    "id": "1"
})
# Returns 402 if payment required, 200 with result if paid
```

## Standards

- [A2A Protocol](https://a2a-protocol.org) — Agent-to-Agent communication
- [x402](https://x402.org) — HTTP-native payment protocol
- [ERC-8004](https://eips.ethereum.org/EIPS/eip-8004) — Trustless AI agent registry
- [llms.txt](https://llmstxt.org) — LLM-friendly documentation standard
