Overview
Cowboy introduces four fundamental innovations that enable autonomous agents and verifiable computation at the protocol level. Each innovation addresses a critical limitation in existing blockchain platforms.Note: The examples below are conceptual snippets to illustrate architecture and mechanisms. Final interfaces and usage should follow the SDK and Developer Guide.
Native Timers
Protocol-level scheduling with O(1) performance
Dual-Metered Gas
Independent pricing for compute and storage
Python Smart Contracts
Deterministic VM for high-level language
Verifiable Off-Chain
Decentralized computation with cryptographic proofs
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
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 whitelisted modules allowed.
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:How They Work Together
These four innovations combine to enable powerful use cases:Example: Autonomous DeFi Liquidation Bot
Steps (illustrative):- Submit off-chain task to fetch prices (CIP-2)
- Process results (compute-heavy → cycles)
- Execute necessary storage updates (data-heavy → cells)
- Schedule next check with GBA (CIP-1)
- ✅ Native Timers: Self-schedules every 60 blocks
- ✅ Dual Gas: Pays fairly for compute vs. storage
- ✅ Python VM: Express complex logic easily
- ✅ Off-Chain: Fetch external price data
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

