Skip to main content

CIP-13 v2

Part I is the v1 specification. Part II adds the master opcode table and the cross-CIP amendments. Part II is canonical wherever the two conflict.

Part I — v1 Specification (verbatim from cip-13-runner-delegation.md)

Status: Draft Type: Standards Track Category: Core Created: 2026-04-12 Requires: CIP-12 (Governance)
Cowboy Cloud and Cowboy Chain. This CIP specifies the Cowboy protocol. Cowboy Cloud runs on this protocol today. Cowboy Chain, a public network on the same protocol, is under consideration for a future release. Where the two differ, this CIP says so. This CIP applies to Cowboy Chain only.

1. Abstract

Background

Self-bonding requires runners to provide both hardware and CBY.

Goal

This CIP specifies stake delegation in the Cowboy runner marketplace.

Overview

Any CBY holder can lock tokens on behalf of a registered runner, increasing the runner’s effective stake (VRF selection weight and maximum job value) in exchange for a runner-configured share of the 89% settlement payout. The protocol handles only registration, payout splitting, slashing cascades, and unbonding. Third-party actors build liquid staking pools, yield tokens, and fleet management vaults using these operations.

2. Motivation

In a self-bonded protocol, a runner must hold max(10,000 CBY, 1.5× declared_max_job_value) in its own account to register (whitepaper §1.9, §5). This creates two problems:
  1. GPU operators may lack large CBY positions, while large CBY holders may lack hardware. Self-bonding requires the same party to provide both.
  2. CBY holders who do not operate runners cannot earn runner marketplace revenue.
Runner delegation lets CBY holders fund runners operated by others.

2.1 Design philosophy

The protocol does not implement pools, share tokens, diversification strategies, or yield wrappers. Third-party actors implement them. The division follows these examples:

3. Specification

3.1 New data structures

DelegationConfig

Added to RunnerRegistration. Runners opt into delegation by setting this field. All fields MUST be present.
commission_bps is the runner’s cut of delegator-attributed revenue. If a runner earns 100 CBY on a job and 60% of the runner’s effective stake is delegated, then 60 CBY is the delegator-attributed portion. The runner keeps 60 × commission_bps / 10000 and delegators share the remainder pro-rata. A runner submits RunnerUpdateDelegationConfig to queue a new commission. The update writes pending_commission_bps = new_value and pending_effective_epoch = current_epoch + 1. The old commission_bps remains authoritative for every settlement that finalizes in the current epoch. At the first settlement in epoch pending_effective_epoch or later, the runtime promotes the pending value into commission_bps and clears the pending fields (see §3.4 effective_commission_for_epoch). Delegators therefore see each commission change one full epoch before it applies. The non-commission fields (max_delegated_stake, min_delegation, accept_delegation) take effect immediately on update because they only gate future transactions.

DelegationTranche

A delegator’s position toward a single runner consists of one or more tranches. A tranche is an indivisible unit of delegated stake with its own status and, when unbonding, its own claim height. Partial undelegation, top-ups, and slashing operate on individual tranches.
The Registry stores only these two statuses. Claimability and slashability are pure functions of status, claimable_at, and the current block height:
These predicates are the authoritative definitions used by §3.4 (settlement), §3.6 (slashing), and RunnerClaimUnbonded (§3.3). Maturity therefore needs no scheduled state transition (§3.8). An active slash drain still blocks claims until its principal lock clears, and it evaluates an admitted liability at its frozen offense height (§3.6.1). A delegator MAY hold multiple Active tranches against the same runner (each top-up creates a new tranche) and MAY simultaneously hold Unbonding tranches at various stages of maturity.

Storage layout

Within the 0x01 Runner Registry system actor (see §9 of the whitepaper for system actor addresses):
The delegation indexes use a binary layout. The runner index preserves entry order, assigns address-dictionary ordinals by first appearance, and holds at most 200 distinct delegators and 32 outstanding tranches per delegator. Its maximum encoded value is 61,604 bytes. The per-delegator index holds at most 32 tranche IDs. The reverse account index stores one membership row per (delegator, runner) under the 32-byte key ASCII("dar:") ‖ keccak256(delegator)[0..12] ‖ keccak256(runner)[0..16]; its value carries both full addresses for collision validation. Membership is removed when the last outstanding tranche for that pair is removed. DelegationDelegatorSummary caches the per-(runner, delegator) counts and totals required by O(1) precondition checks:
The Registry updates the summary alongside DelegationTotals on every mutation (Delegate, Increase, Undelegate, Claim, slashing). It deletes the summary key when the summary would be empty. active_tranche_count is the sole counter used to enforce MAX_ACTIVE_TRANCHES_PER_DELEGATOR (§3.3). DelegationTotals.delegator_count counts each delegator once while its delegation_delegator_summary.active_tranche_count > 0. Independently, the runner index admits at most 200 distinct delegators with any outstanding Active or Unbonding tranche; moving the last Active tranche to Unbonding does not free that identity slot. DelegationTotals caches aggregates so that dispatch and settlement do not iterate tranches:
VRF selection weight, max job value, and settlement need only total_active. The slashing routine computes the slashable base during its own tranche iteration (§3.6, §10). Indexer reads and deregistration recover Unbonding amounts by iterating delegation_runner_index.

3.2 Effective stake

A runner’s effective stake replaces the current registration.stake in all protocol-level calculations:
registration.stake is the runner’s self-bonded stake. The VRF weight function w = effective_stake · max(√(reputation / REPUTATION_NORMALIZER), w_min_floor) (CIP-2 §5.3) uses effective_stake in place of registration.stake. Weight is linear in effective stake. A runner’s rate_card.max_job_value is bounded by effective_stake × STAKE_JOB_MULTIPLIER_DENOM / STAKE_JOB_MULTIPLIER_NUM (currently effective_stake / 1.5), so delegation raises the job value a runner can accept. Runners MUST maintain a minimum self-bond of self_stake >= max(MIN_STAKE_CBY_WEI, effective_stake × MIN_SELF_BOND_BPS / 10000). §4.2 gives the parameter value.

