Nitro Routing
High-throughput execution mode. Batches cross-chain operations, bridges, and compute tasks into optimistic bundles — settled on-chain with a single proof. Sub-second agent operations on 0G without waiting for individual transaction finality.
What it is
Nitro is the priority execution lane in Opacus. When Nitro is enabled for an agent, its tasks are placed in a fast-path bundle queue that bypasses the standard per-transaction finality wait. Bundles are flushed on a configurable interval (default 2 seconds) and settled on-chain with a single ERC-7750 proof. Between flush cycles, operations are available immediately for dependent tasks — latency is close to off-chain, with on-chain guarantees on settlement. Nitro is especially effective when agents need to execute many small operations per second.
Who it's for
- High-frequency agents running MEV, arbitrage, oracle ingestion, or real-time data pipelines where per-transaction latency compounds into missed opportunities.
- Multi-step autonomous agents that execute bridge → compute → store sequences and need each step to feed into the next without waiting for L1 finality.
- Virtuals / GAME agents that process many sub-tasks per agent loop and cannot afford 30-second bridge wait times per cycle.
What you get
- Priority queue — Nitro tasks skip the standard execution queue
- Bundle batching — up to 10 operations per bundle (configurable)
- Single ERC-7750 settlement proof for the entire bundle
- Measurable latency reduction — typically 30–60% lower p95 for 0G writes under load
- Bundle monitoring via
GET /api/nitro/bundles - Gasless — Nitro bundles are still covered by the Citadel Facilitator
How to enable
Step-by-step (Agentboard)
- Upgrade plan: Agentboard → Billing → select Pro or Enterprise → confirm. Nitro is included in these plans at no extra per-agent charge.
- Open Capabilities: In the sidebar click Capabilities. If your plan is Pro/Enterprise you will see a green "Nitro & H3 included in your plan" banner at the top with an Activate Nitro now → button.
- Select your agent: Click Activate Nitro now → (or the Activate on an agent → button on the Nitro card). A modal opens with a dropdown — choose the agent you want (e.g. your Base MEV bot).
- Configure: After confirming, the routing config modal opens. Leave defaults for most bots:
- Routing Mode: Auto (recommended)
- Max Egress / Request: 256 KB
- Latency Budget: 500 ms
- Done. The agent card in the Agents list now shows an ⚡ Nitro badge. All future task executions for that agent use the priority queue.
Programmatic activation (REST API)
POST https://opacus.xyz/api/kinetic/agents/{agentId}/capabilities/nitro/enable
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"config": {
"routingMode": "auto", // auto | custom | regional
"maxEgressKb": 256,
"latencyBudgetMs": 500
}
}
Response: { "ok": true, "agentId": "...", "capability": "nitro", "enabled": true }
Self-hosted kernel: Add to agent-kernel/.env:
OPACUS_NITRO_ENABLED=true
OPACUS_NITRO_BATCH_SIZE=10 # max ops per bundle (default: 10)
OPACUS_NITRO_FLUSH_MS=2000 # flush interval in ms (default: 2000)
OPACUS_NITRO_SETTLE_CHAIN=0g # settlement chain: base | 0g
Then restart Agent Kernel and set nitro: true on any task call.
Pricing
Nitro is included in the Pro ($29.99/mo) and Enterprise plans. No separate per-agent subscription is needed when you are on these tiers.
| Plan | Nitro included? | Execution fee |
|---|---|---|
| Free | No | 1.00% |
| Starter | No | 0.75% |
| Pro | ✓ Yes | 0.50% |
| Enterprise | ✓ Yes | 0.30% |
Additional per-use bundle operation fees (on top of the plan’s execution fee):
| Operation inside bundle | Per-use fee |
|---|---|
| Kinetic task launch | 1% of budget |
| 0G compute job | 5% of budget |
| Bridge within bundle | 0.3% |
| Storage upload | 0.3% of file cost |
| On-chain settlement proof | Free (bundle subsidy) |
Operational notes
- Nitro does not change escrow release logic — proofs are still verified before funds move
- Bundle flush is time-based (
OPACUS_NITRO_FLUSH_MS) OR size-based (whichever triggers first) - If Nitro is disabled mid-session, in-flight bundles are settled before the agent reverts to standard mode
- Settlement failures cause the bundle to be resubmitted up to 3 times; after that, each op is retried individually
ERC7750_CONTRACTenv var must be set to the Nitro contract address on 0G
Examples
Launch a Nitro-accelerated task
import { createOpacusWorker } from 'opacus-kinetic-mcp';
const worker = createOpacusWorker({
apiKey: process.env.OPACUS_API_KEY,
kernelUrl: process.env.OPACUS_KERNEL_URL || 'http://localhost:3006',
});
const task = await worker.callTool('launch_secure_task', {
template: 'compute_0g',
prompt: 'Analyze USDC/ETH liquidity on 0G Jaine DEX',
budgetUsdc: 0.5,
nitro: true, // opt-in to Nitro batching
});
console.log('Task ID:', task.taskId);
console.log('Execution time:', task.execution_ms, 'ms');
Monitor Nitro bundles
# List recent bundles
curl -H "Authorization: Bearer YOUR_API_KEY" \
http://localhost:3006/api/nitro/bundles?limit=10
# Check a specific bundle
curl -H "Authorization: Bearer YOUR_API_KEY" \
http://localhost:3006/api/nitro/bundles/BUNDLE_ID
Architecture & User Flow
The diagram below shows how a user (or Virtuals agent) on any chain interacts with Opacus to reach the 0G network — fully gasless, with fees settled off-chain.
Gasless Transactions from Other Chains to 0G
Sending value or data to the 0G network from Base, Ethereum, or Solana normally requires the execution wallet to hold A0GI (0G's native gas token). Opacus removes this requirement entirely via the Citadel Facilitator and a two-step bridge-then-execute model.
How the flow works
- Fund once: Deposit USDC to your
executionWalletAddresson Base (or the 0G network directly). - Bridge call: Agent Kernel calls
executeRealBridge()using the MCPbridge_fundstool. USDC is moved Base → 0G via the native Opacus bridge relayer. - Gas sponsorship: Before any 0G transaction,
GasStationService.ensure0gGas(address)is automatically called. If A0GI balance is below threshold (0.001 A0GIdefault), the facilitator wallet tops up the execution wallet. - Execute on 0G: The actual operation — storage upload, compute job, swap on Jaine DEX — proceeds with gas already covered.
- Fee deducted off-chain: A 0.3% bridge fee + any operation fee is deducted from your Kinetic Ledger in USDC. No extra on-chain transaction.
Supported source chains
| Source chain | Asset | Bridge method | Typical time |
|---|---|---|---|
| Base | USDC | Native Opacus bridge relayer | ~30 seconds |
| Ethereum L1 | USDC | Via Base bridge → Opacus relay | ~5 minutes |
| Solana | USDC / SOL | Wormhole + Opacus relay | ~2 minutes |
| 0G Network | USDC | Direct (no bridge needed) | Instant |
MCP tool: bridge_funds
// From Claude / GPT-4o via Kinetic MCP
"Bridge 10 USDC from Base to 0G network"
// From TypeScript (createOpacusWorker)
await worker.callTool('bridge_funds', {
fromChain: 'base',
toChain: '0g',
amountUsdc: 10,
});
The MCP response includes txHash, bridgedAmountUsdc, platformFee, and destinationChain. The fee (0.3%) is deducted from the ledger — not from the bridged amount.
Verify the bridge completed
// Check pending bridges
"Check status of my pending bridge transactions"
// REST endpoint
GET /api/bridge/pending
Authorization: Bearer <apiKey>
bridge_funds once in the agent's onStart hook to pre-fund the 0G wallet before running tasks.0G Storage & Data Availability (DA)
0G provides two distinct data services used by Opacus agents: Storage for persistent file retrieval, and DA (Data Availability) for publishing verifiable data blobs that smart contracts and proofs can verify.
Storing files — upload_0g_file
Files are chunked, Merkle-hashed, and committed to 0G storage nodes. The returned rootHash is the permanent identifier.
// Via natural language
"Upload the file /tmp/agent-report.json to 0G decentralized storage"
// Via TypeScript SDK
import { createOpacusWorker } from 'opacus-kinetic-mcp';
const worker = createOpacusWorker({ apiKey: process.env.OPACUS_API_KEY });
const result = await worker.callTool('upload_0g_file', {
data: Buffer.from(JSON.stringify(reportData)).toString('base64'),
filename: 'agent-report.json',
});
// result.rootHash — save this!
console.log('Stored at:', result.rootHash);
Retrieving files — download_0g_file
// Via natural language
"Download the 0G file with root hash 0xabc123def456…"
// Via SDK
const file = await worker.callTool('download_0g_file', {
rootHash: '0xabc123def456…',
});
Verifying integrity — verify_0g_merkle
Any party can verify that a file stored on 0G is intact at any time — no trust required.
const check = await worker.callTool('verify_0g_merkle', {
rootHash: '0xabc123def456…',
});
// { valid: true, blockNumber: 1234567, confirmedAt: 1735000000 }
Data Availability (DA) blobs
0G DA is used when on-chain contracts need to verify that a data blob was published without storing the full data on L1. This is most useful for:
- ZK proof publishing — the proof blob is posted to 0G DA for verifiers to check
- Agent attestations — evidence of an operation (e.g., "bridge was completed") posted verifiably
- Checkpoint data for long-running compute jobs
// Post a DA blob (from agent task result)
const da = await worker.callTool('post_0g_da_blob', {
data: JSON.stringify({ taskId, result, timestamp: Date.now() }),
namespace: 'opacus-agent-v1',
});
// da.blobId — reference for smart contract or audit log
| Tool | Use case | Key output |
|---|---|---|
upload_0g_file | Persistent file storage | rootHash |
download_0g_file | Retrieve stored file | file data / path |
verify_0g_merkle | Integrity check | valid: bool |
post_0g_da_blob | Data availability publishing | blobId |
H3 Geospatial Agent Routing (ERC-7751)
H3 is Uber's open-source hexagonal hierarchical geospatial indexing system. The globe is divided into hexagonal cells at 16 resolution levels — from continental (level 0) down to building-scale (level 15). Opacus bakes H3 into its on-chain agent registry via ERC-7751, enabling agents to be discovered, routed, and paid based on geographic proximity — without revealing exact GPS coordinates.
H3 resolution levels
| Resolution | Cell area | Typical use case in Opacus |
|---|---|---|
| 0 | 4,357,449 km² | Continental broadcast routing |
| 3 | 12,393 km² | Country-level agent clusters |
| 5 | 252 km² | City-level Citadel zones |
| 8 ← default | 0.74 km² | Neighbourhood precision — Opacus default |
| 10 | 0.015 km² | Building-level IoT sensor anchoring |
| 12 | 0.00034 km² | Room-level micropayment granularity |
CitadelDID — your agent's on-chain geospatial identity
Every agent registered through Opacus gets a CitadelDID that encodes its geographic cell plus its execution wallet:
did:opacus:h3:{h3CellIndex}:{walletAddress}
// Example — agent in Istanbul, resolution 8
did:opacus:h3:88091dbdbffffff:0xDEAD…BEEF
This DID is stored on-chain in the ERC-7751 registry on 0G. Any agent query by capability or location resolves against these DIDs.
Register an agent by location
import { H3RoutingClient, latLngToH3Cell, citadelDID } from 'opacus-sdk/h3';
const h3 = new H3RoutingClient(signer, CONTRACT_ADDRESS);
// 1. Convert GPS → H3 cell (resolution 8, ~0.74 km²)
const h3Index = latLngToH3Cell(41.0082, 28.9784); // Istanbul
// → '88091dbdbffffff'
// 2. Build the CitadelDID
const did = citadelDID(h3Index, await signer.getAddress());
// → 'did:opacus:h3:88091dbdbffffff:0x…'
// 3. Register on ERC-7751 contract (0G Network)
await h3.register({
h3Index: ethers.id(h3Index),
quicEndpoint: 'quic://my-agent.example.com:4433',
capabilities: [ethers.id('GPT4'), ethers.id('storage')],
kineticScore: 7500,
bondAmount: ethers.parseEther('0.01'), // 1% → Opacus treasury
});
Discover nearby agents
// Find agents with GPT4 capability and Kinetic Score ≥ 7000
const agents = await h3.discover({
capability: ethers.id('GPT4'),
minScore: 7000,
limit: 20,
});
// Returns: [{ did, quicEndpoint, kineticScore, h3Index }, …]
// Utility: haversine distance between two GPS points
import { distKm } from 'opacus-sdk/h3-utils';
const km = distKm(41.01, 28.97, 40.71, -74.00);
// → ~8,736 km (Istanbul → New York)
IoT agent anchoring to H3
IoT devices running on 0G can anchor their data stream to a specific H3 cell. This ties sensor readings to a verifiable location on-chain — useful for environmental monitoring, logistics, or physical-world DeFi triggers.
import { buildIoTConfig } from 'opacus-sdk/h3-utils';
// Build an IoT agent config anchored to GPS coordinates
const iotConfig = buildIoTConfig(41.0082, 28.9784);
// → { latitude: 41.0082, longitude: 28.9784, h3Index: '88091dbdbffffff' }
// Launch an IoT agent via Agent Kernel
const task = await worker.callTool('launch_secure_task', {
template: 'iot_monitor',
prompt: 'Monitor temperature sensor at GPS 41.0082, 28.9784',
budgetUsdc: 0.10,
metadata: iotConfig,
});
Virtuals agents + H3 routing
A Virtuals GAME agent can query the H3 registry to route tasks to the nearest capable peer agent on 0G — enabling multi-agent collaboration with geographic context.
// AlphaScout discovers a nearby data-bridge agent on 0G
const peers = await opacus.callTool('discover_h3_agents', {
latitude: 40.7128,
longitude: -74.0060, // New York
capability: 'data-bridge',
minScore: 6000,
});
// Delegate a sub-task to the best peer
if (peers.length > 0) {
await opacus.callTool('pay_with_opacuspay', {
toAddress: peers[0].walletAddress,
amountUsdc: 0.05,
note: 'H3 routing sub-task fee',
});
}
H3 Beacon Globe
The Agentboard includes a live 3D globe visualisation of all registered H3 agents. Each glowing hex on the globe represents an active Opacus agent cell. The visualization uses resolution 5 cells (city-level) for rendering, regardless of the agent's actual registration resolution.
Opacus Nitro — Getting Started
Opacus Nitro is the high-throughput execution mode that batches cross-chain operations, bridges, and compute tasks into optimistic bundles — processed off the hot path and settled on-chain with a single proof. Nitro enables sub-second agent operations on 0G without waiting for individual transaction finality.
Prerequisites
- An Opacus account with a funded Kinetic Ledger (minimum 1 USDC recommended)
- Agent Kernel running (local or hosted via Render / Railway)
OPACUS_NITRO_ENABLED=truein your.env- A 0G execution wallet with A0GI for gas (or rely on the gasless facilitator)
Step 1 — Enable Nitro mode
Add the following to agent-kernel/.env:
OPACUS_NITRO_ENABLED=true
OPACUS_NITRO_BATCH_SIZE=10 # max ops per bundle (default: 10)
OPACUS_NITRO_FLUSH_MS=2000 # flush interval in ms (default: 2000)
OPACUS_NITRO_SETTLE_CHAIN=0g # settlement chain: base | 0g
OG_RPC_URL=https://evmrpc.0g.ai
OG_PRIVATE_KEY=<your-executor-key>
Step 2 — Install the SDK
npm install opacus-kinetic-mcp
Step 3 — Connect and run tasks
import { createOpacusWorker } from 'opacus-kinetic-mcp';
const worker = createOpacusWorker({
apiKey: process.env.OPACUS_API_KEY,
kernelUrl: process.env.OPACUS_KERNEL_URL || 'http://localhost:3006',
});
// Launch a Nitro-accelerated compute task on 0G
const task = await worker.callTool('launch_secure_task', {
template: 'compute_0g',
prompt: 'Analyze on-chain liquidity for USDC/ETH pair on 0G Jaine DEX',
budgetUsdc: 0.5,
nitro: true, // opt-in to Nitro batching
});
console.log('Task ID:', task.taskId);
console.log('Status:', task.status);
console.log('Platform fee:', task.platformFee);
Step 4 — Monitor Nitro bundles
// REST — list recent Nitro bundles
GET /api/nitro/bundles?limit=10
Authorization: Bearer <apiKey>
// Check bundle settlement status
GET /api/nitro/bundles/:bundleId
Nitro fee model
| Operation inside bundle | Fee | Notes |
|---|---|---|
| Kinetic task launch | 1% of budget | Charged when task is settled |
| 0G compute job | 5% of budget | Charged on attestation verified |
| Bridge within bundle | 0.3% | Charged on destination confirmation |
| Storage upload | 0.3% of file cost | Based on 0G cost estimate |
| On-chain settlement proof | Free | Covered by Nitro batch subsidy |
Virtuals Agent Integration
Virtuals Protocol agents are autonomous AI characters with on-chain identity and wallets. By connecting them to Opacus via the createOpacusWorker() factory, a Virtuals agent instantly gains cross-chain payment, 0G storage, and compute capabilities.
Install the worker
npm install opacus-kinetic-mcp
Connect a Virtuals agent to Opacus
import { createOpacusWorker } from 'opacus-kinetic-mcp';
import { GameAgent } from '@virtuals-protocol/game';
// 1. Create the Opacus worker (one instance per agent)
const opacus = createOpacusWorker({
apiKey: process.env.OPACUS_API_KEY,
kernelUrl: process.env.OPACUS_KERNEL_URL,
});
// 2. Wire Opacus tools into the GAME agent's action space
const agent = new GameAgent(process.env.VIRTUALS_GAME_API_KEY, {
name: 'AlphaScout',
goal: 'Monitor 0G on-chain activity and store daily reports',
description: 'An agent that analyzes DeFi data and archives findings to 0G storage',
// Expose Opacus capabilities as GAME custom functions
getAgentState: async () => ({
ledgerBalance: await opacus.callTool('get_kinetic_balance', {}),
}),
});
// 3. Define GAME custom function — bridge + store
async function bridgeAndStore(args: { amount: number; reportData: object }) {
// Bridge funds to 0G if needed
if (args.amount > 0) {
await opacus.callTool('bridge_funds', {
fromChain: 'base', toChain: '0g', amountUsdc: args.amount,
});
}
// Upload report to 0G decentralized storage
const stored = await opacus.callTool('upload_0g_file', {
data: Buffer.from(JSON.stringify(args.reportData)).toString('base64'),
filename: `report-${Date.now()}.json`,
});
return { rootHash: stored.rootHash };
}
agent.setCustomActions([bridgeAndStore]);
What Virtuals agents can do via Opacus
| Capability | MCP tool | Description |
|---|---|---|
| Cross-chain bridge | bridge_funds | Move USDC from Base to 0G, gasless |
| DEX swap | swap_tokens | Swap on Aerodrome (Base) or Jaine (0G) |
| Pay AI API | pay_api_with_opacuspay | Pay OpenAI / Anthropic / Google from ledger |
| Store on 0G | upload_0g_file | Archive agent memories or reports |
| Run 0G compute | launch_0g_compute_task | Offload inference to decentralized GPU |
| Escrow payments | lock_escrow | Pay counterparties with automatic release |
| P2P transfer | pay_with_opacuspay | Send USDC to any wallet, gasless |
| Kinetic task | launch_secure_task | Launch template-based agent tasks |
Virtuals + 0G Storage pattern: agent memory archive
A common pattern for long-running Virtuals agents is to periodically serialize their in-memory state to 0G Storage as a tamper-evident archive, then verify it can be restored correctly.
// Save agent memory to 0G every 10 minutes
setInterval(async () => {
const memory = agent.exportMemory(); // Virtuals GAME API
const { rootHash } = await opacus.callTool('upload_0g_file', {
data: Buffer.from(JSON.stringify(memory)).toString('base64'),
filename: `memory-${Date.now()}.json`,
});
await agent.updateState({ lastMemoryRootHash: rootHash });
console.log('[AlphaScout] Memory archived:', rootHash);
}, 10 * 60 * 1000);
Virtuals + 0G Compute: decentralized inference
Route inference tasks to 0G GPU nodes instead of centralized APIs. Useful when agents need censorship-resistant or privacy-preserving AI reasoning.
// Agent decision using 0G decentralized inference
const decision = await opacus.callTool('launch_0g_compute_task', {
prompt: `You are AlphaScout. Given liquidity: ${JSON.stringify(liquidityData)}, should I rebalance? Respond with YES or NO and reasoning.`,
budgetUsdc: 0.10,
model: 'deepseek',
});
console.log('0G compute decision:', decision.computeJob.output.summary);
OPACUS_API_KEY in the GAME agent's secure environment — never hardcoded. Use process.env.OPACUS_API_KEY or the Virtuals Platform's secrets manager.Required environment variables
| Variable | Used for | Required |
|---|---|---|
OG_RPC_URL | 0G chain RPC (bridge, swap, compute, storage) | Yes |
OG_PRIVATE_KEY | Execution wallet on 0G for signing transactions | Yes |
OG_STORAGE_INDEXER | 0G storage indexer URL | Yes (for storage/DA) |
OG_PROVIDER_ADDRESS | 0G compute provider wallet | Yes (for compute) |
OG_INFERENCE_TOKEN | 0G Labs inference API token (alternative to provider) | Optional |
OPACUS_FACILITATOR_OG_KEY | Gasless facilitator wallet on 0G (holds A0GI) | Yes (for gasless) |
OPACUS_NITRO_ENABLED | Enable Nitro batch execution mode | Optional (default: false) |
OPACUS_NITRO_BATCH_SIZE | Max operations per Nitro bundle | Optional (default: 10) |
OPACUS_NITRO_FLUSH_MS | Bundle flush interval (milliseconds) | Optional (default: 2000) |
OPACUS_FEE_ENABLED | Enable platform fees on all operations | Optional (default: false) |
ERC7751_CONTRACT | H3 routing registry contract address on 0G | Yes (for H3 routing) |
ERC7750_CONTRACT | Opacus Nitro contract address on 0G | Yes (for on-chain Nitro) |