Overview
Cowboy introduces five fundamental innovations that enable autonomous agents and verifiable computation at the protocol level. Each addresses a critical limitation in existing blockchain platforms.Note: Code examples show the realcowboy_sdk(CIP-6) andpvm_hostAPIs. See SDK Overview for the full surface.
Native Timers
Protocol-level scheduling with O(1) enqueue
Dual-Metered Gas
Independent pricing for compute and storage
Python Smart Contracts
Deterministic Rust-based PVM for a high-level language
Verifiable Off-Chain
Decentralized LLM/HTTP/MCP compute with proofs
Encrypted Storage (CBFS)
Distributed erasure-coded filesystem with FUSE mount
1. Native Protocol Timers
The Problem
Traditional blockchains have no concept of time-based execution:- Cron jobs: Centralized, single point of failure
- Keeper networks: Expensive, complex to integrate
- User triggers: Poor UX, unreliable
Cowboy’s Solution: Hierarchical Calendar Queue
A three-tiered scheduling system built into the consensus layer:- ✅ O(1) scheduling: Constant-time enqueue for near-term timers
- ✅ Scalable: Handles millions of timers efficiently
- ✅ Deterministic: Part of consensus state
- ✅ Fair: Gas bidding prevents DoS
Dynamic Gas Bidding
Actors compete for timer execution during congestion (CIP-1):- Schedule a timer referencing a designated Gas Bidding Agent (GBA).
- When due, the producer queries the GBA with protocol context to obtain fee params.
- Timers are prioritized by effective tip within a fixed per-block processing budget.
- trigger_block_height — originally scheduled height
- current_block_height — current height (for delay)
- basefee_cycle — current cycle basefee
- basefee_cell — current cell basefee
- last_block_cycle_usage — congestion indicator
- owner_actor_balance — actor’s current CBY balance
- Actors self-prioritize based on urgency
- Market-driven resource allocation
- DeFi liquidations can bid high during volatility
- Non-critical tasks bid low during congestion
DoS Protection
Fixed per-block budget prevents abuse:- At each block, timers sorted by effective tip
- Execute highest-priority timers first
- Stop when budget exhausted
- Unexecuted timers roll over to next block
2. Dual-Metered Gas Model
The Problem
Single gas metrics are fundamentally unfair:- Storage-heavy apps subsidized by compute-heavy apps
- Unpredictable costs (gas depends on market, not actual usage)
- Incentive misalignment (storage should cost more long-term)
Cowboy’s Solution: Cycles + Cells
Two independent dimensions with separate fee markets:- Cycles (Computation)
- Cells (Data/Storage)
What it measures: CPU workMetering method: Instruction-level trackingExamples:See: Fee Model Overview
Independent Fee Markets
Each resource has its own EIP-1559 style basefee:- Each resource priced based on its own demand
- Compute-heavy apps don’t affect storage prices
- Storage bloat doesn’t affect compute prices
- Fair for all use cases
Example: Fair Pricing in Action
3. Deterministic Python VM
The Problem
Smart contract languages are niche and difficult:- New language to learn
- Limited tooling and libraries
- Difficult to express complex logic
- Small developer community
Cowboy’s Solution: Python with Determinism
Actors are real Python. Here’s the scaffoldedhello actor using the low-level PVM host API:
cowboy_sdk:
Achieving Determinism
Challenge: Python is inherently non-deterministic (dict ordering, floats, GC, etc.) Cowboy’s approach: Constrained deterministic subset1. No Native FPU
1. No Native FPU
All floating-point operations use deterministic software implementation.
2. No Arbitrary C Extensions
2. No Arbitrary C Extensions
Only a curated stdlib subset is available.
3. Deterministic GC
3. Deterministic GC
Reference counting + no cycle detection during execution.
4. No JIT Compilation
4. No JIT Compilation
Pure interpretation mode only.
- Ensures identical execution across nodes
- Predictable gas costs
- No non-deterministic optimization
5. Single-threaded Execution
5. Single-threaded Execution
No concurrency, no race conditions.
Sandboxing
The VM enforces strict isolation:- ✅ Allowed (conceptual): persistent storage via host functions; actor messaging; timer scheduling; deterministic hashing.
- ❌ Prohibited: file I/O, network access, system calls, non-deterministic randomness.
Resource Metering
Every operation has a precise cost:4. Verifiable Off-Chain Compute
The Problem
On-chain computation is expensive and limited:Cowboy’s Solution: Decentralized Runner Network
Outsource computation to a marketplace of runners with verifiable results (CIP-2):- Submit a task to the Dispatcher with a mandatory
result_schemaand payment terms. - Runners self-select via VRF-based logic and either execute or skip deterministically.
- Results and (optional) proofs are submitted on-chain; when N results are collected, a deferred callback is triggered.
- The Actor consumes a chosen result and finalizes payment distribution.
VRF-Based Runner Selection
No centralized scheduler required:- ✅ Decentralized: No single coordinator
- ✅ Verifiable: Anyone can check selection validity
- ✅ Unpredictable: Can’t game the system
- ✅ Fair: All runners have equal probability
Runner Lifecycle
Flexible Verification
Choose the proof type based on your requirements:- N-of-M Consensus
- Zero-Knowledge Proofs
- TEE Attestation
Use case: General computation with economic security
- Configure N runners; accept when ≥ quorum match.
- Pros: Simple, broad applicability
- Cons: Pay multiple runners
Economic Model
Market-driven pricing, not protocol gas:5. Encrypted Distributed Storage (CBFS)
The Problem
On-chain state storage is expensive and bounded. Anything large — model weights, datasets, media, logs — needs to live elsewhere:- Self-hosted S3 — centralized, single trust anchor
- IPFS — public content-addressed, no encryption, unreliable pinning
- Arweave / Filecoin — either unencrypted or require bridging ceremony
Cowboy’s Solution: CBFS
A distributed filesystem where:- Data is encrypted client-side with AES-256-GCM before it ever leaves the writer
- Shards are erasure-coded —
Kdata +Mparity Reed-Solomon, recover from anyK - Transport is QUIC — low-latency parallel shard transfers
- Auth is delegated — owners sign short-lived capability tokens for runners and actors to mount volumes, so the data path does not require a chain write per I/O
- Mount is FUSE — actors and runners see normal filesystem semantics
Architecture
Key Properties
- ✅ Confidentiality: relays never see plaintext
- ✅ Durability: any
KofK + Mshards reconstruct the file - ✅ Self-healing: background repair detects dead nodes and re-shards
- ✅ Chain-light data path: owners sign tokens, relays verify — no chain write per shard read/write
- ✅ Composable with runners: a runner job can mount an input volume and write to an output volume via delegated tokens
How They Work Together
These four innovations combine to enable powerful use cases:Example: Autonomous DeFi Liquidation Bot
Steps (illustrative):- Submit an off-chain task to fetch prices (CIP-2 runner, HTTP executor)
- Process results in a
@runner.continuationresume handler (compute → cycles) - Persist positions and audit logs (small → state cells, large → CBFS)
- Schedule the next check via a CIP-1 timer with a GBA
- ✅ Native Timers: self-schedules every N blocks with dynamic bidding
- ✅ Dual Gas: pays fairly for compute vs. storage
- ✅ Python VM: expresses complex logic naturally
- ✅ Off-Chain: fetches external price data via HTTP runner
- ✅ CBFS: archives historical audit trails off-chain, encrypted
Next Steps
Architecture Deep Dive
Understand the complete system design
Actor VM
Learn how the Python VM achieves determinism
Fee Model
Deep dive into Cycles and Cells metering
Scheduler
Read the timer and bidding overview