3.3 New system instructions

This CIP adds five SystemInstruction variants. Atomic redelegation between runners is out of scope (§9.5).

RunnerUpdateDelegationConfig

Sender MUST be the runner itself (registration owner). The runner uses this instruction both to opt in and to adjust terms later. Every call supplies all four fields. On first use, the prior DelegationConfig is absent and the cooldown precondition is skipped. Preconditions:
  1. RunnerRegistration exists for sender.
  2. Let prev = registration.delegation_config. If prev is present (i.e., the runner has configured delegation before), block_height >= prev.last_updated + DELEGATION_COOLDOWN_BLOCKS.
  3. MIN_COMMISSION_BPS <= commission_bps <= MAX_COMMISSION_BPS.
  4. min_delegation >= MIN_DELEGATION_AMOUNT.
  5. If max_delegated_stake > 0, then max_delegated_stake >= delegation_totals.total_active (cannot retroactively break an existing cap).
Effects:
  1. Compute the commission transition:
    • If prev is absent: new_current = commission_bps, new_pending = None. (First-use takes effect immediately; there is no prior revenue stream to protect.)
    • Otherwise if commission_bps == prev.commission_bps AND prev.pending_commission_bps != Some(commission_bps): clear any queued change, new_current = prev.commission_bps, new_pending = None.
    • Otherwise (a genuine commission change): new_current = prev.commission_bps, new_pending = Some(commission_bps), new_pending_effective_epoch = current_epoch + 1.
  2. Write the resulting DelegationConfig:
  3. Emit DelegationConfigUpdated { runner, accept_delegation, current_commission_bps: new_current, pending_commission_bps: new_pending, pending_effective_epoch, max_delegated_stake, min_delegation, block_height }.
A runner may replace a still-pending change. The replacement resets pending_effective_epoch to current_epoch + 1, so it cannot shorten the one-epoch delay. Gas: UPDATE_DELEGATION_CONFIG_CYCLES (governance-tunable, default 15,000 cycles, 500 cells).

RunnerDelegateStake

This instruction creates a new Active tranche, for either a first stake or a top-up. §3.3.1 distinguishes it from RunnerIncreaseDelegation. Let summary = delegation_delegator_summary:{runner, sender} (empty struct if key is absent). Preconditions:
  1. RunnerRegistration exists for runner, health ∈ {Healthy, Paused}, and registration.delegation_config.accept_delegation == true.
  2. amount >= max(MIN_DELEGATION_AMOUNT, registration.delegation_config.min_delegation).
  3. If registration.delegation_config.max_delegated_stake > 0, then delegation_totals.total_active + amount <= registration.delegation_config.max_delegated_stake.
  4. sender_account.balance >= amount.
  5. summary.active_tranche_count < MAX_ACTIVE_TRANCHES_PER_DELEGATOR.
  6. If summary.active_tranche_count == 0: delegation_totals.delegator_count < min(cip13.max_delegators_per_runner, 200). Independently, admitting a sender with no outstanding tranche requires fewer than 200 distinct delegators in the runner index, counting both Active and Unbonding positions.
  7. The sender has fewer than min(cip13.max_tranches_per_delegator, 32) total outstanding Active + Unbonding tranches for this runner.
Effects:
  1. sender_account.balance -= amount.
  2. Allocate tranche_id := delegation_tranche_counter:{runner,sender}++.
  3. Write DelegationTranche { delegator: sender, runner, tranche_id, amount, created_at: block_height, status: Active, claimable_at: None }.
  4. Append tranche_id to delegation_delegator_index:{runner, sender}.
  5. Append (sender, tranche_id) to delegation_runner_index:{runner}.
  6. Update delegation_delegator_summary:{runner, sender}:
    • active_tranche_count += 1
    • active_amount += amount
  7. Update DelegationTotals:
    • total_active += amount
    • If summary.active_tranche_count was 0 before this tx: delegator_count += 1.
  8. Emit DelegationCreated { delegator, runner, tranche_id, amount, block_height }.
Gas: DELEGATE_STAKE_CYCLES (governance-tunable, default 25,000 cycles, 2,000 cells).
3.3.1 Relationship between Delegate and Increase
RunnerIncreaseDelegation is semantically DelegateStake for a delegator who already holds at least one Active tranche (i.e., summary.active_tranche_count > 0) for the target runner. Its separate opcode makes wire-level intent explicit and lets execution skip the MAX_DELEGATORS_PER_RUNNER check and the delegator_count bump. Both instructions MUST enforce MAX_ACTIVE_TRANCHES_PER_DELEGATOR, which bounds per-delegator settlement cost in §3.4. They also enforce the total outstanding Active + Unbonding tranche bound of min(cip13.max_tranches_per_delegator, 32). An existing delegator already occupies one of the runner index’s 200 identity slots.

RunnerIncreaseDelegation

Let summary = delegation_delegator_summary:{runner, sender}. Preconditions:
  1. Preconditions (1)–(5) and (7) of RunnerDelegateStake apply unchanged.
  2. summary.active_tranche_count >= 1 (the sender already has at least one Active tranche for this runner; otherwise RunnerDelegateStake is the correct instruction).
Effects:
  1. sender_account.balance -= amount.
  2. Allocate a fresh tranche_id. Top-ups never mutate existing tranches.
  3. Write the new tranche, update indices.
  4. Update delegation_delegator_summary: active_tranche_count += 1, active_amount += amount.
  5. Update DelegationTotals: total_active += amount; delegator_count unchanged.
  6. Emit DelegationIncreased { delegator, runner, tranche_id, amount, block_height }.
