BlockWire Documentation
Real-time blockchain event infrastructure for autonomous AI agents. This documentation covers everything you need to integrate BlockWire into your agent systems.
What is BlockWire?
BlockWire is shared polling infrastructure for autonomous AI agents operating on Base L2. Instead of each agent independently polling BaseScan, DEX routers, and price feeds, BlockWire provides a single source of truth with cryptographic attestations.
The Problem
Autonomous agents need real-time blockchain data. Today, that means each agent runs its own polling loop — duplicating compute, wasting API credits, and creating inconsistent views of chain state across agent swarms.
The Solution
BlockWire polls the chain once and broadcasts to thousands. Subscriptions live on-chain (not in our database), events are cryptographically attested, and payments flow through native x402 HTTP rails.
Key Features
| Feature | Description |
|---|---|
| Push Mode | Subscribe on-chain, receive HMAC-signed webhooks every minute |
| Pull Mode | Query events via x402 micropayments — no API key needed |
| Attestations | Every batch is anchored on-chain for verifiable audit trails |
| Event Types | Contracts, liquidity, prices, transfers, NFTs — mix and match |
| ETHYS Integration | Subscription history feeds into agent reputation scores |
Available Services
BlockWire provides three categories of services for AI agents. All services are accessible via REST API, webhooks, or on-chain subscriptions.
1. Event Monitoring Services
Real-time monitoring of Base L2 blockchain events. Subscribe to any combination of event types using bitmasks or event type arrays.
- New Contracts — Track new contract deployments on Base
- Liquidity Events — Monitor DEX pool additions and removals
- Price Movements — Significant token price changes
- Large Transfers — High-value token movements
- NFT Mints — New NFT collection launches
2. Data Access Services
Multiple ways to access blockchain event data. Choose push or pull based on your needs.
- Webhook Push — Real-time delivery to your endpoint (subscription-based, on-chain)
- Feed API — Pull recent events via
GET /api/feed($0.002 per request, x402 payment) - Replay API — Historical events with attestation proofs via
GET /api/replay($0.005 per request, x402 payment) - Status API — System health and metrics via
GET /api/status(free) - Subscribe API — On-chain subscription management via
GET /api/subscribeandPOST /api/subscribe
3. Verification Services
Cryptographic verification of all event data. Prove authenticity and integrity on-chain.
- On-Chain Attestations — Every event batch cryptographically anchored to Base
- Hash Chain Verification — Verify batch integrity via
GET /api/attestations/verify(free) - Attestation History — Query all attestations via
GET /api/attestations(free) - HMAC Webhook Signatures — Verify webhook authenticity with
X-BlockWire-Signatureheader
Agents can discover all available services via: AI Plugin manifest, OpenAPI specification, or machine-readable format.
Event Types
BlockWire monitors Base L2 for five categories of events. Subscribe to any combination using a bitmask:
| Type | Bit Value | What It Captures |
|---|---|---|
contracts |
1 | New contract deployments via create/create2 |
liquidity |
2 | Pool creation, liquidity add/remove on DEXs |
prices |
4 | Price movements exceeding 5% threshold |
transfers |
8 | USDC transfers exceeding $10,000 |
nfts |
16 | ERC-721 and ERC-1155 mint events |
Use bitwise OR to combine types: contracts | liquidity = 3
subscribes to both contract deployments and liquidity events.
Quick Example
Here's a minimal example subscribing to BlockWire:
import { BlockWireClient } from '@echorift/blockwire';
import { ethers } from 'ethers';
// Your agent's wallet
const wallet = new ethers.Wallet(process.env.AGENT_KEY);
// Initialize client
const blockwire = new BlockWireClient({
chain: 'base',
signer: wallet,
});
// Subscribe for 24 hours
const tx = await blockwire.subscribe({
webhookUrl: 'https://my-agent.com/blockwire',
eventTypes: ['contracts', 'liquidity'],
hours: 24,
});
console.log('Subscribed!', tx.hash);
Your webhook endpoint must respond within 5 seconds. Slow endpoints won't receive retries — use attestations for replay if needed.
Supported DEXs
BlockWire monitors liquidity events from these Base DEXs:
- Uniswap V2 — All fork factories
- Uniswap V3 — Concentrated liquidity pools
- Aerodrome — ve(3,3) pools
- BaseSwap — Coming soon
Next Steps
Ready to integrate? Start with the Quickstart guide or dive into the SDK documentation.