BlockWire: Shared Eyes on the Chain
Real-Time Blockchain Event Infrastructure for Autonomous Agents
The Redundancy Problem
Every autonomous agent that operates on-chain needs blockchain data. New contracts. Liquidity movements. Price changes. Transfer events.
Today, each agent polls independently. If you have 1,000 agents monitoring Base L2, you have 1,000 polling loops hitting the same RPC endpoints, parsing the same blocks, extracting the same events.
This is wildly inefficient:
- Wasted compute: The same work done thousands of times
- Wasted credits: RPC rate limits and costs multiply
- Inconsistent views: Different agents see different states depending on when they poll
- Fragile architecture: Each agent is a single point of failure for its own data pipeline
The fix isn't better caching or smarter polling. The fix is shared infrastructure.
What BlockWire Does
BlockWire polls the chain once and broadcasts to thousands.
Traditional Approach BlockWire Approach
5 polling loops 1 polling loop
5x RPC costs Shared cost
5 inconsistent views Single source of truth
Core Services
Event Monitoring
- New contract deployments on Base
- Liquidity additions and removals on DEXs
- Significant price movements (>5% threshold)
- Large token transfers (>$10,000 USDC equivalent)
- NFT mint events
Data Access
- Push Mode: Subscribe on-chain, receive HMAC-signed webhooks
- Pull Mode: Query via x402 micropayments, no subscription needed
Verification
- Every event batch is cryptographically attested on-chain
- Hash chain enables verification of any historical batch
- Agents can prove they acted on legitimate data
Why On-Chain Subscriptions Matter
Your BlockWire subscription doesn't live in our database. It lives on Base L2.
solidity
// BlockWire Registry Contract
struct Subscription {
address subscriber;
string webhookUrl;
uint8 eventMask; // Bitmask of event types
uint256 expiresAt;
bytes32 webhookSecret;
}
This matters because:
- Verifiable: Anyone can check if an agent is subscribed
- Composable: Other contracts can read subscription state
- Trustless: We can't fake or backdate subscriptions
- Portable: Your subscription survives if we disappear
The subscription is yours. It's on-chain. We just service it.
Attestation Architecture
Every minute, BlockWire:
- Polls Base L2 for relevant events
- Batches events by type and block range
- Computes a Merkle root of the batch
- Attests the root on-chain
- Delivers events to subscribers with the attestation reference
Block 12345678 On-Chain
Hash Chain Integrity
Each attestation references the previous one, forming an immutable chain:
Attestation N-1 Attestation N Attestation N+1
This means:
- You can verify any attestation's place in history
- Tampering with old attestations would break the chain
- Disputes can reference specific attestation IDs
Event Types
Contract Deployments (new_contract)
Triggered when new contracts are deployed via CREATE or CREATE2.
json
{
"type": "new_contract",
"address": "0x1234567890abcdef1234567890abcdef12345678",
"block": 12345680,
"txHash": "0xdeadbeef...",
"timestamp": 1701499800,
"data": {
"deployer": "0x5678...",
"bytecodeHash": "0x9abc..."
}
}
Use cases:
- Track new token launches
- Monitor protocol deployments
- Detect contract clones
Liquidity Events (liquidity_added, liquidity_removed)
Triggered when liquidity is added or removed from monitored DEXs.
json
{
"type": "liquidity_added",
"pool": "0xpool...",
"block": 12345681,
"txHash": "0x...",
"data": {
"token0": "0x...",
"token1": "0x...",
"amount0": "1000000000000000000",
"amount1": "500000000",
"provider": "0x..."
}
}
Supported DEXs:
- Uniswap V2 (all forks)
- Uniswap V3
- Aerodrome
- BaseSwap (coming soon)
Use cases:
- Track new pool creation
- Monitor liquidity depth changes
- Detect rug pulls (liquidity removal)
Price Movements (price_movement)
Triggered when token prices move more than 5% within a polling interval.
json
{
"type": "price_movement",
"token": "0x...",
"block": 12345682,
"data": {
"previousPrice": "1.0",
"currentPrice": "1.08",
"changePercent": 8.0,
"pool": "0x..."
}
}
Use cases:
- Trading signals
- Arbitrage detection
- Portfolio rebalancing triggers
Large Transfers (large_transfer)
Triggered when USDC transfers exceed $10,000.
json
{
"type": "large_transfer",
"token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"block": 12345683,
"data": {
"from": "0x...",
"to": "0x...",
"amount": "50000000000",
"usdValue": 50000
}
}
Use cases:
- Whale watching
- Exchange flow tracking
- Risk monitoring
NFT Mints (nft_mint)
Triggered when ERC-721 or ERC-1155 tokens are minted.
json
{
"type": "nft_mint",
"collection": "0x...",
"block": 12345684,
"data": {
"tokenId": "1234",
"minter": "0x...",
"standard": "ERC-721"
}
}
Use cases:
- New collection tracking
- Mint activity monitoring
- Creator attribution
Integration Modes
Push Mode (Subscriptions)
Best for: Agents that need real-time data with guaranteed delivery
typescript
import { BlockWireClient } from '@echorift/blockwire';
const client = new BlockWireClient({
chain: 'base',
signer: agentWallet,
});
// Subscribe for 24 hours
const tx = await client.subscribe({
webhookUrl: 'https://my-agent.com/events',
eventTypes: ['contracts', 'liquidity'],
hours: 24,
});
// Subscription is now on-chain
console.log('Subscription TX:', tx.hash);
console.log('Expires:', tx.expiresAt);
Webhook Payload:
json
{
"batch_id": "batch_12345678_12345700_a1b2c3d4",
"timestamp": 1701500000,
"block_range": {
"start": 12345678,
"end": 12345700
},
"events": [...],
"attestation_pending": true
}
Webhook Headers:
X-BlockWire-Signature:
X-BlockWire-Timestamp:
X-BlockWire-Batch-Id:
Pull Mode (x402)
Best for: Occasional queries without subscription overhead
typescript
// Query recent events with x402 payment
const events = await client.pull({
types: ['contracts', 'liquidity'],
since: Date.now() - 3600000, // Last hour
});
// Payment happens automatically via x402
// $0.002 per request
API Endpoint:
GET /api/feed?types=contracts,liquidity&since=1701496400
x402 Flow:
- Request without payment →
402 Payment Required - Sign USDC payment on Base
- Retry with payment proof
- Receive event data
Webhook Verification
Every webhook is HMAC-signed. Verify before processing:
typescript
import { verifyWebhook } from '@echorift/blockwire';
app.post('/events', (req, res) => {
const isValid = verifyWebhook({
payload: JSON.stringify(req.body),
signature: req.headers['x-blockwire-signature'],
timestamp: req.headers['x-blockwire-timestamp'],
secret: process.env.WEBHOOK_SECRET,
});
if (!isValid) {
return res.status(401).send('Invalid signature');
}
// Process events...
res.status(200).send('OK');
});
Important: Webhooks must respond within 5 seconds. Failed deliveries are not retried. Use the replay API to recover missed events.
Attestation Verification
Verify any event batch against on-chain attestations:
typescript
// Get attestation for a batch
const attestation = await client.getAttestation(batchId);
// Verify on-chain
const isValid = await client.verifyAttestation({
batchId,
batchHash: attestation.hash,
blockRange: attestation.blockRange,
});
// attestation.txHash is the on-chain proof
Use cases:
- Dispute resolution ("I acted on this data")
- Audit trails ("Here's the chain of custody")
- Reputation building ("My agent acts on verified data")
Pricing
Push Mode (Subscriptions)
Pull Mode (x402)
/api/feed/api/replay/api/attestations/api/statusFree Tier
No payment required for:
- Attestation queries
- System status
- Documentation access
Contract Reference
BlockWire Registry (Base Mainnet)
Address: 0x20Fa63E8A50C3F990c67EF7df6e0D10a7005686a
Key Functions:
solidity
// Subscribe to events
function subscribe(
string calldata webhookUrl,
uint8 eventMask,
uint256 hours
) external payable returns (uint256 subscriptionId);
// Check subscription status
function isActive(address subscriber) external view returns (bool);
// Get subscription details
function getSubscription(address subscriber)
external view returns (Subscription memory);
Events:
solidity
event Subscribed(address indexed subscriber, uint256 expiresAt);
event Renewed(address indexed subscriber, uint256 newExpiry);
event Unsubscribed(address indexed subscriber);
event BatchAttested(bytes32 indexed batchHash, uint256 blockStart, uint256 blockEnd);
Best Practices
Webhook Endpoint Design
- Respond fast: Acknowledge within 5 seconds, process asynchronously
- Verify always: Check HMAC signature before processing
- Idempotent handling: Same batch may arrive twice (use batch_id)
- Error handling: Log failures, use replay API to recover
Subscription Management
- Renew early: Don't let subscriptions lapse
- Monitor expiry: Set up alerts before expiration
- Right-size duration: Longer subscriptions are cheaper per hour
Event Processing
- Filter first: Only process event types you need
- Batch operations: Don't make DB calls per event
- Track attestations: Store attestation IDs for audit trails
SDK Reference
Installation
bash
npm install @echorift/blockwire ethers
Client Initialization
typescript
import { BlockWireClient } from '@echorift/blockwire';
import { ethers } from 'ethers';
const client = new BlockWireClient({
chain: 'base', // or 'base-sepolia' for testnet
signer: wallet, // ethers Signer
rpcUrl: 'https://mainnet.base.org', // optional custom RPC
});
Full API
typescript
// Subscriptions
await client.subscribe({ webhookUrl, eventTypes, hours });
await client.getSubscription();
await client.renew(additionalHours);
await client.unsubscribe();
// Pull mode
await client.pull({ types, since, until });
await client.replay({ batchId });
// Attestations
await client.getAttestation(batchId);
await client.verifyAttestation({ batchId, batchHash });
await client.getAttestationHistory({ limit, offset });
// Utilities
verifyWebhook({ payload, signature, timestamp, secret });
Related Resources
- Documentation: blockwire.echorift.xyz/docs
- API Spec: blockwire.echorift.xyz/.well-known/openapi.json
- AI Docs: blockwire.echorift.xyz/llms.txt
- GitHub: github.com/echorift/blockwire
- Contract: basescan.org/address/0x20Fa63E8A50C3F990c67EF7df6e0D10a7005686a
*BlockWire. Shared eyes on the chain.*