Gas: INCREASE_DELEGATION_CYCLES (governance-tunable, default 20,000 cycles, 1,500 cells).

RunnerUndelegateStake

This instruction starts unbonding amount CBY of the sender’s delegation to runner. It draws from the sender’s Active tranches oldest first by created_at, breaking ties by ascending tranche_id. A fully drawn tranche becomes Unbonding. If the last tranche is drawn only in part, it splits. The Active remainder keeps its tranche_id and the Unbonding portion receives a fresh one. Let summary = delegation_delegator_summary:{runner, sender}. Preconditions:
  1. summary.active_tranche_count >= 1.
  2. 1 <= amount <= summary.active_amount.
  3. The residual Active balance summary.active_amount - amount MUST be either 0 OR >= max(MIN_DELEGATION_AMOUNT, registration.delegation_config.min_delegation) (prevents dust Active balances).
  4. If the withdrawal requires a partial-tranche split, the pair has fewer than min(cip13.max_tranches_per_delegator, 32) outstanding Active + Unbonding tranches before the split. A full index rejects the split; moving a whole tranche to Unbonding creates no extra tranche.
Effects:
  1. Walk the sender’s Active tranches in FIFO order. Let r = amount. For each Active tranche t iterated:
    • If r >= t.amount (consume the whole tranche): set t.status = Unbonding, t.created_at = block_height, t.claimable_at = block_height + UNBONDING_BLOCKS. Decrement r -= t.amount and summary.active_tranche_count -= 1.
    • Otherwise (r < t.amount, final partial split): reduce t.amount -= r; the tranche keeps status == Active with its original tranche_id. Allocate a fresh tranche_id and write a new tranche u with amount = r, status = Unbonding, created_at = block_height, claimable_at = block_height + UNBONDING_BLOCKS; append u.tranche_id to the delegator and runner indices. Set r = 0. summary.active_tranche_count is unchanged by the split.
  2. Update summary.active_amount -= amount. If summary.active_tranche_count == 0, delete the delegation_delegator_summary key.
  3. Update DelegationTotals: total_active -= amount. If the sender’s summary.active_tranche_count fell from >0 to 0 in this tx, delegator_count -= 1.
  4. Emit UndelegationInitiated { delegator, runner, amount, tranche_ids, claimable_at } listing every tranche that transitioned to or was created as Unbonding.
During unbonding, an Unbonding tranche:
  • Does NOT count toward effective_stake for VRF selection or job value limits (§3.2).
  • Does NOT earn revenue share (§3.4 restricts payouts to Active tranches).
  • IS slashable while current_block < claimable_at, and ceases to be slashable at exactly claimable_at (§8.1).
Gas: UNDELEGATE_STAKE_BASE_CYCLES + UNDELEGATE_STAKE_PER_TRANCHE_CYCLES × tranches_touched (defaults: 20,000 base + 5,000 per tranche).

RunnerClaimUnbonded

The delegator names the tranches to claim. Explicit IDs bound the instruction’s gas and allow partial claims. The delegator reads them from the indexer (§7.2) or computes them locally. Preconditions:
  1. 1 <= tranche_ids.len() <= CLAIM_MAX_TRANCHES (default: 32).
  2. tranche_ids MUST be pairwise distinct. A repeated ID fails the whole instruction with InvalidData (receipt code 1213): no credit, no deletion, no deduplication.
  3. For each tranche_id:
    • DelegationTranche { delegator: sender, runner, tranche_id, .. } exists.
    • tranche.status == Unbonding AND block_height >= tranche.claimable_at (equivalently: is_claimable(tranche, block_height) per §3.1).
The duplicate check runs before every instruction state read or effect. A rejected duplicate claim is a charged failure. The sender’s nonce increments by one and only the transaction fee is charged. Effects:
  1. Let total = Σ tranche.amount over the supplied tranches.
  2. sender_account.balance += total.
  3. For each supplied tranche: delete the DelegationTranche record, remove its tranche_id from delegation_delegator_index:{runner, sender} and delegation_runner_index:{runner}.
  4. DelegationTotals is unchanged, because undelegation already decremented total_active and delegator_count counts only Active positions. Removing the sender’s last outstanding tranche does free one of the runner index’s 200 distinct-delegator slots.
  5. delegation_delegator_summary:{runner, sender} is unchanged (summary tracks Active only).
  6. Emit DelegationClaimed { delegator, runner, tranche_ids, amount: total }.
Gas: CLAIM_UNBONDED_BASE_CYCLES + CLAIM_UNBONDED_PER_TRANCHE_CYCLES × tranche_ids.len() (defaults: 10,000 base + 3,000 per tranche). A matured claim remains blocked while its runner has an active slash-drain lock (§3.6.1); it can succeed once the lock clears and the other instruction preconditions hold.

3.4 Settlement payout splitting

The Result Verifier (0x03) splits each runner’s portion between the runner and its delegators. Only Active tranches earn revenue (§3.3). Commission changes are epoch-delayed (§3.3 RunnerUpdateDelegationConfig), so settlement reads the rate through this function:
Promotion is idempotent. The first settlement in the new epoch writes the new commission_bps and clears the pending fields, and later settlements see the clean state. A settlement that finalizes in any epoch strictly before pending_effective_epoch reads cfg.commission_bps unchanged.
The pro-rata weight is the tranche amount. A delegator with several Active tranches is paid on each, which totals the same as weighting by the delegator’s sum. Rounding remainder from the runner and delegator split accrues to the runner. Remainder from the per-tranche distribution accrues to the lowest Active tranche_id. Payouts therefore sum exactly to runner_share_total. With T Active tranches per runner and M consensus runners, settlement performs M × T additional balance writes. The per-runner tranche count is bounded by MAX_DELEGATORS_PER_RUNNER × MAX_ACTIVE_TRANCHES_PER_DELEGATOR (see §4.2). At the defaults (200 × 8 = 1,600 tranches per runner), a 5-runner consensus pays out 8,000 tranche writes in the worst case. They are metered against the shared System lane budget (LANE_SYSTEM_CYCLES = 32,800,000) and the per-transaction Access ceiling (CIP-43 §8). This CIP does not show that the worst case fits. An implementation must bound or stage it before claiming that capacity.

