Zero Network Documentation
Technical reference for the Zero micropayment blockchain -- purpose-built for AI agents, machines, and the protocols that connect them.
Zero is a high-throughput, low-fee blockchain designed for machine-to-machine micropayments. It processes sub-cent transactions at massive scale, letting AI agents pay for APIs, tools, data feeds, and compute -- autonomously, in real time.
Every transaction on Zero costs a flat 0.01 Z ($0.0001 USD). The token is backed 1:1 by stablecoins locked in auditable bridge vault contracts. There is no speculative float, no inflationary emission schedule, no governance token. Zero exists to move money -- small amounts, very fast, between machines.
The network is implemented in Rust from scratch (not a fork), using a block-lattice account model inspired by Nano, with a leaderless DAG-based asynchronous BFT consensus layer inspired by Mysticeti and Lachesis. The result is a system that achieves deterministic finality in milliseconds, stores only the latest state (not unbounded history), and fits a complete transaction into 136 bytes.
Why Zero Exists
Existing payment rails fail the machine economy in several ways:
- Credit cards have minimum charges, require human identity, and take days to settle.
- Ethereum and L2s are too expensive for sub-cent payments. Even at $0.001 per transaction, the gas cost exceeds the payment amount for a 1-cent API call.
- Solana and fast L1s have variable fees and are optimized for DeFi, not for deterministic micropayment workloads.
- Lightning Network requires channel management and online receivers -- impractical for ephemeral AI agents.
- Stablecoins on L2s still require bridging, nonce management, and fee estimation that adds complexity for automated systems.
Zero solves this by being radically simple. One token, one fee, one purpose. A 136-byte transaction, a 48-byte account. No smart contracts, no virtual machine, no ERC-20 token standards. Just value transfer, as fast as the network can gossip it.
Design Principles
- Machine-first. The protocol is designed for agents and programs, not human wallet UIs. SDK ergonomics prioritize programmatic access.
- Deterministic cost. Every transaction costs exactly 0.01 Z. No gas auctions, no priority fees, no MEV.
- Stable value. 1 Z = 1 penny. The token is a unit of account, not a speculative asset.
- Minimal state. Account state is 48 bytes. Transaction records are pruned via ring buffer. Validator storage is bounded forever.
- No smart contracts. Zero does one thing: transfer value. This constraint enables extreme optimization.
- Stablecoin-backed. Every Z in circulation has a corresponding cent of USDC or USDT locked in an on-chain vault.
The Z Token
Z is the sole token on the Zero network. It is a value-transfer token with no governance utility, no staking reward emission, and no speculative mechanics.
| Property | Value |
|---|---|
| Symbol | Z |
| Peg | 1 Z = $0.01 USD (1 penny) |
| Decimal places | 2 |
| Smallest unit | 0.01 Z = $0.0001 |
| Min transaction | 0.01 Z + 0.01 Z fee = 0.02 Z ($0.0002) |
| Max transaction | 25 Z ($0.25) |
| Transfer fee | 0.01 Z (flat, added to amount) |
| Bridge-out fee | 0.5 Z ($0.005, covers EVM gas) |
| Backing | 1:1 USDC/USDT in bridge vaults |
| Bridge rate | 1 USDC = 100 Z |
Machines think in integers. By making the base unit a penny and using only 2 decimal places, all arithmetic is exact u32 integer math. No floating point, no rounding errors, no wei/gwei/ether unit confusion. amount: 10 means 10 Z means $0.10. Always.
Bridge Flow
Z tokens are minted and burned through the bridge vault system. There is no other way to create or destroy Z.
Minting (Deposit)
- User deposits USDC or USDT to the vault contract on a supported chain (Base or Arbitrum).
- Trinity Validators observe and attest to the deposit (2/3+ threshold).
- Once attested, the equivalent Z is minted to the user's Zero account.
- Conversion:
1 USDC = 100 Z.
Burning (Withdrawal)
- User initiates a BridgeOut transaction on Zero, specifying destination chain, token (USDC/USDT), and destination address.
- The Z is burned on the Zero network, plus a 0.5 Z bridge fee to cover EVM gas costs.
- Trinity Validators sign an EIP-712 release digest (2-of-3 ECDSA threshold).
- Once threshold is met, the vault contract releases the equivalent stablecoin to the destination address.
Stablecoin Backing
The fundamental invariant of the Zero network:
This invariant is enforced at the protocol level. Z cannot be minted without a corresponding stablecoin deposit, and stablecoins cannot be released without a corresponding Z burn. Validators enforce this invariant as part of consensus -- any block that violates it is rejected.
Supported backing assets:
- USDC (Circle) -- primary backing asset on Base, also accepted on Arbitrum
- USDT (Tether) -- primary backing asset on Arbitrum
The vault contracts are controlled by a ZeroTimelock contract (24-hour delay, 14-day grace period) that holds the sole admin role. All privileged operations -- guardian rotation, parameter changes, emergency pause -- go through the timelock with 2-of-3 guardian threshold. The deployer has renounced all direct admin access.
Block-Lattice Account Model
Zero uses a block-lattice architecture, where each account maintains its own chain of transactions. This design, inspired by Nano, enables several key properties:
- Parallelism. Transactions on different accounts are independent and can be processed concurrently without coordination.
- Minimal contention. There is no global transaction ordering bottleneck. Each account's nonce provides local ordering.
- Compact state. Only the latest account state (balance, nonce, head hash) needs to be stored -- not the full history.
Each account is identified by an Ed25519 public key (32 bytes). The account's "chain" is a sequence of transfers, each linked to the previous by the head hash (a BLAKE3 digest of the previous transfer).
While inspired by Nano's lattice structure, Zero diverges significantly in consensus (leaderless DAG aBFT vs. Open Representative Voting), pruning (ring buffer vs. optional), and scope (micropayments-only vs. general value transfer). Zero is a ground-up Rust implementation, not a Nano fork.
Transaction Format
Every Zero transaction is exactly 136 bytes on the wire. No variable-length fields, no optional extensions, no metadata. This fixed size enables aggressive optimization in serialization and networking.
struct ZeroTransfer {
from: [32 bytes] // Ed25519 public key
to: [32 bytes] // Ed25519 public key
amount: [4 bytes] // u32, penny units
nonce: [4 bytes] // u32, monotonic counter
signature: [64 bytes] // Ed25519 full signature
}
| Field | Size | Description |
|---|---|---|
from | 32 bytes | Sender's Ed25519 public key. Serves as the account identifier. |
to | 32 bytes | Recipient's Ed25519 public key. |
amount | 4 bytes | Transfer amount in penny units (u32). Max value: 2500 (25 Z). |
nonce | 4 bytes | Monotonically increasing counter. Prevents replay attacks. |
signature | 64 bytes | Full Ed25519 signature over the 72-byte unsigned payload. |
Every transaction is exactly 136 bytes -- a 72-byte unsigned payload (from + to + amount + nonce) plus a 64-byte Ed25519 signature. No variable-length encoding, no headers, no padding. This enables zero-copy deserialization and predictable memory allocation.
Account State
Each account on Zero is represented by exactly 48 bytes of state:
struct Account {
balance: [4 bytes] // u32
nonce: [4 bytes] // u32
head: [32 bytes] // BLAKE3 hash
flags: [8 bytes] // reserved
}
| Field | Size | Description |
|---|---|---|
balance | 4 bytes | Current balance in penny units (u32). Max: ~42,949 Z ($429.49). |
nonce | 4 bytes | Next expected nonce. Incremented on each outgoing transfer. |
head | 32 bytes | BLAKE3 hash of the most recent transfer involving this account. Links the account chain. |
flags | 8 bytes | Reserved for future use (frozen status, account type, etc.). |
With 48 bytes per account, one billion accounts require approximately 48 GB of state. Combined with the transaction ring buffer, total validator storage remains bounded at 50-110 GB regardless of network age.
Consensus: Leaderless DAG aBFT
Zero uses a leaderless DAG-based asynchronous Byzantine Fault Tolerant consensus protocol, drawing from the designs of Mysticeti and Lachesis.
Key Properties
- Leaderless. No single validator is responsible for block production. All validators propose transaction batches concurrently.
- DAG structure. Validator proposals form a directed acyclic graph, where each proposal references multiple previous proposals.
- Asynchronous BFT. Consensus is reached without timing assumptions. The protocol is safe under arbitrary network delays and tolerates up to 1/3 Byzantine validators.
- Deterministic finality. Once a transaction is included in a committed DAG vertex, it is final. No probabilistic confirmation, no chain reorganizations.
Throughput
| Phase | Configuration | Target TPS |
|---|---|---|
| Phase 1 | Single shard | 100,000+ |
| Phase 2 | Multi-shard | 1,000,000+ |
| Phase 3 | Global sharding | 10,000,000+ |
Storage & Pruning
Zero uses a ring buffer for transaction storage. Instead of growing unboundedly like traditional blockchains, the transfer log overwrites the oldest entries once the buffer is full.
Why This Works
Zero is a payment network, not a smart contract platform. The only state that matters is each account's current balance, nonce, and head hash (48 bytes). Historical transactions are useful for auditing and debugging, but they are not required for consensus or state validation.
Storage Budget
| Component | Size |
|---|---|
| Account state (1B accounts) | ~48 GB |
| Transaction ring buffer | ~50 GB (configurable) |
| DAG metadata & indices | ~10 GB |
| Total (validator) | ~50-110 GB forever |
Unlike Ethereum (~1.5 TB and growing), Solana (~150 TB with full history), or Bitcoin (~600 GB), a Zero validator's storage requirements are bounded forever. A validator that joins the network in 2030 needs the same disk space as one that joined at genesis.
Vault Architecture
The vault system is Zero's bridge to the broader crypto ecosystem. It consists of smart contracts deployed on supported chains that hold stablecoins (USDC, USDT) as backing for Z tokens.
Design Goals
- Minimal attack surface. Vault contracts are pure escrow controlled by a timelocked admin (ZeroTimelock). All privileged operations require 2-of-3 guardian approval and a 24-hour delay.
- Validator-attested. Deposits and withdrawals require 2/3+ validator attestations, using the same consensus mechanism that secures the Zero network itself.
- Multi-chain. Vaults are deployed on multiple chains to meet users where they are.
Contract Security
- AccessControl (OpenZeppelin): Role-based permissions for all privileged operations.
- EIP-712 typed signatures: Human-readable signing payloads for Trinity Validator approvals.
- Asymmetric pause: Any 1 Trinity Validator can pause all bridge operations; only the admin role can unpause.
- Tiered circuit breaker: ≤20% TVL per 24h requires 2-of-3 Trinity approval. 20-50% TVL requires 3-of-3 Trinity approval. >50% TVL is blocked entirely.
- Timelocked guardian rotation: 48-hour delay for any guardian change, observable on-chain.
- ReentrancyGuard: Applied to all fund-moving functions.
- Replay prevention: Unique
bridgeIdper operation prevents replay attacks.
Invariant Enforcement
The core safety property is checked at every consensus round:
Any proposed state transition that would violate this invariant is rejected by honest validators.
Deposit Flow (Mint Z)
Step 1: Deposit stablecoins
The user sends USDC or USDT to the vault contract on a supported chain. The deposit transaction includes a memo field containing the user's Zero public key (the account that will receive the minted Z).
Step 2: Validator observation
Zero validators monitor all supported chains for vault deposits. Each validator independently verifies the deposit transaction on the source chain.
Step 3: Attestation
Once a validator confirms the deposit, it broadcasts an attestation to the Zero network. When 2/3+ of validators (by stake weight) have attested to the same deposit, the mint is authorized.
Step 4: Mint
The consensus layer mints the equivalent Z to the specified account. For 1 USDC deposited, 100 Z is minted.
Fast finality is used for small deposits (configurable threshold). Validators accept the deposit after a reduced number of source-chain confirmations. Hard finality is used for large deposits, waiting for full source-chain finality before attesting.
Withdrawal Flow (Burn Z)
Step 1: Initiate BridgeOut
The user sends a BridgeOut transaction on Zero, specifying:
- Destination chain (Base or Arbitrum)
- Token type (USDC or USDT)
- Destination address on the target chain
- Amount of Z to burn
Step 2: Burn
The Z is burned on the Zero network, reducing total supply.
Step 3: Attestation
Validators attest to the burn. When 2/3+ have attested, the release is authorized.
Step 4: Release
The vault contract on the destination chain releases the equivalent stablecoin to the specified address. For 100 Z burned, 1 USDC is released.
Attestation Layer
The attestation layer is the trust bridge between Zero and external chains. It uses the same validator set and consensus mechanism as the main Zero network.
Threshold
Both deposits (mints) and withdrawals (burns) require attestation from 2/3+ of validators by stake weight. This threshold matches the BFT assumption of the main consensus protocol -- if 2/3+ of stake is honest, the bridge is secure.
Validator Responsibilities
- Run full nodes on all supported chains (or use trusted RPC endpoints with verification).
- Monitor vault contracts for deposit events.
- Verify transactions on source chains before attesting.
- Sign attestations using their Zero validator key.
Trinity Validators
Bridge operations (mint/burn) are controlled by three trusted parties called Trinity Validators, separate from the consensus validator set. All vault contract operations require a 2-of-3 multisig from the Trinity Validators.
- Organizational separation: Each Trinity Validator is a different organization in a different legal jurisdiction.
- Hardware-only signing: All Trinity Validator keys are held in HSMs or hardware wallets. No software key storage.
- No delegation without expiry: Signing authority cannot be delegated without an on-chain expiry enforced at the contract level.
- Asymmetric pause: Any single Trinity Validator can pause bridge operations; only the admin role can unpause.
- Timelocked rotation: Guardian rotation requires a 48-hour delay, observable on-chain before it takes effect.
Supported Chains
| Chain | Tokens | Phase | Status |
|---|---|---|---|
| Base | USDC | Phase 1 | Active |
| Arbitrum | USDC, USDT | Phase 1 | Active |
Python SDK
Install the Python SDK:
pip install zero-network
Basic Usage
from zero import Wallet
# Load wallet from ZERO_PRIVATE_KEY env var
w = Wallet.from_env()
# Send 10 Z ($0.10) to a recipient
tx = w.send("zr_recipient", 10)
print(tx.hash) # Transaction hash
# Check balance
bal = w.balance()
print(bal) # 489.89 Z
# Get account info
acct = w.account()
print(acct.nonce) # 1042
print(acct.head) # BLAKE3 hash of last transfer
Transaction History
# Get last 10 transfers
history = w.history(limit=10)
for tx in history:
print(f"{tx.direction} {tx.amount} Z -> {tx.counterparty}")
Bridge Operations
# Deposit: after sending USDC to vault on Base
mint = w.bridge_in(
source_chain="base",
token="usdc",
tx_hash="0xabc123..."
)
print(mint.status) # "pending" -> "confirmed"
# Withdraw: burn Z and release USDC
release = w.bridge_out(
dest_chain="arbitrum",
token="usdc",
dest_address="0xdef456...",
amount=500 # 500 Z = 5 USDC
)
JavaScript SDK
Install the JavaScript SDK:
npm install @zero-network/sdk
Basic Usage
import { Wallet } from '@zero-network/sdk';
// Load wallet from ZERO_PRIVATE_KEY env var
const w = Wallet.fromEnv();
// Send 10 Z ($0.10)
const tx = await w.send('zr_recipient', 10);
console.log(tx.hash);
// Check balance
const bal = await w.balance();
console.log(`Balance: ${bal} Z`);
// Get transaction history
const history = await w.history({ limit: 10 });
history.forEach(tx => console.log(tx));
Bridge Operations
// Deposit: track a USDC deposit
const mint = await w.bridgeIn({
sourceChain: 'base',
token: 'usdc',
txHash: '0xabc123...'
});
// Withdraw: burn Z and release USDC
const release = await w.bridgeOut({
destChain: 'base',
token: 'usdc',
destAddress: '0xdef456...',
amount: 1000 // 1000 Z = 10 USDC
});
Rust SDK
Add the Rust SDK to your Cargo.toml:
[dependencies]
zero-network = "0.1"
Basic Usage
use zero_sdk::{Wallet, Result};
fn main() -> Result<()> {
// Load from ZERO_PRIVATE_KEY env var
let w = Wallet::from_env()?;
// Send 10 Z
let tx = w.send("zr_recipient", 10)?;
println!("tx: {}", tx.hash);
// Check balance
let bal = w.balance()?;
println!("balance: {} Z", bal);
Ok(())
}
Environment Pattern
All Zero SDKs follow a consistent environment-first pattern. The wallet private key is loaded from the ZERO_PRIVATE_KEY environment variable by default.
# Set the private key
export ZERO_PRIVATE_KEY="your_ed25519_private_key_hex"
# Optional: set a custom RPC endpoint
export ZERO_RPC_URL="https://rpc.zzero.net"
This pattern is designed for machine environments -- containers, serverless functions, CI/CD pipelines, and AI agent runtimes. No config files, no interactive prompts, no key management UIs. Just an environment variable.
Since Zero wallets handle at most a few dollars at a time (max tx: 25 Z = $0.25), the security requirements are fundamentally different from a wallet holding ETH or BTC. Leaking a Zero private key is more like leaking a prepaid coffee card than leaking a bank account. The environment variable pattern reflects this reality.
Chat Wallet
AI agents running in chat contexts (LLM tool-use, MCP servers, chat assistants) can use a chat wallet -- a lightweight wallet that lives in the agent's runtime and makes payments on behalf of the user.
from zero import ChatWallet
# Agent creates a chat wallet for a session
wallet = ChatWallet.create()
print(wallet.address) # zr_a1b2c3...
# User funds it (small amount for the session)
# wallet receives 5 Z ($0.05) -- enough for ~500 API calls
# Agent pays for tool calls automatically
result = await wallet.pay_and_call(
tool_address="zr_search_provider",
amount=1, # 0.01 Z per call (+ 0.01 Z fee = 0.02 Z total)
endpoint="https://api.example.com/search",
params={"q": "machine learning papers"}
)
x402 Protocol
x402 is a machine-native payment protocol inspired by HTTP 402 (Payment Required). It enables APIs to charge per-request without subscriptions, API keys, or billing infrastructure.
How It Works
- Client makes a request to a paid API endpoint.
- Server responds with HTTP 402 and a payment header containing the price (in Z) and the server's Zero address.
- Client makes a Zero payment for the requested amount.
- Client retries the request with the transaction hash in a payment header.
- Server verifies the payment and serves the response.
// Step 1: Client request
GET /api/search?q=zero+network HTTP/1.1
// Step 2: Server responds with payment details
HTTP/1.1 402 Payment Required
X-Zero-Amount: 10
X-Zero-Address: zr_merchant_abc123
X-Zero-Network: zero
// Step 4: Client retries with payment
GET /api/search?q=zero+network HTTP/1.1
X-Zero-Payment: tx_hash_abc123
// Step 5: Server verifies and responds
HTTP/1.1 200 OK
{ "results": [...] }
Server Middleware
The @paywall decorator turns any API endpoint into a paid endpoint with one line of code:
from fastapi import FastAPI
from zero.x402 import paywall
app = FastAPI()
@app.get("/api/search")
@paywall(amount=10, address="zr_merchant")
async def search(q: str):
return do_search(q)
The middleware handles:
- Returning 402 with payment details when no payment is provided
- Verifying the Zero transaction hash against the expected amount and address
- Rejecting replayed transaction hashes (each tx can only be used once)
- Passing the request through to the handler once payment is verified
Express.js Middleware
import { paywall } from '@zero-network/x402';
app.get('/api/search',
paywall({ amount: 10, address: 'zr_merchant' }),
async (req, res) => {
const results = await doSearch(req.query.q);
res.json({ results });
}
);
Client Auto-Pay
The SDK provides an auto-pay HTTP client that handles the 402 flow automatically:
from zero.x402 import AutoPayClient
from zero import Wallet
w = Wallet.from_env()
client = AutoPayClient(wallet=w)
# This will automatically:
# 1. GET the endpoint
# 2. Receive 402 with payment details
# 3. Pay the requested amount
# 4. Retry with the tx hash
# 5. Return the final response
result = await client.get("https://api.example.com/search?q=hello")
print(result.json())
import { AutoPayClient, Wallet } from '@zero-network/sdk';
const w = Wallet.fromEnv();
const client = new AutoPayClient({ wallet: w });
// Automatic 402 handling
const result = await client.get('https://api.example.com/search?q=hello');
console.log(result.data);
The auto-pay client supports configurable spending limits: AutoPayClient(wallet=w, max_per_request=25, max_per_minute=100). This prevents runaway spending from misconfigured APIs or malicious endpoints. Default limits: 25 Z per request, 100 Z per minute.
MCP Server Payments
Zero integrates natively with the Model Context Protocol (MCP) -- the standard for connecting AI models to external tools and data sources. MCP tool servers can charge per-invocation using Zero.
Server Implementation
from mcp.server import Server
from zero import Wallet
server = Server("search-provider")
wallet = Wallet.from_env()
@server.tool("web_search")
async def web_search(query: str, zero_payment: str = None):
# No payment provided -- return payment request
if not zero_payment:
return {
"error": "payment_required",
"network": "zero",
"address": wallet.address,
"amount": 10
}
# Verify the payment
verified = await wallet.verify_payment(
tx_hash=zero_payment,
min_amount=10
)
if not verified:
return {"error": "payment_invalid"}
# Payment verified -- serve the request
return {"results": await do_search(query)}
Payment Flow
- AI agent invokes the
web_searchtool without a payment. - Server returns a
payment_requiredresponse with the price and address. - Agent's wallet sends the requested amount to the server's address.
- Agent retries the tool call with the
zero_paymenttransaction hash. - Server verifies the payment on-chain and serves the result.
This creates a machine-to-machine economy where AI agents can autonomously discover, pay for, and consume tools without human intervention.
MCP Client
The Zero-aware MCP client handles payment negotiation automatically:
from mcp.client import Client
from zero.mcp import ZeroPaymentHandler
from zero import Wallet
wallet = Wallet.from_env()
handler = ZeroPaymentHandler(wallet=wallet)
client = Client(
server_url="https://mcp.example.com",
payment_handler=handler
)
# The client will automatically handle payment_required
# responses, pay, and retry -- transparent to the caller
result = await client.call_tool("web_search", {
"query": "latest AI research papers"
})
print(result)
An AI agent can chain multiple paid MCP tools in a single reasoning step: search (1 Z) -> fetch page (1 Z) -> summarize (2 Z). Total cost for a complex multi-tool query: 4 Z = $0.04. This is the economic substrate for autonomous AI workflows.
For Providers: Accept Zero Payments
If you run a website, API, or MCP server, you can charge users and AI agents per request using Zero. No API keys to issue, no subscription management, no billing infrastructure. Agents and users pay per-use with Z tokens and get instant access.
- No signup flow -- agents pay and access, no registration needed
- Instant settlement -- payments confirm in <500ms, no chargebacks
- Penny-scale pricing -- charge 0.01 Z ($0.0001) per request if you want
- x402 standard -- HTTP 402 status code, agents already understand it
- Revenue from AI traffic -- every agent that hits your endpoint can pay
Website Paywall
Gate any webpage or content behind a Zero micropayment. When a user or agent requests the page, return HTTP 402 with payment details. After payment, serve the content.
Express.js Middleware
const { ZeroPaywall } = require('@zero-network/sdk');
const paywall = new ZeroPaywall({
address: process.env.ZERO_ADDRESS,
});
// Gate a route: 0.05 Z to read an article
app.get('/article/:id', paywall.gate(5), async (req, res) => {
// Only reached after payment verified
const article = await getArticle(req.params.id);
res.json(article);
});
// Gate a download: 0.10 Z for a PDF
app.get('/report/:id', paywall.gate(10), async (req, res) => {
res.sendFile(reportPath);
});
What the Agent Sees
GET /article/42 HTTP/1.1
HTTP/1.1 402 Payment Required
Content-Type: application/json
{
"x-402-version": 1,
"x-402-network": "zero",
"x-402-amount": 5,
"x-402-address": "zr_pub...",
"x-402-description": "Pay 0.05 Z to read this article"
}
The agent's SDK auto-pays, attaches the receipt in an X-Zero-Receipt header, and retries. The middleware verifies and serves content. The entire flow takes <1 second.
API Paywall
Charge per API call with a single decorator. No API keys to manage, no rate limit tiers, no billing dashboard. Every call pays.
Python (FastAPI)
from zero_sdk import x402_gate
from fastapi import FastAPI
app = FastAPI()
@app.get("/api/sentiment")
@x402_gate(amount=1) # 0.01 Z per call
async def sentiment(text: str):
return analyze_sentiment(text)
@app.get("/api/translate")
@x402_gate(amount=3) # 0.03 Z per call
async def translate(text: str, target_lang: str):
return do_translate(text, target_lang)
@app.get("/api/ocr")
@x402_gate(amount=5) # 0.05 Z per call
async def ocr(image_url: str):
return extract_text(image_url)
Revenue Example
| Endpoint | Price | 10K calls/day | 100K calls/day |
|---|---|---|---|
| /api/sentiment | 0.01 Z | $1.00/day | $10.00/day |
| /api/translate | 0.03 Z | $3.00/day | $30.00/day |
| /api/ocr | 0.05 Z | $5.00/day | $50.00/day |
No minimum volume. No setup cost. Deploy, set your price, and start earning from the first request.
MCP Provider
Build an MCP tool server that charges AI agents per tool invocation. Prices are advertised in the tool schema so agents know the cost before calling.
Server with Per-Tool Pricing
from mcp.server import Server
from zero import Wallet
server = Server("my-tools")
wallet = Wallet.from_env()
# Each tool declares its price in the decorator
@server.tool("web_search", zero_price=2) # 0.02 Z
async def search(query: str):
return await search_web(query)
@server.tool("run_code", zero_price=10) # 0.10 Z
async def run_code(code: str, language: str):
return await sandbox_exec(code, language)
@server.tool("image_gen", zero_price=25) # 0.25 Z
async def generate_image(prompt: str):
return await gen_image(prompt)
How Agents Discover Prices
When an agent calls tools/list, prices are included in the tool metadata:
{
"tools": [
{
"name": "web_search",
"description": "Search the web",
"zero_price": 2,
"zero_address": "zr_pub..."
},
{
"name": "run_code",
"description": "Execute code in sandbox",
"zero_price": 10,
"zero_address": "zr_pub..."
}
]
}
The agent compares the price against its spending limits. If acceptable, it pays automatically and receives the tool result. No human approval needed for within-budget calls.
Provider Use Cases
Zero enables new business models that weren't viable before penny-scale settlement existed.
| Category | Example | Price Range |
|---|---|---|
| Content | Article access, research papers, dataset rows | 0.01-0.25 Z |
| AI Services | Sentiment analysis, translation, summarization, embeddings | 0.01-0.10 Z |
| Compute | Code sandbox, GPU inference, image generation | 0.05-0.25 Z |
| Data | Real-time prices, weather, company data, search results | 0.01-0.05 Z |
| Infrastructure | Bandwidth, storage, proxy, DNS lookups | 0.01-0.02 Z |
| IoT | Sensor readings, unlock commands, charge sessions | 0.01-0.10 Z |
| Training Data | RAG retrieval, dataset licensing, annotation | 0.01 Z per row |
| Media | Streaming per minute, image downloads, audio clips | 0.01-0.10 Z |
Agent Discovery Flow
When an AI agent encounters a Zero-gated resource, the payment is automatic and transparent.
HTTP (x402) Flow
- Request: Agent sends a normal HTTP request to the endpoint.
- 402 Response: Server returns HTTP 402 with
x-402-amount,x-402-address, andx-402-network: "zero". - Budget Check: Agent SDK checks the requested amount against its per-call and per-hour spending limits.
- Payment: If within budget, SDK sends a Zero transfer to the provided address.
- Retry: SDK retries the original request with
X-Zero-Receipt: <tx_hash>header. - Content: Server verifies receipt on-chain (<500ms) and serves the response.
MCP Flow
- List Tools: Agent calls
tools/listand seeszero_pricein each tool's metadata. - Call Tool: Agent invokes the tool. If no payment is attached, the server returns
payment_required. - Auto-Pay: The Zero MCP client handler detects the payment request, sends Z, and retries with the tx hash.
- Result: Server verifies payment and returns the tool result.
Agent Configuration
from zero import Wallet
from zero.spending import SpendingPolicy
wallet = Wallet.from_env()
# Configure spending limits for autonomous operation
policy = SpendingPolicy(
max_per_call=25, # 0.25 Z max per single payment
max_per_minute=100, # 1.00 Z max per minute
max_per_hour=1000, # 10.00 Z max per hour
max_per_day=10000, # 100.00 Z ($1.00) max per day
)
wallet.set_policy(policy)
# Agent now operates autonomously within these bounds
You don't need to know anything about your users. No accounts, no OAuth, no rate limiting. Set a price, verify receipts, serve content. The network handles identity (public keys), payment (Z transfers), and settlement (<500ms finality). You just build your service.
Running a Validator
Zero validators process transactions, participate in consensus, attest to bridge events, and earn a share of transaction fees.
Quick Start
# Install the Zero validator
curl -sSf https://install.zzero.net | sh
# Generate a validator keypair
zero keygen --output validator-key.json
# Start the validator
zero validator start \
--key validator-key.json \
--rpc-port 8545 \
--p2p-port 30300
The install script downloads the latest validator binary, verifies its signature, and sets up a systemd service for automatic restarts.
Hardware Requirements
| Component | Minimum | Recommended |
|---|---|---|
| CPU | 4 cores | 8+ cores |
| RAM | 16 GB | 32 GB |
| Storage | 256 GB NVMe | 512 GB NVMe |
| Network | 100 Mbps | 1 Gbps |
Because of ring buffer pruning, a 256 GB NVMe drive is sufficient forever. You will never need to upgrade storage. The 512 GB recommendation is for headroom and faster I/O from not running near capacity.
Economics
Transaction fees are split three ways each epoch:
| Recipient | Share | Purpose |
|---|---|---|
| Validators | 70% | Distributed proportionally by stake weight |
| Bridge reserve | 15% | Supplemental reserve for vault gas (bridge-out fee covers most costs) |
| Protocol reserve | 15% | Emergency fund, development, security audits |
Revenue Projections
| Daily Transactions | Fee Pool (Daily) | Validator Share (70%) | Per Validator (100 validators) |
|---|---|---|---|
| 100 million | $10,000 | $7,000 | $70/day |
| 1 billion | $100,000 | $70,000 | $700/day |
| 10 billion | $1,000,000 | $700,000 | $7,000/day |
At the fee of 0.01 Z ($0.0001) per transaction:
Zero has no block rewards and no token emission. Validator revenue comes exclusively from transaction fees. This means validators are profitable only when the network is actually being used -- aligning incentives with real utility rather than speculative staking yield.
Staking
Validators must stake Z tokens to participate in consensus. The stake serves as a sybil resistance mechanism and economic bond against misbehavior.
Staking Parameters
| Parameter | Value |
|---|---|
| Minimum stake | 10,000 Z ($100) |
| Maximum validators | 1,024 (ranked by stake) |
| Unbonding period | 7 days |
| Stake weight | Proportional to stake (fee distribution + voting power) |
The validator set is capped at 1,024. If all slots are filled, a new validator must stake more than the lowest-staked current validator to enter the set.
Trust Scoring
Each validator maintains a trust score (range 0-1000) that tracks reliability:
| Event | Score Change |
|---|---|
| New validator starts at | 500 |
| Timely event processed | +1 |
| Missed event | -5 |
| Late event | -2 |
| Equivocation (conflicting attestations) | -1000 (immediate ejection) |
- Below 100: Validator is ejected from the active set.
- Bottom 5%: The lowest-scoring 5% of validators are ejected each epoch.
- Equivocation: Signing conflicting state transitions results in immediate ejection and stake at risk.
# Stake tokens as a validator (min 10,000 Z)
zero stake deposit --amount 10000 --key validator-key.json
# Check stake status
zero stake status --key validator-key.json
# Initiate unstaking (begins 7-day unbonding period)
zero stake withdraw --amount 5000 --key validator-key.json
API Reference
The Zero API consists of 8 client-facing endpoints plus 2 gossip endpoints (PushEvent, PullEvents) for validator-to-validator communication. All client endpoints are available via gRPC. The API is intentionally minimal -- there are no pagination cursors, no filtering operators, no GraphQL. Just 8 functions that do everything you need.
| Endpoint | Description |
|---|---|
Send | Submit a signed transfer |
GetTransfer | Look up a transfer by hash |
GetHistory | Get recent transfers for an account |
GetBalance | Get an account's balance |
GetAccount | Get full account state |
BridgeIn | Initiate a deposit (mint Z) |
BridgeOut | Initiate a withdrawal (burn Z) |
GetBridgeStatus | Check bridge operation status |
Send
Submit a signed transfer to the network.
// Request
{
"method": "Send",
"params": {
"from": "zr_sender_pubkey",
"to": "zr_recipient_pubkey",
"amount": 10,
"nonce": 42,
"signature": "hex_encoded_64_byte_sig"
}
}
// Response
{
"tx_hash": "blake3_hash_of_transfer",
"status": "confirmed"
}
| Parameter | Type | Description |
|---|---|---|
from | string | Sender's public key (hex or zr_ address) |
to | string | Recipient's public key (hex or zr_ address) |
amount | u32 | Amount in penny units (max: 2500) |
nonce | u32 | Sender's next nonce (must match account state) |
signature | string | Hex-encoded 64-byte Ed25519 signature |
GetTransfer
Look up a transfer by its transaction hash. Returns the full transfer details and confirmation status.
// Request
{
"method": "GetTransfer",
"params": {
"tx_hash": "blake3_hash"
}
}
// Response
{
"from": "zr_sender",
"to": "zr_recipient",
"amount": 10,
"nonce": 42,
"status": "confirmed",
"timestamp": 1709827200
}
GetHistory
Get recent transfers for an account, ordered most recent first. Limited by the ring buffer retention window.
// Request
{
"method": "GetHistory",
"params": {
"account": "zr_account",
"limit": 10
}
}
// Response
{
"transfers": [
{
"tx_hash": "blake3_hash",
"from": "zr_sender",
"to": "zr_recipient",
"amount": 10,
"timestamp": 1709827200
}
]
}
GetBalance
Get the current balance for an account. Returns the balance in penny units.
// Request
{
"method": "GetBalance",
"params": {
"account": "zr_account"
}
}
// Response
{
"balance": 48989 // 489.89 Z = $4.90
}
GetAccount
Get the full account state, including balance, nonce, and head hash.
// Request
{
"method": "GetAccount",
"params": {
"account": "zr_account"
}
}
// Response
{
"balance": 48989,
"nonce": 1042,
"head": "blake3_hash_of_latest_transfer",
"flags": 0
}
BridgeIn
Initiate a deposit by referencing a stablecoin transaction on a supported chain. Validators will observe and attest to the deposit.
// Request
{
"method": "BridgeIn",
"params": {
"source_chain": "base",
"token": "usdc",
"tx_hash": "0xabc123..."
}
}
// Response
{
"bridge_id": "bridge_mint_001",
"status": "pending",
"attestations": 0,
"required": 67 // 2/3+ of 100 validators
}
BridgeOut
Initiate a withdrawal by burning Z and specifying a destination chain and address for stablecoin release. A bridge-out fee of 0.5 Z ($0.005) is charged to cover EVM gas costs. The fee is deducted from the sender in addition to the burn amount.
// Request
{
"method": "BridgeOut",
"params": {
"dest_chain": "arbitrum",
"token": "usdc",
"dest_address": "0xdef456...",
"amount": 500 // 500 Z = 5 USDC (+ 50 units fee = 550 total deducted)
}
}
// Response
{
"bridge_id": "bridge_burn_042",
"status": "pending",
"z_burned": 500,
"fee": 50
}
GetBridgeStatus
Check the status of a bridge operation (deposit or withdrawal).
// Request
{
"method": "GetBridgeStatus",
"params": {
"bridge_id": "bridge_mint_001"
}
}
// Response
{
"bridge_id": "bridge_mint_001",
"type": "mint",
"status": "confirmed",
"attestations": 72,
"required": 67,
"amount_z": 100, // 100 Z = 1 USDC
"source_chain": "base",
"source_tx": "0xabc123..."
}
Fee Structure
Zero has the simplest fee structure in crypto:
There is no:
- Gas price or gas limit
- Priority fee or tip
- Congestion-based pricing
- Different fee tiers for different transaction types
- Fee market or auction mechanism
Every transaction costs exactly 0.01 Z. The fee is deducted from the sender's balance in addition to the transfer amount. Total debit: amount + 0.01 Z. The smallest possible transaction is 0.01 Z + 0.01 Z fee = 0.02 Z ($0.0002). Collected fees are distributed each epoch: 70% to validators (proportional to stake), 15% to bridge reserve (vault contract gas), and 15% to protocol reserve (emergency fund, development).
A service that makes 1,000 Zero transactions per day knows it will cost exactly 10 Z ($0.10) per day in fees. This predictability is critical for machine budgeting -- agents can compute exact costs before committing to multi-step workflows.
Limits
| Parameter | Value | Rationale |
|---|---|---|
| Max transaction amount | 25 Z ($0.25) | Micropayments only. Large transfers go through traditional rails. u32 with saturation arithmetic. |
| Max account balance | ~42,949 Z ($429.49) | u32 limit in penny units. Sufficient for agent working capital. |
| Transaction size | 136 bytes (fixed) | No variable-length fields. Enables maximum throughput. |
| Account state size | 48 bytes (fixed) | Minimal state footprint. |
| Nonce | u32 (0 to ~4.29B) | Sufficient for ~136 years at 1 tx/sec. |
| Ring buffer retention | Configurable (~50 GB) | Recent history for auditing. Old transfers pruned. |
| Account creation fee | 5.00 Z ($0.05) one-time | Charged on first transfer to a new account. Prevents dust account spam. |
| Min send balance | 1.00 Z ($0.01) | Accounts below this threshold can only receive, not send. |
| Per-account rate limit | 100 tx/s (sliding window) | Prevents transaction spam from a single account. |
| Bridge circuit breaker | Tiered: 20% (2-of-3), 50% (3-of-3), >50% blocked per 24h | Limits maximum mintable Z to prevent bridge drain attacks. |
| Guardian rotation delay | 48 hours | Timelocked delay for Trinity Validator rotation, observable on-chain. |
| Slashing (equivocation) | 100% of stake burned | Validators that sign conflicting state transitions lose entire stake. |
| Slashing (downtime) | 10% of stake burned | Validators with extended downtime are penalized. |
| Dust pruning | <0.10 Z for 30 days | Accounts below 0.10 Z inactive for 30 days can be pruned from state. |
| Max validators | 1,024 | Ranked by stake. Balances decentralization with consensus performance. |
The 25 Z ($0.25) cap is a security design choice. By limiting individual transaction value, the network reduces the incentive for attacks. If you need to move more than $0.25, you should use Ethereum, Solana, or traditional banking -- those systems are designed and audited for high-value transfers. Zero is designed for the other 99% of transactions that are too small for those systems.
Security Model
Cryptographic Primitives
| Primitive | Algorithm | Notes |
|---|---|---|
| Key pairs | Ed25519 | 32-byte public keys, 64-byte private keys |
| Signatures | Ed25519 | Full 64-byte signatures over the 72-byte unsigned payload. |
| Hashing | BLAKE3 | 32-byte digests. Used for tx hashes, account chains, DAG links. |
| Transport | TLS 1.3 | All validator-to-validator and client-to-validator communication. |
Consensus Security
- Byzantine fault tolerance: Tolerates up to 1/3 of validators (by stake) being malicious.
- Deterministic finality: No chain reorganizations. Once confirmed, a transaction cannot be reversed.
- Trust scoring: Validators maintain a trust score (0-1000). Equivocation results in immediate ejection; poor performance accumulates penalties. Bottom 5% ejected per epoch.
- Stake at risk: Validators that sign conflicting state transitions face ejection and stake at risk.
Bridge Security
- 2/3+ attestation threshold: Same security model as the main consensus.
- Trinity Validators: 2-of-3 multisig from independent organizations in separate jurisdictions controls all mint/burn operations.
- Hardware-only signing: Trinity Validator keys held in HSMs/hardware wallets.
- Tiered circuit breaker: ≤20% TVL = 2-of-3, 20-50% = 3-of-3, >50% = blocked.
- Asymmetric pause: Any 1 Trinity Validator can pause; only admin can unpause.
- Invariant enforcement: Total Z supply must always equal 100x total locked stablecoins.
Economic Security
- Max tx value: 25 Z ($0.25). The maximum gain from a successful attack on a single transaction is $0.25.
- No MEV. No smart contracts means no sandwich attacks, no front-running, no flashloan exploits.
- No governance attacks. There is no on-chain governance to capture.
Attack Mitigations
| Attack | Mitigation |
|---|---|
| Transaction spam | Per-account rate limit (100 tx/s), flat fee (0.01 Z) |
| Dust account spam | Account creation fee (5 Z) on first transfer to new account |
| State bloat | Dust pruning (<0.10 Z for 30 days), rolling window transfer log |
| Validator equivocation | 100% stake slash + trust score → 0 + immediate ejection (slashed funds credited to protocol reserve) |
| Poor validator behavior | Trust scoring with miss/late penalties, 10% slash for extended downtime, bottom 5% ejected per epoch |
| Sybil validators | Minimum stake 10,000 Z ($100), max 1,024 validators ranked by stake |
| Stake-and-slash | 7-day unbonding period |
| Bridge drain | Circuit breaker: max 20% of reserves mintable per 24h |
| Invalid bridge attestation | 100% stake slash |
| Bridge key compromise | Tiered circuit breaker, asymmetric pause, timelocked rotation |
| Stale delegation | On-chain expiry enforced at contract level |
| Low-balance griefing | Minimum send balance (1 Z); below this, accounts can only receive |
| Amount overflow | Max transfer amount 25 Z; u32 with saturation arithmetic |
Roadmap
Phase 0 -- Devnet Complete
- 136-byte transfer format (Ed25519 full signature)
- 48-byte account state, DashMap-backed AccountStore
- Ring buffer transfer log with O(1) append/evict
- Ed25519 + BLAKE3
- DAG-based leaderless aBFT consensus
- Trust scoring, rate limiting, fee collection
- gRPC API (8 client + 2 gossip endpoints)
- Gossip protocol (PushEvent, PullEvents)
- Event loop with heartbeats
- TOML config + genesis, keyfiles, binary snapshots
- Python SDK with 4-line wallet
- 3-validator local devnet with full consensus
- 345 tests (201 Rust + 15 Python + 31 JS + 98 Solidity)
Phase 1 -- Testnet Active
- Staking transactions (stake/unstake with 7-day unbonding) Complete
- Epoch-based fee distribution (70/15/15 split) Complete
- Dust pruning Complete
- mTLS + validator auth on gossip Complete
- JavaScript SDK Complete
- Trinity Validators -- bridge guardian system Complete
- Validator slashing -- 100% equivocation, 10% downtime Complete
- Security research -- bridge hack post-mortems Complete
- Vault contract tests: 98 tests (ZeroVault.t.sol, CrossBridge.t.sol, ZeroTimelock.t.sol) Complete
- Public testnet (3 validators: EU, US-East, US-Central) Complete
- Prometheus metrics
Phase 2 -- Bridge + Deploy In Progress
- Vault contracts on Base (USDC) + Arbitrum (USDC, USDT) Complete
- ZeroTimelock admin (24h delay, 2-of-3 threshold) Complete
- Bridge circuit breaker (tiered: 20/50% TVL limits) Complete
- Bridge watcher service (auto-mint + auto-release) Complete
- Block explorer (explorer.zzero.net) Complete
- CI/CD pipelines (Rust, Solidity, Python, JS) Complete
- Permissionless validator staking
- x402 middleware
Phase 3 -- Mainnet
- Security audit
- Bug bounty program
- UUPS upgradeability → ossification path
- Cross-vault rebalancing
- Geographic distribution
- Sharding if needed
- Fiat on-ramps
Crate Structure
The Zero chain is implemented as a Rust workspace with seven crates:
chain/crates/
├── zero-types/ # Transfer, Account, BlockRef, Event, params, config
├── zero-crypto/ # Ed25519, BLAKE3, keyfiles
├── zero-storage/ # AccountStore, ring buffer, executor, rate limiter, snapshots
├── zero-consensus/ # DAG, Committee, ValidatorState, TrustScorer, Node, event loop
├── zero-network/ # gRPC server (8 client + 2 gossip endpoints)
├── zero-node/ # Binary entry point
└── zero-bridge/ # Bridge attestation service for Trinity Validators
| Crate | Purpose |
|---|---|
zero-types | Core data types: Transfer (136 bytes), Account (48 bytes), BlockRef, Event, network parameters, TOML config |
zero-crypto | Cryptographic primitives: Ed25519 key generation and signing, BLAKE3 hashing, keyfile serialization |
zero-storage | State management: DashMap-backed AccountStore, StakeStore (slashing), TrinityValidatorSet (bridge), ring buffer transfer log, transaction executor, per-account rate limiter, binary snapshots |
zero-consensus | Consensus engine: DAG structure, Committee management, ValidatorState, TrustScorer, Node orchestration, event loop with heartbeats |
zero-network | Networking: gRPC server with 8 client-facing endpoints and 2 gossip endpoints (PushEvent, PullEvents) |
zero-node | Binary entry point: CLI argument parsing, config loading, node startup |
zero-bridge | Bridge attestation service for Trinity Validators: watches vault events on Base/Arbitrum, coordinates 2-of-3 signatures, executes mints and releases. Modules: EIP-712 typed signing (eip712.rs), deposit event parsing (events.rs), signature collection coordinator (coordinator.rs), bridge configuration (config.rs). |