3.5 Settlement events

The 0x03 system actor MUST emit structured events on every job settlement. These events are the canonical data source for delegation yield tracking and downstream compute finance products.
As of 2026-07, the runtime does not emit the JobSettled and DelegatorPayout events below, because the Result Verifier settlement path cannot yet push events. The runtime does emit the delegation-lifecycle events under a cip13. topic namespace: cip13.delegation.created / cip13.delegation.increased (DelegateStake / IncreaseDelegation), cip13.delegation_config.updated, cip13.undelegation.initiated, and cip13.delegation.claimed. These topic names are consensus-visible (they enter receipt_root) and differ from the bare JobSettled/DelegatorPayout names used in this section.

JobSettled event

Emitted once per job settlement:
Cost: 50 + data_length cells (existing emit_event pricing).

DelegatorPayout event

Emitted once per delegator payment within a settlement:
To avoid O(N) events per job for large delegator sets, this event MAY be batched as a single event with a list of (delegator, amount) pairs when the delegator count exceeds DELEGATION_EVENT_BATCH_THRESHOLD (default: 20).

3.6 Slashing cascade

When a runner is slashed for dishonesty (fabricated results, wrong model under TEE), the slash is distributed proportionally across the runner’s self-stake and every tranche that satisfies is_slashable(T, current_block) (§3.1). An Unbonding tranche that has reached claimable_at is not slashable, even if the delegator has not yet claimed it. The routine computes the slashable base during its iteration over tranches:
Per-tranche floor division under-slashes slightly, and the rounding residue stays with the delegator. Under-slashing is the safe direction. The per-epoch cap (MAX_DELEGATION_SLASH_PER_EPOCH_BPS, default 500 = 5%) limits cumulative delegator liability per epoch. It does not defer slashes. Runner self-stake is not subject to this cap, which bounds only the damage to passive capital. If a runner’s self-stake is exhausted and further slashing would exceed the delegator cap, the excess is not reapplied in a future epoch.

3.6.1 Bounded slash intents (rules-v2 regenesis)

The formulas in §3.6 specify the final economic result. Their full-tranche loop MUST NOT run in a timeout, deferred non-reveal classifier, or paid result/fraud transaction. An ordinary runner may retain 200 × 32 = 6,400 tranches, including Unbonding tranches; this exceeds an entire BlockStart allowance before any principal is changed. A delegated-runner slash instead enqueues a durable intent under the Runner Registry. The trigger records the requested amount, reason, beneficiary, offense height, slash distribution, and delegation epoch-cap policy. It applies the existing immediate reputation, payout-exclusion, and payment-withholding decisions. Job settlement, refund, and terminal-record retention do not wait for the stake pages. ResultSubmit plans delegation payouts only for its payable cohort, so an unpaid dissenter cannot force an unbounded payout reservation. The intent holds every liability input needed after the triggering job is deleted. The runner acquires a typed principal lock when its first intent is admitted. A registration mirror, slash_pending: true, excludes it from new selection; the final exposure check uses the live registration even when a candidate snapshot predates the intent. Dense baseline counts remain unchanged during a lock. If the bounded candidate draw supplies fewer runners than the provisional committee size but at least the governed minimum, new dispatch uses the actual available count and recomputes its two-thirds threshold. publish_chain_root retains its minimum of three. Shrinking toward the governed minimum lowers the absolute number of votes needed for the recomputed threshold; the governed floor is therefore a security parameter. This fallback adds no BlockStart accesses or second counter lifecycle. Delegation, undelegation, matured claims, deregistration, and direct rescue transfers remain blocked through the existing mutation guard. Earned payout credits from existing assignments are permitted: settlement credits liquid balances and may promote commission terms, but does not compound rewards into tranche principal or self stake. Only a timeout record with the original runner’s Slashable disposition authorizes a stake-funded rescue bonus (CIP-2 §6.3). If that runner is locked, the authorized bonus is frozen as a recipient/amount liability in the same per-runner FIFO; operational failure, no failure and an absent disposition create no entitlement. The frozen rescue intent is the durable evidence for this entitlement: a terminal job’s original timeout row can be reaped during a long queue delay, and its absence does not cancel payment. The bonus item transfers at most the remaining self stake after earlier slashes, then deletes the timeout row if it remains; bonus errors propagate so that the entitlement is never silently discarded. Claims that mature during the drain cannot escape an already-admitted liability. The lock clears only after the runner’s last accepted intent has finished. Unlocked registrations omit slash_pending from their serialization. Both full and borrowed registration decoders accept it as an optional trailing positional field, preserving the existing field sequence. Registration admission and every typed update reserve encoded headroom for the locked value, maximum-width chain-owned counters/configuration, and a maximum-width selection-snapshot wrapper. Each job-type name is limited to 128 bytes, but this alone is not the headroom proof: the typed writer validates the entire maximum-width serialized registration and snapshot wrapper, including every job-type entry, against the 65,536-byte storage-value limit. The same check runs on every typed update, preserving that bound inductively. Registry pool entitlements MUST remain empty while their admission is disabled; a future entitlement writer must extend the headroom invariant before enabling membership. Genesis initial_storage bypasses the typed writer and MUST NOT seed registrations that violate this bound. Competing slashes are distinct FIFO intents, with fixed-size per-intent records and constant enqueue work. There is no admission-count cap and no coalescing: a payerless slash cannot reject a block because 32 earlier slashes already occupy the queue. Governance policy, beneficiary and offense height are frozen separately for each intent. The principal snapshot and epoch accumulator for a queued intent are taken when its predecessor liabilities have finished, preserving sequential slash semantics. The principal lock prevents intervening stake/index changes. Planning evaluates Unbonding slashability at the frozen offense height, even when service crosses the tranche’s maturity or an epoch boundary. For a runner with T retained tranches, service uses three bounded traversals: sum the denominator, compute the exact sum of the per-tranche rounded reductions and final routing targets, then apply reductions in reverse index order. Each traversal visits at most eight tranches per page. Reverse order keeps the unprocessed prefix stable when zeroed entries are deleted. Every apply page preserves any current selection snapshot, updates totals and reverse indexes, and routes only a delta from the frozen final category budgets. A separate finalization item applies self-stake, the offense epoch accumulator, and final reputation/money updates exactly once. Only when final self stake is below MIN_STAKE_CBY_WEI does the reputation-reset branch stamp the dispute cooldown with the finalization height, not the frozen offense height. Finalization above that minimum does not re-stamp the cooldown. For T ≤ 8, all three data traversals fit one data page; finalization still owns a separate item. One indivisible service item reserves at most 256 structural Access units, inside the existing 1,089-unit BlockStart allowance. While intents are pending, even-height Timeout turns serve one slash item; odd-height turns remain ordinary timeout turns. An empty queue leaves ordinary timeouts enabled on every turn. Thus the guaranteed ordinary timeout service opportunity is halved while slash work is pending, including the session financial and access-cleanup maintenance performed by that same pass. Two empty-FIFO discovery reads are funded by moving two structural units from Container (reduced from 77 to 75) to Timeout (increased from 542 to 544), without changing the total allowance. Because later-pass floors are subtracted cumulatively, this also raises the Timeout ceiling from 821 to 823 and the Nonreveal ceiling from 928 to 930; a saturated block can therefore commit a different bounded work prefix even when no slash intent is pending. The measured worst-case service fixture uses 189 units, leaving 67 within its 256-unit reservation. Paused registry work and retryable actor-storage capacity can defer service without discarding its cursor or liability. A non-empty paused discovery costs about ten structural units and then ordinary timeout processing returns early for the same paused registry, preserving the Timeout floor. For a maximum-size runner, the bound is 3 × ceil(6,400 / 8) + 1 = 2,401 items, or at most 4,802 blocks after it reaches the FIFO head, excluding pause/capacity deferral and corrupted-state recovery turns. With Q maximum-size intents already ahead at admission, completion requires at most 4,802 × (Q + 1) blocks under continuous service. Later admissions cannot overtake it. Queue length evolves as Q_next = Q + admitted_slash_events - completed_intents; its per-block growth is bounded by the slash events admitted by the existing transaction and BlockStart budgets. There is no arrival-independent backlog cap or guarantee that sustained arrivals drain faster than they accrue. RevealAuction retains its permissionless bounded drain and uses the same principal-lock and progress representation; its separately queued competing slashes also use fixed-size FIFO nodes without an admission cap. Its existing 32-tranche permissionless page allowance is unchanged. The BlockStart bound above applies to the eight-tranche service FIFO. A Service lock can delay a solver’s permissionless RevealAuction grief slash until that service owner clears; its markers remain retryable. Conversely, slashes and rescue transfers accepted under a Reveal lock are parked in the permissionless locked_slash: FIFO and require a later RevealAuction call. They are outside the BlockStart completion bound. Durable state added for this service is slash_intent_queue (FIFO head/tail), slash_intent_tail (independent tail backup), slash_intent_live (independent live-tail marker), slash_intent: || sequence_be8 (primary frozen slash or rescue-transfer intent/progress record), slash_intent_recovery: || sequence_be8 (recovery copy), slash_intent_owner: || sequence_be8 (runner, next same-runner intent, current owner tail, cursor hash, and an optional independent rescue recipient/amount/job-id witness), slash_intent_reverse: || bitwise_not(sequence)_be8 (bounded last-node index), slash_runner_owner: || runner20 || sequence_be8 (independent same-runner forward link), slash_runner_rev: || runner20 || bitwise_not(sequence)_be8 (independent same-runner last index), and a typed owner in delegation_reveal_slash_lock:{runner}. The permissionless competing queue stores head/tail plus locked_slash: || runner || sequence_be8 nodes. Admission atomically writes the node, header, tail backup, registration mirror and owner lock, including competing admissions; fraud conviction propagates admission failure so its transaction rolls back. A missing or malformed header is reconstructed from its tail backup and bounded first- and last-node scans over the independent ownership and inverse-sequence indexes. Discovery cross-checks the header tail with its backup and live-tail marker, and the head with the first ownership node; a plausible truncated or advanced header cannot silently skip liability. A separate live-work marker detects work when both header and tail-backup rows are missing. Admission and service share bounded ownership reconciliation: a pending registration requires its typed lock to agree with the first independently indexed owner and its tail. Missing, malformed, or stale locks are rebuilt using limit-one runner-prefixed forward/reverse scans, and a competing intent is linked after the true last owner. Forward links and inverse rows are written and deleted atomically with ownership nodes; repair emits an attribution audit. A held Reveal owner is never replaced or cleared by Service reconciliation, admission, or retirement. Competing admission parks under Reveal; if a Service head coexists with that owner, Service stalls until Reveal releases it. A healthy first admission takes at most 23 structural units; healthy service Plan/RoutePlan/Apply/Finalization maxima are 36/34/67/55, and the small zeroing/snapshot fixture takes 130/189. Corrupted-state recovery and admission are also bounded by the existing service/classifier reservations. Paid slash admission reserves Rk(81)+Wk(61)+5*Scan(1) after its index read: two runner-frontier scans, global discovery, and two header-rebuild scans. Payerless callers charge those actual operations through their counting store within their existing item reservations. Repair observations have protocol scope and are not bound to the transaction that encountered the damaged shared row. A Data failure in Service-queue metadata during payerless reconciliation or linking rolls back the attempted admission, then uses the surviving metadata/indexes to admit the new liability with a fresh owner and audited disposition; when old attribution is unavailable, the new intent is admitted as the runner’s sole owner. Recoverable older liabilities remain linked through the independent runner index. A corrupt RunnerRegistration field, including its slash_pending mirror, or a corrupt selection-snapshot override can still fail payerless BlockStart. That registration-row class is outside this recovery guarantee. Infrastructure failures still propagate. Every cursor page atomically updates a primary copy, a recovery copy, and the cursor hash in its independent ownership row. Either intact copy repairs a missing, malformed, or altered peer; a damaged lock is rebuilt from the ownership row. Repair consumes a service item and emits a zero-amount runner.slash attribution record, then the original economic liability resumes. If neither copy matches the recorded hash, the service atomically discards that unrecoverable intent and transfers the lock to its next same-runner intent, or clears the lock and registration mirror when none remains. For a slash, the discard audit explicitly records that previously committed reductions and routing remain and the unrecoverable remainder is retired; it does not reverse committed pages. For a rescue entitlement, the independent ownership witness supplies its recipient, amount and optional job id: the audit records rescue_entitlement_retired_without_payment and timeout_record_disposition=retained or already_absent according to the original row’s presence (or not_applicable when there is no job id). Disposal does not delete the original timeout row, which may already have been reaped. This fallback assumes the independent attribution/link records remain intact; loss of those records together with both cursor copies is outside the bounded recovery guarantee. A Data fault that prevents service repair or disposal rolls back that turn and records slash_family_stalled_data; the whole global service queue stalls, including later intents for unrelated runners, but the block commits. A persistent Data fault has no time bound: service remains stalled until an operator repairs it. It does not discard an intact cursor merely because another index is damaged. Typed storage-capacity failures defer without dropping liability. The runner-registry actor is currently exempt from key-count and byte quotas. Infrastructure errors propagate. Completed nodes are deleted, and an empty queue deletes its metadata only after the bounded ownership-frontier scan confirms no intent remains. No activation height or new structured error is introduced. Intermediate roots, registration bytes while locked, and slash fee observations change as the work commits across blocks; under normal execution or successful cursor repair, final principal and routing balances equal sequential atomic slashes under the same frozen policies.

3.7 Runner deregistration with active delegations

RunnerDeregister MUST handle delegations by writing claimable_at values. It schedules nothing (§3.8).
  1. The runner MAY first set accept_delegation = false (via RunnerUpdateDelegationConfig) and wait for all delegators to undelegate voluntarily, OR
  2. The runner MAY submit RunnerDeregister, which force-initiates unbonding for all Active tranches on the runner. For each Active tranche T held against the runner:
    • Set T.status = Unbonding, T.created_at = block_height, T.claimable_at = block_height + UNBONDING_BLOCKS.
    • Decrement total_active by T.amount and update each affected delegator’s DelegationDelegatorSummary (active_tranche_count, active_amount).
    • When a delegator’s active_tranche_count drops to zero, decrement DelegationTotals.delegator_count and delete the summary key.
  3. The runner’s self-stake enters its own unbonding window by writing registration.self_stake_unbonding_claimable_at = block_height + UNBONDING_BLOCKS on the RunnerRegistration. The self-stake amount remains in the registration (not on the runner’s balance) until claimed; it is slashable while block_height < self_stake_unbonding_claimable_at per the same rule that applies to tranches (§3.1).
  4. registration.health transitions to Deregistered immediately. The runner is excluded from VRF selection and receives no further settlements.
  5. Delegators claim matured tranches via RunnerClaimUnbonded at a block ≥ T.claimable_at, once any active slash-drain lock has cleared. The runner claims self-stake via the separate runner registration lifecycle flow at or after self_stake_unbonding_claimable_at, subject to the same lock.

3.8 Unbonding maturity (no state transition required)

No scheduled pass moves Unbonding tranches to another state, and the Registry keeps no unbonding_queue. A scheduled pass could fall behind its cycle budget and leave tranches slashable past their advertised claimable_at. A tranche’s claimable_at alone determines maturity. Maturity needs no processing budget. At claimable_at, the is_slashable predicate (§3.1) returns false and the claim precondition holds. An active slash intent still evaluates its frozen offense height and blocks RunnerClaimUnbonded until the principal lock clears (§3.6.1). Indexers SHOULD index tranches by (runner, claimable_at) to answer “what is claimable now?” queries efficiently, but consensus does not require this index. Runner self-stake unbonding follows the same rule on the registration record (§3.7).

4. Parameters

Parameters are governance-tunable via CIP-12 Tier 0 proposals, subject to the protocol clamps in §4.2.

4.1 Timing

4.2 Stake limits

This CIP specifies no eviction policy for a full delegation index.

4.3 Slashing

4.4 Revenue


5. Entitlement interaction

Cowboy runners are heterogeneous. A runner supporting TEE + Llama 405B earns revenue only from jobs requesting those capabilities. Delegators are implicitly betting on the demand profile of the runner’s entitlement set. Delegators SHOULD evaluate a runner’s capabilities, historical job volume, and entitlement coverage before delegating. The settlement events (§3.5) provide the data for this evaluation. Third parties can build products that spread or target this risk:
  • A fleet-as-a-fund actor accepts CBY deposits, delegates across runners in several entitlement classes, and issues CIP-20 share tokens.
  • An entitlement-specific pool backs a single entitlement class, such as a “TEE H100 Pool”.
  • A settlement-event dashboard, from a third party or Watchtower, aggregates demand per entitlement class.

6. Interaction with CIP-12 governance

6.1 Vote weight of runner-delegated stake (v1: zero)

CIP-12 §6.2 defines stake-chamber vote weight as CBY staked to validators (self-stake and validator delegation both count). Validator staking is an operational, consensus-layer commitment; runner delegation is an economic, compute-market commitment. In v1, runner-delegated CBY has zero governance vote weight. A holder who wants both vote weight and runner yield must split CBY between the two systems. Under CIP-12’s rule that staked CBY has weight and unstaked CBY has none, runner-delegated CBY is a third category with no vote weight. A future CIP MAY extend CIP-12 to grant vote weight to runner-delegated stake. The delegator would vote directly. The runner would not inherit the vote.

6.2 Governance-tunable parameters

All parameters in §4 are registered in the 0x09 Governance actor’s params store at genesis. Changes require a Tier 0 proposal (CIP-12 §5.1). The settlement config (runner_percent, burn_percent, treasury_percent) is already governance-tunable per CIP-12; this CIP does not alter it.

7. Implementation notes

7.1 State and scheduling

  • RunnerRegistration carries delegation_config: Option<DelegationConfig>. Registration initializes empty DelegationTotals and the tranche counter namespace. RunnerDeregister force-unbonds all Active tranches per §3.7.
  • Delegation state lives entirely under the 0x01 Runner Registry actor. Status transitions and totals updates happen inline, with no end-of-block hook (§3.8).

7.2 RPC additions

The indexer SHOULD expose:
  • GET /runners/{address}/delegations, list all tranches (all statuses) grouped by delegator for a runner
  • GET /accounts/{address}/delegations, list all tranches (all statuses) grouped by runner for a delegator, including each tranche’s tranche_id, amount, status, and claimable_at (required for clients building RunnerClaimUnbonded transactions)
  • GET /runners/{address}/delegation_stats, totals, APY estimate, effective commission
  • GET /delegations/unbonding, global unbonding queue (useful for liquid staking protocols)

8. Security considerations

8.1 Slash-and-run prevention

Under §3.1’s is_slashable predicate, an Unbonding tranche stays in the slashing base while current_block < tranche.claimable_at, the full UNBONDING_BLOCKS window. Block height alone decides this, so no tranche leaves the base early. A delegator cannot front-run a slash by undelegating.

8.2 Storage griefing via delegation

An attacker could split a position into many small tranches, or spray small delegations across many runners, to inflate storage. These limits mitigate it:
  • MIN_DELEGATION_AMOUNT protocol floor (1,000 CBY) enforced in RunnerDelegateStake / RunnerIncreaseDelegation preconditions
  • delegation_config.min_delegation runner-set floor
  • MAX_ACTIVE_TRANCHES_PER_DELEGATOR cap (default 8) bounds Active tranches per delegator for a single runner
  • cip13.max_tranches_per_delegator, clamped to 32, bounds total outstanding Active + Unbonding tranches per (runner, delegator)
  • The runner index bounds distinct delegators with outstanding Active or Unbonding tranches to 200; cip13.max_delegators_per_runner is also clamped to 200
  • Gas costs for delegation instructions (delegate, increase, undelegate) that scale with tranche touches

8.3 Commission manipulation

A runner could set commission to 0%, attract delegators, then raise commission to 100%. These rules mitigate it:
  • DELEGATION_COOLDOWN_BLOCKS between config changes
  • Commission updates wait until the epoch boundary to take effect
  • Delegators can monitor RunnerUpdateDelegationConfig events and undelegate before the new rate applies

8.4 Concentration risk

VRF weight is linear in effective stake (CIP-2 §5.3), so delegation scales selection probability proportionally. The √reputation factor tempers concentration: a 4× reputation gap yields only a 2× weight gap.

8.5 Cascading slashes in multi-runner pools

A third-party pool actor that delegates across multiple runners faces correlated slash risk if multiple runners misbehave in the same epoch. The per-epoch cap (§3.6) limits exposure per runner, but pool-level risk is the pool operator’s responsibility. The protocol does not manage it.

9. Future work

9.1 Liquid staking token (stCBY)

A reference pool actor could accept CBY, delegate across a diversified runner set, and mint a CIP-20 share token (stCBY). The protocol does not specify this product.

9.2 Prepaid compute forwards

A runner or runner pool with enough effective stake can commit capacity for forward delivery. The buyer deposits CBY into a forward contract actor. The runner accepts and backs the commitment with delegated and self-bonded stake.

9.3 Compute demand indices

The JobSettled events (§3.5) supply raw data for compute demand indices and oracles. Watchtower feed actors can aggregate them per epoch by entitlement class, model, or TEE status. DelegatorPayout events support yield tracking. Aggregation belongs in actors.

9.4 Delegation marketplace

A future CIP or actor may provide an on-chain marketplace where runners advertise delegation terms and delegators can compare runners by commission, entitlements, historical yield, uptime, and slashing history.

9.5 Atomic redelegation

An atomic RunnerRedelegateStake instruction would move stake between runners without a full unbonding cycle. Until the source runner’s slash window expires, the moved stake would be slashable by both the source runner, for earlier misconduct, and the destination runner, for later misconduct. The CBY exists only once. This dual-liability accounting is outside v1. For v1, delegators who wish to move stake between runners MUST undelegate, wait UNBONDING_BLOCKS (~24h), and then delegate to the new runner. Liquid staking pools can hide the delay from users with a reserve buffer. A future CIP MAY introduce atomic redelegation with a proper dual-liability model (Cosmos’s “redelegation hop” is the nearest precedent).

9.6 Governance vote weight for delegated stake

A future CIP may extend §6.1 once live operation shows whether runner-delegated stake should carry vote weight and how to weigh it against validator-delegated stake. The delegator would vote directly. The runner would not inherit the vote.

10. Rationale

Runners set their own commission. A protocol-fixed rate would either overpay runners and discourage delegation, or underpay them and discourage runner operation. As in io.net and Fluence, supply and demand set the rate. The MIN_COMMISSION_BPS floor prevents a race to zero. Unbonding takes 24 hours, not the 7 days common in PoS. Runner hardware, entitlement demand, and registrations change quickly, and a 7-day window would lock delegator capital through several demand shifts. 24 hours still exceeds the 15-minute dispute window (whitepaper §5). Governance can raise it if slashing dynamics require. The 10% minimum self-bond means a misbehaving runner loses its own capital. A runner with no self-bond would risk only its reputation. Governance can adjust the rate. The protocol charges no separate delegation fee. Commission is set between runner and delegator. A pool’s management fee is an actor-layer matter between the pool and its depositors. DelegatorPayout events are batched above a threshold because per-delegator events grow as O(runners × delegators) per job. With 5 runners and 200 delegators each, one settlement would emit 1,000 events. Below the threshold of 20, direct delegators still see per-job payouts. Partial undelegation leaves an Active remainder and a separate Unbonding position for the same (runner, delegator) pair, with distinct amounts, timestamps, and claim states. One record per pair cannot hold both, so the Registry uses tranches. Each tranche has one status, one amount, and one timestamp, which keeps slashing and top-ups exact. Storage growth is bounded by MAX_ACTIVE_TRANCHES_PER_DELEGATOR × MAX_DELEGATORS_PER_RUNNER. The runtime computes the slashable base when needed. An Unbonding tranche leaves the base at current_block >= claimable_at (§3.1). A cached sum would need a per-block maintenance pass or a block-height-dependent invariant. Slashing already iterates every slashable tranche, so computing the base in the same pass costs nothing extra. Atomic redelegation waits for a dual-liability accounting specification (§9.5). Delegators can move between runners by undelegating and delegating again in ~24h, or use liquid staking pools that absorb the delay.

Part II — v2 Revision (canonical; opcode renumbering + explicit amendments)

0. What this revision does

Part II carries the master SystemInstruction opcode table (§1). It also states the CIP-2 §5/§6 amendments for VRF weight and max job value that Part I implies (§2–§3).

1. Master opcode allocation table

The wire opcode constants in the protocol codec revision that node pins, with node dispatch, determine opcode allocation. Before allocating, check that revision, the pending reservations in this table, and open protocol PRs. A reservation holds its slot even before node pins the codec. The whitepaper’s system-actor address registry is a separate namespace and does not establish opcode availability. The table enumerates every SystemInstruction opcode in the protocol codec. A slot marked free has no constant and no decoder; a retired slot MUST be rejected by the decoder and MUST NOT be reassigned. Codec allocation, node integration and deployment acceptance are separate states. An allocation in the protocol codec holds its slot whether or not node’s pinned codec includes it. Proposed allocations (not in code): CIP-29 (Event Subscription) uses neither a SystemInstruction opcode nor a deployed actor. The host intercepts call_actor calls targeting the dedicated address EVENT_SUBSCRIPTION_SYSTEM_ACTOR = 0x1D and dispatches them natively. No master-table allocation is required.

2. Explicit amendment to CIP-2 §5 (VRF selection)

CIP-2 §5.4 defines VRF selection using weights[i] = stake_to_weight(candidates[i].stake). CIP-13 v2 amends:
Amended: weights[i] = stake_to_weight(effective_stake(candidates[i])) where effective_stake(R) = R.registration.stake + R.delegation_totals.total_active. The weight function is unchanged from CIP-2 §5.3: w = effective_stake · max(√(reputation / REPUTATION_NORMALIZER), w_min_floor), linear in effective_stake. This applies to every dispatcher selection that occurs at or after CIP-13 activation.

3. Explicit amendment to CIP-2 §6 (max job value)

Amended: rate_card.max_job_value <= effective_stake × STAKE_JOB_MULTIPLIER_DENOM / STAKE_JOB_MULTIPLIER_NUM (default 1.5×). effective_stake includes Active delegated tranches per §2 above.

4. Slashing routing reuses CIP-3 SettlementConfig

Part I §3.6 routes slashed_total 50/50 between treasury and burn. That split is the default. The runtime SHOULD read it from system:settlement_config.slash_treasury_percent (CIP-3 / SettlementConfig) so governance can tune slashing routing with other settlement routing. The per-tranche math is unchanged.

5. Vote weight in CIP-12 (carry-forward, no change)

Part I §6.1 stands: runner-delegated CBY has zero governance vote weight. Validator-delegated stake keeps full vote weight per CIP-12 §6.2. A future CIP MAY revisit this.

6. Interaction with CIP-23 (TEE delegation)

A runner with a TEE measurement_binding (CIP-23 §3.7) MAY accept delegations, with these effects:
  • Delegated stake counts toward the runner’s effective_stake for VRF weight (§2 above) and for max job value (§3 above).
  • Delegated stake does NOT affect TEE eligibility. Eligibility depends solely on measurement_binding.status == Active && expires_at > submission_block (CIP-23 §3.8), with no stake threshold.
  • Slashing of a TEE runner under CIP-23 (e.g., for forged CompositeAttestation) cascades to delegators per the v1 §3.6 algorithm, capped at MAX_DELEGATION_SLASH_PER_EPOCH_BPS = 500 (5%). Self-stake is uncapped and fully slashable for TEE forgery (CIP-23 v2 Part II §3).

7. Backwards compatibility

CIP-13 has not been deployed. The CIP-2 §5/§6 amendment binds dispatcher and max-job-value computations after activation. It affects no existing jobs because delegation cannot exist before CIP-13 is active.