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.
CIP-7 precedent: references below to committee-delivered stream keys describe the retired CIP-7 design. Replacement Watchtower uses service-delivered keys and cumulative usage authorization; these historical comparisons do not make the retired SKM/SealRequest interfaces dependencies of this CIP.
Background
An actor marketplace needs machine-readable hiring terms, creator-controlled distribution rights and enforced payments. Leaving fee splits and revocation to individual stores lets a store ignore them.Goal
Specify actor hiring and distribution through the Trading Post system actor, including access to private code.Abstract
This CIP defines how actors declare hiring terms and creators authorize stores to distribute them. Hire payments execute declared fee splits. Review attestations bind reviewer identities to exact code snapshots. CBSS key leases control access to private actor code without consensus changes. Any party may operate a store. No store, including Cowboy Labs’ store, has protocol privileges. Direct hiring works unless the creator gates it (§2.1.5). A creator may gate any hiring path so that a new hire needs a signed pass from a gate signer, whose admission policy stays off-chain. The protocol specifies the mechanics of publishing, hiring, splitting, and attesting; it is silent on review policy, curation, and commission rates, which are store-level products. All hiring state and logic live in one governance-controlled system actor, the Trading Post. The Shared-mode path needs no consensus change; Forked-mode instance hiring (§2.6.4) is future CIP-33 activation work. It depends on the CIP-27fork amendment and two mailbox changes, message-origin
exposure and escrow-funded directive gas. None is activated by CIP-40’s
decoder-only kind-1 arm (§1.2, §2.6.5).
1. Motivation
1.1 Store mechanics belong in the protocol; stores do not
An agent marketplace needs five mechanics no single app should own:- Hireability, a machine-readable statement that an actor can be hired, under what terms, by humans and by other actors.
- Distribution rights, creator-controlled authorization for a store to sell access to the actor.
- Fee splits, hire revenue divided among creator, store, and referrers exactly as declared, atomically with payment.
- Attestation, verifiable review verdicts bound to exact code snapshots, so trust survives redistribution.
- Enforcement, for private-code actors, access that can be granted, metered, and revoked without trusting the storefront.
1.2 Enforcement rides existing cryptography; Forked hiring is a future protocol change
For private-code actors, the code volume is encrypted (CIP-9). An instance can only execute if the data encryption key (DEK) reaches the executing runner. Key delivery already flows through CBSS (CIP-24) under chain-state-conditioned policy (CIP-7 precedent). The Trading Post controls DEK delivery by gating share issuance on hire/lease state. This enforces paid access through control of decryption, not distribution. Payment enforcement and private-code protection use the same mechanism. The Shared-mode hiring path in this CIP needs no consensus change: it is all Trading Post system-actor logic over existing protocol operations. Forked-mode hiring (§2.6.4) introduces three consensus-level changes in a later CIP-33 activation: (1) the CIP-27fork amendment (a new host syscall),
(2) mailbox delivery preserving Message.from into the delivered
frame’s sender (§2.6.4, needed for spawn-directive provenance), and
(3) escrow-funded directive gas. The spawn directive’s materialized
deferred transaction draws its fees from the hire’s gas escrow under a
pinned budget. The current rule borrows origin gas with no
caps (§2.6.4). These dependencies must be implemented together; the
design principles below (§1.3) describe the Shared baseline.
1.3 Design principles
- Store registration is open, and no store has protocol privileges. The Trading Post grants every store identical powers, scoped to its own grants.
- Creators decide which stores may distribute their actors. Grants are non-exclusive by default and revocable.
- A hire with no store involved MUST work unless the creator gates it (§2.1.5); a store is a discovery and trust layer and cannot impose a toll on ungated direct hires.
- Cryptography and settlement enforce hiring without consensus changes. Leases gate key delivery; the Trading Post gates payment flows. Validators are unmodified.
- Applications define review standards, curation, and pricing of trust. The protocol records outcomes as attestations, not opinions.
2. Specification
2.1 The Trading Post system actor
The Trading Post is a system actor deployed at genesis at the well-known address0x1E (TRADING_POST_SYSTEM_ACTOR), upgradeable
only through CIP-12. It holds all hiring state and executes all hiring flows
as ordinary actor methods. Codec-level monetary amounts are u128 (CIP-20
token base units use the full width), but this CIP owns the native
boundary: the NativeCby ledger and its debit/payout paths are u64 wei
(1 CBY = 10^9 wei), so for PaymentAsset::NativeCby every amount
(price.amount, initial_due, prepaid, reserved, and each split
leg) MUST fit u64, checked at method intake before any escrow or
transfer (the stable first rejection for an over-wide native amount),
and every aggregate uses checked u64 add/sub thereafter, using
the required try_from + checked_add checks. The ledger is not widened.
State objects (canonical encodings follow the conventions of CIP-20 state):
2.1.1 Declaration identity
declaration_id = H(creator ‖ actor ‖ salt) with a caller-chosen salt
supplied to declare, which recomputes and verifies the hash. Ids are
therefore known to the creator before the declaration exists, so the
artifact’s CIP-24 volume-DEK wrap (§2.5.1) and every id-bearing record can
be produced client-side in one step. No draft/activate round-trip is needed, and
nobody can squat an id bound to another creator.
2.1.2 Methods
Each method emits a CIP-29 event named for the transition.
The escrow argument to
declare and declare_version is
ArtifactEscrow
in the existing Cowboy protocol wire types. It supplies artifact 0, including
its existing ibe_ciphertext. The same visibility check
applies when artifact 0 is created: Public requires empty bytes and Private
requires nonempty bytes. Store artifact registration supplies the field through
RegisterArtifactArgs. Consensus checks only this empty/nonempty condition.
Serving roots and the Public volume pin
DeclarationVersion.manifest_root is the immutable
publisher source root. Artifact 0 MUST record this root. A Private Store
artifact MUST record it as a signed source-content claim (§2.5.1), not as
the actual committed root of its destination volume. A Private copy can have
a different destination commitment because its descriptors and encryption bind
to that volume. At registration, every Store destination StorageCommitment
MUST exist, be Active, and belong to the Store operator. A Private version
also requires a Private destination. Its claimed_root MUST equal the
version source root; its destination commitment root need not equal that
claim. The §2.2 ownership-consent rule also applies. Node commit
e89078ff implements these Private destination checks without requiring
destination-root equality.
Public and Private here refer to the version’s code_visibility. For a Public
Store artifact, claimed_root MUST be the actual committed
manifest root of its destination volume_id. It MAY differ from the source
root: CBFS file descriptors bind to a volume, so an equivalent copy in a
different volume can have a different manifest root. Both roots MUST be
nonzero. At registration, the destination StorageCommitment MUST also have
Public visibility and manifest_root == claimed_root. The existing
authority, grant, and artifact uniqueness checks still apply. ibe_ciphertext is an existing
field of the RegisterArtifactArgs wire type and ServingArtifact record.
The registrant supplies these opaque bytes; consensus only checks that they
are empty for Public artifacts and nonempty for Private artifacts. This check
does not validate a Private DEK wrap or prove copy equivalence. The actual
volume DEK material and release rules remain on StorageCommitment (§2.5.1).
This CIP assigns the field no content, encoding, or consumer. It is kept for
wire compatibility, and the empty/nonempty rule only tags visibility. It is not
a security control, and no key release reads it.
This destination lookup is an additional consensus point read. The
TradingPostRegisterArtifact access reservation is Rk=13, Wk=6 in access-weight
table version 16 at node commit 13de6a65. This includes the
Public-volume pin and the permanent §2.2 reverse index. The same table
reserves Rk=3, Wk=4 for TradingPostDeclare and Rk=5, Wk=4 for
TradingPostDeclareVersion because artifact 0 also enters that index.
Validators MUST activate this validation and pin with the final measured
access table at regenesis (§11 of CIP-43); mixed old and new validation is not
supported.
Conformance tests MUST reject an absent destination commitment (including when
source and destination roots match), a wrong owner, and non-Active status for
either visibility. Public registration MUST reject a Private destination,
destination-root mismatch, and either zero root. Private registration MUST
reject a Public destination or a claimed root different from the version source
root; it MUST accept a distinct Private destination root when all other
conditions hold. A valid Public commitment MUST reject nonempty ciphertext and
accept empty ciphertext when all other registration conditions hold.
For a Public Store artifact, the signed registration binds
(declaration_id, version) to the destination
(volume_id, claimed_root) and identifies the responsible Store operator.
The immutable version identifies the source root. Before registration, the
Store MUST verify that the pinned source and destination contain equivalent
paths, entry types, file bytes, content types, metadata, and link targets.
This verification is outside consensus. Registration records the Store’s
equivalence claim; it does not prove that claim (§4). This amendment adds no
transaction field or attestation type; ibe_ciphertext predates it. A
per-volume pin count includes one reference for each Active Public Store
artifact, each non-Revoked hire pinned to a Public Store artifact regardless
of whether that artifact is Active or Retired, and each Pending Forked spawn
pinned to such an artifact, even after its finalize deadline until its state
becomes terminal. Registration and Shared hire creation each add one reference;
retirement and irrevocable hire revocation
each remove one. A Forked spawn adds its reference when it becomes Pending,
transfers that reference to its Hire at finalization, and removes it on
reclaim. Each update occurs exactly once and atomically with its state
transition. The count is a JSON u64 in Trading Post actor storage under
public_volume_artifacts: followed by the 32-byte volume_id; zero removes
that key. It is separate from the RAS StorageCommitment and survives its
status changes and rent-driven garbage collection while nonzero. Direct manifest
commits, staged finalization, volume-owner transfers, and owner-initiated
volume deletion MUST reject while this Store-volume pin count is nonzero.
An owner delete_object operation that changes the committed manifest follows
the direct-commit guard. delete_object is not a separate onchain instruction:
it submits a manifest commit, so it uses the CommitManifest or staged-finalize
access row (CIP-43 §5.5).
Direct-hire artifact 0 has no Store registration and does not enter this count.
Retirement stops new hires but MUST NOT
release the pin for existing hires. Active, Paused, and Lapsed hires retain
it: a paused hire can resume, a lapsed hire can renew, and a OneShot hire can
serve after retirement. The pin is released only after the artifact is Retired
and every hire pinned to it is irrevocably Revoked (and no pending Forked
spawn can finalize into a hire). The release transition MUST be atomic with
the last such terminal hire or spawn transition. The existing RAS identity
rule rejects CreateVolume for any occupied deterministic volume_id. A
garbage-collected volume retains its commitment as a terminal ID tombstone;
neither owner deletion nor rent-driven garbage collection permits recreation
under a live hire. This identity rule does not require a new pin read on
creation. Rent settlement and expiry remain unchanged; this pin does not prove
availability. Node commit d60babed implements the hire-lifetime count
for Shared hires and rejects owner deletion while the count is nonzero. Its
delete row was introduced in access table version 15 and was retained in the
historical version-16 record (§5 of CIP-43). Forked spawning is not implemented there. reclaim_spawn becomes permissionless from finalize_deadline + 1 in
this future Forked release: anyone may trigger the terminal CAS and atomic pin
release, but all refunds go to the pinned hirer. Expiry alone does not mutate
state. This bounded recovery path and finalize/reclaim race tests MUST be
implemented before Forked Public Store copies activate. The historical hire and revoke access rows were introduced in table
version 14 and retained in version 16 (§5 of CIP-43). The current
access table is 43.
Node rent settlement can still move a pinned volume to GarbageCollecting and
destroy its bytes. A pin prevents owner deletion, root mutation, transfer, and
ID reuse; it does not stop rent-driven garbage collection. The protocol has
not selected a rule for keeping such a volume funded or for ending a perpetual
OneShot serving obligation when its bytes are lost. Until that decision and
its Node implementation are complete, this amendment cannot claim perpetual
availability for Public Store hires. A non-Revoked OneShot or Lapsed hire
retains its pin indefinitely under the current lifecycle; revocation is the
only defined terminal hire transition and can strand a OneShot hirer (§2.4).
The pin covers only Public Store artifacts. A Private Store artifact’s
destination volume has no consensus pin: the Store operator, which owns it, can recommit, transfer, or
delete that volume while Private hires pinned to the artifact remain live, and
those hires then mount whatever the volume holds. The signed source-root claim
(§2.5.1) is checked only at registration; nothing onchain ties the destination
volume to that claim afterward. Private destination roots are not required to
equal the claim, so the Public root-equality guard cannot apply unchanged. This
is an unresolved gap: until a Private destination rule and its Node
implementation are selected, this CIP does not claim that a Private Store copy
remains stable for its live hires.
Conformance tests MUST reject pinned-volume deletion and any attempt to create
an already occupied volume_id, including a garbage-collected tombstone. They
MUST also reject
a pinned staged finalize when its proposed root equals the current root.
For Shared-mode content, a Store
approval MUST apply to the serving claimed_root (§2.7), not only to the
source root. Forked-capable versions retain their ExecutableV1
attestation requirements, which bind the source version but do not cover a
distinct Public serving root. This CIP does not yet define a complete
attestation rule for Forked hires that use a Public Store copy. That combination
requires a serving-root binding before it can claim attested code.
The read-only methods are callable in-PVM via call() and exposed
over node RPC / the indexer for off-chain readers. Host cross-call interception
reaches only 0x1D and the stream-key manager. This CIP extends
it with a read-only, deterministic bridge to these methods.
Each method has argument/result codecs with golden
vectors. The bridge meters calls as ordinary cross-call reads at the CIP-3 read
schedule. Unknown methods and malformed arguments return InvalidInput; absent
records return NotFound, a HostError the caller observes. Neither faults.
The bridge prevents state mutation by dispatching only to the read-only handlers. The §2.6.4 activation
gate depends on this bridge. The methods are get_declaration(id),
get_version(id, v), list_artifacts(id, v), get_grant(id),
get_hire(id), get_pending_spawn(hire_id), get_consent(declaration, version), get_reservation(reservation_id), list_grants(declaration), list_attestations(subject), get_serving(hire_id) (returns serving_actor).
Discretionary control belongs only to (a) the
creator, for their own declarations, versions, and grants, (b) a store, for
artifacts it registers under its own active grant, for hires routed through
its own grants, and for its own gate signer (which admits only to grants the
creator marked gated, and to direct hires of a declaration whose creator
set its direct-hire gate to Store of that store, §2.1.5), (c) the hirer, for their own hire’s funds and renewal
choices, or (d) a listed or template actor (itself or via its owner), for
consent on listings naming it (§2.1.3). Permissionless methods may trigger only
precommitted, deterministic transitions: deposit adds funds without taking
control; renew obeys the pinned terms and hirer’s renewal choice;
finalize_spawn verifies the pinned spawn proof; and reclaim_spawn after
finalize_deadline atomically refunds only the pinned hirer and releases the
pending pin (§2.6.4). These callers cannot change terms, beneficiaries, consent,
or renewal choices, or claim another party’s funds. The Trading Post’s governance
authority (CIP-12) can upgrade code but holds no day-one operational powers over
individual listings.
2.1.3 Listing consent — the listed actor must opt in
declare and declare_version authenticate only the creator. Without
listing consent, an attacker could declare somebody else’s actor as their own
listing or as a Forked template with its copied live
executable commitment, offer it Free, and hire it repeatedly. The
Trading Post would then send genuine 0x1E spawn directives at the
victim: the template-side guard of §2.6.4 authenticates the sender as the
Trading Post. A provenance check alone cannot
distinguish an authorized listing from a hostile one, and the victim burns
fork_count, children_count, and quota on protocol-authentic messages.
The Trading Post and template both enforce consent bound to the listing:
-
At the declaration level, the listed actor consents to Shared serving. A declaration
is not hireable until an
Activedeclaration-levelListingConsentfrom the listedactorexists, binding{declaration_id}. No template guard exists at this level (no directives are involved), so this consent lives purely in Trading Post state and admits three recording paths with identical effect: a transaction whose sender is the actor’s owner (read from committed chain state at execution), an actor-originated deferred instruction from the actor itself (trading_post_consenthost function, the §2.6.2 mechanism), or auto-recording atdeclarewhen the caller (creator) is the actor’s current owner. -
At the version level, only the Forked template can originate consent, through
a four-phase handshake. The §2.6.4 spawn guard reads the consent tuple
from the template’s own storage, which the Trading Post cannot
write; an owner-signed or auto-recorded consent would flip Trading Post
state while the guard’s source of truth stays empty. And the two legs
can NOT commit “in one transaction”: an actor-originated deferred
instruction materializes as a separate later transaction.
The pair cannot commit atomically. The protocol uses a
propose / provisional-commit / ack / confirm handshake with an
actor-chosen nonce and a Trading Post CAS (the propose transaction’s
local write and its reserved enqueue commit or roll back together;
the reservation rule under revocation below applies to every leg
here; cross-transaction ordering is made causal by the
confirm leg, never assumed from the scheduler):
-
In the propose transaction, the template’s owner-gated
handler picks
expected_nonce= its local consent counter + 1, writes the local tuple{declaration_id, version, commitment_hash, nonce: expected_nonce, state: PENDING, reservation_id, attempt}(the id and attempt stored locally so recovery can find the row,get_reservation(reservation_id)is the only bridge lookup and the preimage is not recoverable from the tuple otherwise), and enqueuestrading_post_consent(declaration_id, version, commitment_hash, expected_nonce). The guard rejects directives against aPENDINGtuple, so nothing is spawnable yet.commitment_hashbindskeccak256(template_commitment ‖ instance_commitment codec bytes), so consent cannot be replayed onto a substituted commitment, profile, or version. -
At materialization, the Trading Post provisionally commits the
deferred consent as a monotonic CAS: it succeeds iff
expected_nonceequals the subject’s last recorded nonce + 1 AND the commitment matches the version’s current commitments; concurrent or replayed proposals lose the CAS deterministically. On success theListingConsentis recordedUnconfirmed, NOTActive: no hire can be accepted against it yet. -
The consent execution, success
or failure, enqueues a consent-ack directive from
0x1Eto the template carrying{declaration_id, version, nonce, result}. The template’s ack handler flipsPENDING → ACTIVEon success (and deletes the tuple on failure), and in the same handler enqueues a consent-confirm deferred instruction back to the Trading Post, atomically replacing the tuple’s{reservation_id, attempt}pointer with the confirm reservation’s in that same transaction. The pointer invariant is global: the tuple always names the currently-outstanding leg’s reservation. The pre-commit retry writes its fresh{reservation_id, attempt+1}when it re-proposes, andACTIVE → REVOKINGstores the revoke reservation’s pointer the same way, because recovery’s only lookup isget_reservation(pointer), and a stale pointer resolves to an already-terminal row. -
The Trading Post confirm instruction flips
Unconfirmed → Active. Only now are hires, and therefore spawn directives, possible. The confirmation round-trip is required because mailbox delivery is priority-then-FIFO, and deferred instructions materialize from digest-ordered state. “The ack precedes any spawn directive” is not a property the chain provides. The confirm makes the ordering causal: the template’s local tuple isACTIVEstrictly before the confirm instruction exists, and the confirm commits strictly before any hire can create a directive, so every spawn directive finds anACTIVEtemplate regardless of priorities or interleaving, and no hirer’s gas is ever consumed against a template stillPENDING. Split-state outcomes remain fail-safe at every stage:PENDINGorUnconfirmedstates reject/admit-nothing; a lost ack or confirm leaves a listing that never activates and a proposal that can be retried at the next nonce.
REVOKING(the guard rejects from this instant; safety never depends on the Trading Post leg) and enqueues the Trading Post revocation. Two requirements prevent a revocation from being lost. The current deferred path can silently drop an enqueue: gas shortfalls are logged-and-skipped, bounded-queue admission can reject, and a failed materialization has no durable retry. Under those semantics the TP could stayActiveindefinitely, selling hires whose spawns always dead-letter:- The
trading_post_consent/revoke host functions perform a reserved enqueue: queue admission and materialization gas are reserved at enqueue time, and if the reservation fails the entire enclosing transaction fails. TheREVOKING(orPENDING) local write rolls back with it, and the template retries. Local state and an admitted instruction exist together or not at all. - An admitted instruction must materialize or be refunded; it cannot be dropped.
For this instruction class, admission is a consensus obligation with
exactly two provable outcomes (the same statement as the
reservation lane’s in §2.1.3; this bullet claims nothing stronger):
an admitted instruction materializes at ≤ 2× its snapshot rates,
or terminalizes
Expiredwith full remaining refund and the defined same-generation retry. What is banned is the silent third outcome the current pipeline permits: skipped-for-gas, queue-dropped, logged-and-forgotten. The release requires the deferred pipeline to enforce these outcomes.
REVOKINGand TP revocation is economic and bounded: hires accepted in that window were not knowingly dead (revocation was not yet consensus state when they paid); their directives fail the guard’s first, cheapest check (minimal consumption by construction; the tuple check precedes all other work), dead-letter, and resolve by reclaim (price in full, gas minus that minimal consumption). Directives already queued at revocation fail the same way. -
In the propose transaction, the template’s owner-gated
handler picks
-
Each
ListingConsentcarries a strictly-increasing per-subjectnonce; the spawn directive embeds{declaration_id, version, consent_nonce}(§2.6.4) and the child envelope embedsconsent_nonce(§2.6.4), so finalization also binds the authorization epoch. The template guard verifies the sender (0x1E) and the listing this template actually joined and has not revoked.
- The Trading Post sends a consent-ack directive to the template with provenance
0x1Evia the typed frame-origin. Its codec isb"cip33.cack.v1" ‖ declaration_id ‖ u32_be(version) ‖ u64_be(attempted_nonce) ‖ u64_be(current_nonce) ‖ u8 result(0 = committed-unconfirmed, 1 = CAS-failed;current_nonceis the TP’s recorded nonce after the attempt, equal toattempted_nonceon success, the authoritative resync value on failure). Applies iff the template’s local tuple matches{declaration_id, version, nonce}exactly ANDstate == PENDING. On result 0, the handler setsACTIVEand enqueues confirm. On result 1, it deletes the tuple. Any mismatch (older nonce, newer nonce, wrong state, unknown listing) is a no-op rejection: a stale or replayed ack can neither activate nor delete a newer proposal. - The template sends a consent-confirm instruction to the Trading Post through its
own protocol opcode on the reserved typed path. The consensus sender MUST be
the record’s
subject_actor. Its args are(declaration_id, version, nonce, commitment_hash). Applies iff theListingConsentmatches{subject_actor == sender, declaration_id, version, nonce, commitment_hash};commitment_hashis carried and matched here too, not only at propose/revoke: confirm is the leg that actually flips the listing toActive, so omitting it would let a confirm bound to noncenactivate a commitment substituted between propose and confirm. The additional conditionstatus == Unconfirmedis required before the instruction changes the status toActive. Stale/replayed confirms (wrong nonce, commitment mismatch, alreadyActive,Revoked) reject without effect. - Every leg has an allocated opcode and canonical struct. Allocation is
against the full protocol uniqueness table, not a local range. The
pinned table’s system block runs through 199 with the Bank block
fixed at 200–216, and mid-range values that look free are not (157 is
deliberately retired and MUST NOT be reused; 158/159 are system-DKG;
160/161 are Container Registry). This amendment therefore allocates the first contiguous free
block at protocol pin 76942600. Values 217/218 are also taken
(SYS_SUBMIT_GRANT_RELEASE_PROPOSAL, SYS_CBQS),
219 =
trading_post_consent(propose/commit), 220 =trading_post_confirm, 221 =trading_post_revoke_consent, and, because they are new instructions too, 222 =finalize_spawn, 223 =reclaim_spawn, each with the positional arg struct exactly as its method row states ((declaration_id, version, commitment_hash, expected_nonce)for 219 /(declaration_id, version, nonce)for 220 /(declaration_id, version, commitment_hash, nonce)for 221), canonical codec-bytes encoding, strict EOF.DeferredReservation.instruction_kindis the opcode and itsinstruction bytesare that canonical arg encoding. This defines the reservation digest. The ack handler is the reserved template entrypointon_consent_ack, dispatched under the typed0x1Eframe-origin path exactly likespawn_instance(not@public). Validation order within each leg: decode the message, verify provenance/sender, match the tuple, then apply the state CAS. All producer/decoder vectors regenerate with the allocation. Golden vectors per opcode; stale-ack, stale-confirm, cross-listing replay, and wrong-sender vectors are pinned. - Per
(subject_actor, declaration_id, version)at most ONE handshake generation may be in flight:consent_listingproposes are rejected by the template’s own handler while a local tuple exists in any state, and by the Trading Post CAS while aListingConsentsitsUnconfirmed. Nonce namespaces are per-listing (§2.1’s scoped nonce), so different-listing legs completing out of reservation order touch disjoint counters; same-listing generations are serialized by the one-outstanding rule. The gap scenario (n+1 materializes first, fails, and the local counter strands ahead of the TP’s) cannot arise in any interleaving. For resynchronization, the failure ack’scurrent_noncefield is the Trading Post’s recorded value, and the template resets its local counter to it when deleting the tuple. Even a bugged or migrated template cannot stay desynchronized past one failed round.revoke_consentbinds the full tuple: it CASes on exact{subject_actor == sender, declaration_id, version, commitment_hash, nonce, status ∈ {Unconfirmed, Active}}. A revoke can never hit a later generation than the one it names. Vectors: same-listing second-propose rejected at both ends; failure-ack nonce resync; revoke naming a stale nonce rejected.
DeferredReservation { reservation_id, subject_actor: Address, instruction_kind: u16 (the opcode), instruction_bytes: Bytes (the canonical arg encoding, PERSISTED — state alone materializes the instruction), attempt: u32 (initial 0; also inside the id preimage, and stored plainly because a hash preimage is not invertible), snapshot_cycle_rate: u64, snapshot_cell_rate: u64 (the pricing inputs, persisted), gas_reserved: u64, remaining_escrow: u64, created_height, expiry_height, status: Reserved | AckPending | Materialized | Expired, expiry_reason: Option<Backlog | RateExceeded>, // precedence: RateExceeded iff the entry was rate-blocked at its final budgeted scan, else Backlog evidence_consumed: bool, // terminal-GC gate: recovery's read-and-apply sets it; see the GC rule // per-leg accounting: completed records the commit leg's consumption; the ack leg's is the remainder of consumed escrow completed: Option<{leg: u8, result: u8, current_nonce: u64}> }
the complete encoded record, golden vectors per transition, with
reservation_id = keccak256(b"cip33.rsv.v1" ‖ subject_actor ‖ u16_be(opcode) ‖ u32_be(len(instruction_bytes)) ‖ instruction_bytes ‖ u64_be(nonce) ‖ u32_be(attempt)), domain-tagged, covering the opcode
and framed bytes (a propose and a revoke with coincidentally identical
argument tuples cannot collide), and carrying an attempt counter so
a same-generation retry creates a fresh row without colliding with its
own Expired predecessor. An Expired record additionally persists
the outcome of any leg that completed before expiry,
completed: Option<{leg, result, current_nonce}>:
- Creation is atomic with the local tuple write, in the propose /
revoke transaction’s write-set (both-or-neither).
gas_reservedis not caller-chosen: each instruction kind carries a fixed pinned budget,CONSENT_LEG_CYCLES = 2_000_000andCONSENT_LEG_CELLS = 4_096per leg it funds (the propose reservation covers two legs, commit + ack, so reserves twice the pair; confirm and revoke reserve one), executed in the System lane (CIP-3 §2.2.3). Pricing: the reservation persists its per-dimension snapshot rates (cycle and cell, creation block) and reservesgas_reserved = budget × snapshot_rate × RESERVATION_RATE_MARGIN(margin = 2, checked conversion from u128 to u64), trackingremaining_escrowin the record as legs consume. Execution always charges the live lane-effective basefee in full, never below it; a discount would execute under the required basefee and leave burn/distribution unfunded, which no lane can subsidize (a lane is capacity, not money). If the live rate exceeds2 × snapshotin a block, the reservation simply waits (it stays admitted, older entries keep priority); if the margin is still exceeded atexpiry_height, it terminalizesExpiredwith reasonRateExceededand full remaining refund, feeding the same recovery path as any expiry. An admitted instruction either materializes at ≤ 2× snapshot rates or expires with a clean refund and a defined same-generation retry. State proves either outcome. The reservation debits the enqueuing actor. It consumes one slot of per-actor capacity (MAX_RESERVATIONS_PER_ACTOR = 16, released when the reservation terminalizes,MaterializedorExpired, not held forever) and aggregate per-block lane resources. Admission is by resource, not count (a count bound proves nothing about capacity and none is used): each block schedules pending reservations, oldest first, only while their summed cycle budgets fit the reservation sub-budget of the System lane,RESERVATION_LANE_CYCLES = 8_000_000. Admission is cycles-only because lanes are a cycle partition in consensus (the protocol definesLANE_*_CYCLESconstants and no per-lane cell budget exists); the legs still consume cells, charged at execution per CIP-3. Cells do not participate in lane admission. The fee model has noRESERVATION_LANE_CELLSbudget. The reservation budget is part of the System lane. One sharedLANE_SYSTEM_CYCLES = 32_800_000counter governs the whole lane; each block schedules reservations FIRST in the system section, up to their sub-budget caps, and ordinary System traffic fills whatever remains (≥ 24.8M when reservations are saturated; unused reservation budget is naturally borrowable because the counter is shared; there is no double-accounting; total lane consumption can never exceed CIP-3’s capacity; cumulative per-block accounting under a SystemState key). Creation fails the whole transaction on per-actor-slot, balance, or global-capacity failure, the ONE combined counter of the retention rules below (reserved + unconsumed_terminal ≤ RESERVATION_CAPACITY = 4_096, stored at SystemState keykeccak256("cip33:rsv_capacity")as a u32 little-endian value, incremented exactly once at creation, decremented exactly once at the FIRST of {evidence consumption, tombstone GC, auto-resolution}, the once-only guarantee riding the same consumed-flag CAS that gates those transitions; increment/decrement transition vectors; no separate outstanding cap exists; per-actor 16 alone bounds nothing against many actors); lane pressure defers scheduling, never admission. Validator work is bounded by construction: pending reservations live in an explicit FIFO index. The index MUST be prefix-scannable, which forbids a raw >64-byte composite key (the state key encoding’sACTOR_STORAGE_SCANNABLE_MAX = 64collapses any longer user key tokeccak256(key)[..32] ‖ zero-pad ‖ 0xFF; point reads still work but the row becomes invisible to prefix scan and ordering is lost, which would silently turn every sweep here into a permanent no-op; this is the confirmed failure shape and applies to all three indexes in this section). Each index is therefore a two-level structure under its ownStatePrefix: an ordering key ofu64_be height(8 bytes, the FIFO/due-height bucket) whose value is an append-ordered list of thereservation_ids at that height, plus theDeferredReservationrecord itself keyed byreservation_id. Heights are dense and walked in order; ties break by list order (creation order). No scan key exceeds 8 bytes. Rows are written at creation and deleted at terminalization; no unindexed scans exist, and each block walks the ordering keys for at mostRESERVATION_SCAN_BUDGET = 512entries (entries beyond the budget wait, order preserved), and expiries are processed by the same walk: an entry pastexpiry_heightterminalizes when the budgeted scan first reaches it (a bounded lazy sweep, not a second pass). Precedence, pinned: an entry that is both schedulable and past expiry at the same height materializes; execution wins over expiry (deterministic; expiry is the fallback, never a race). Head-of-line rule, pinned: an over-rate FIFO head (rate cap below) is skipped for that block and keeps its queue position; eligible younger entries within the scan budget execute ahead. The rule is deterministic (the rate check reads consensus state) and was chosen over stopping, which would let one over-rate entry head-of-line-block the lane for up to its whole TTL. - One propose reservation funds its
remaining work on the Trading Post side: the commit execution AND
the consent-ack directive’s delivery to the template (the ack has no
other payer; the Trading Post owns no funds). The protocol tracks both legs separately: the commit execution CASes
Reserved → AckPending(no refund yet; the ack is unfunded work still owed), and the ack’s delivery CASesAckPending → Materialized, at which point the unconsumed remainder ofgas_reservedrefunds to the enqueuing actor. Each CAS consumes its leg exactly once. A replayed commit or ack finds the wrong state and is invalid. Consumption is charged per leg at execution-block rates under the reservation’s rate cap (below); consumed fees burn/distribute as ordinary CIP-3 fees. The confirm leg is funded by its own reservation (created in the template’s ack-handler transaction, same rules, single-leg:Reserved → Materialized). - Materialization is deterministic and bounded: pending
reservations execute in FIFO order by
(created_height, reservation_id)in each block’s deferred section, up to the global per-block budget; a reservation beyond the budget carries to the next block ahead of younger ones. The guarantee that an admitted instruction materializes is provable from state alone. Being consensus state, reservations need no node-local queue and behave under restart/reorg exactly as all state does (roll back with their block). - Expiry (
expiry_height = created_height + RESERVATION_TTL_BLOCKS = 600) is the only terminal failure, and its stall model is exactly the backlog rule above: with next-block execution ahead of younger entries, an unexpired unmaterialized reservation exists only while the global budget has been saturated by older entries for every block since creation, 600 blocks of sustained saturation. At expiry the record flipsExpired, refunds the remaininggas_reserved, releases its capacity slot, and emits an event; the local tuple remains in its safe state (PENDING/REVOKING, both reject directives). Terminalization moves the record’s index row from the scheduling FIFO into a separate terminal-retention index keyed(terminal_height, reservation_id). Retention rows never consume scheduling scan budget, and the walk that prunes them is its own, with its own cursor andRETENTION_SCAN_BUDGET = 128per block (nothing is ever findable only by state scan). Consumption rules are automatic where recovery is moot:Materializedrows setevidence_consumed = trueat terminalization (nothing to recover);Expiredrows are consumed by the recovery transaction as before. Pruning removes consumed rowsRESERVATION_RETENTION_BLOCKS = 600after terminalization; an unconsumed row past retention does NOT vanish into a generic not-found (that would erase exactly the fact recovery branches on, whether a commit happened, making nonce/state/gas depend on GC timing, and givingREVOKINGno safe branch at all): pruning an unconsumed row replaces it with a minimal TAGGED tombstone, codecu8 leg (0 = propose-commit, 1 = confirm, 2 = revoke; other values reject) ‖ u8 has_completed (0/1; other values reject) ‖ (u8 result (0 = success, 1 = CAS-failed; other values reject) ‖ u64_be current_nonce iff has_completed = 1), 2 or 11 bytes, strict EOF (trailing bytes reject), the tag making pre-commit (has_completed = 0, recovery re-proposes same-generation) and post-commit (= 1, recovery applies the evidence as the ack) decodable interoperably; the RPC returns the same tagged union. Recovery consumes a tombstone exactly as it would the full record. Every phase transition reindexes to its next due-height. The forward cursor only ever needs to look ahead, never back, and never holds: tombstone creation (at retention expiry of an unconsumed row) deletes the(terminal_height, id)row and writes(resolution_due_height = terminal_height + TOMBSTONE_PUBLIC_RESOLUTION_BLOCKS, id); without this, an absent-template tombstone would sit at a key the cursor has already passed and auto-resolution could never reach it; consumption or auto-resolution reindexes again to(gc_due_height = that_height + RESERVATION_RETENTION_BLOCKS, id). Each phase has its ownStatePrefixand the same two-level 8-byte-height ordering as the scheduling index above; a row is always findable at exactly one upcoming height in exactly one phase index. Tests: absent-template at 4,096 rows (slot 4,097 admits at exactlyterminal_height + 7_200, the D−1/D boundary vector pins the anchor; never before), and cursor monotonic-progress under mixed phases. Capacity is never hostage to an absent template: a tombstone unconsumed byterminal_height + TOMBSTONE_PUBLIC_RESOLUTION_BLOCKS (= 7_200), the ONE anchor, everywhere: the sameterminal_heightthe due-key formula uses; neither reservation creation nor tombstone-creation height ever anchors this window (three candidate heights exist and validators disagreeing on the anchor would release the global slot, and admit slot 4,097, at different blocks), is auto-resolved by the retention walk itself, deterministic, free, no new instruction: the walk marks it consumed, releases its capacity slot, and reindexes it as above; the recovery facts remain readable until its GC, and a template returning even later reconciles by the complete matrix (local state ×get_consent), generic clear-and-re-propose is NOT the rule, because it is wrong for revocation (clearing aREVOKINGtuple against a TPActivewould leave hires accepted forever while every spawn dead-letters): ForPENDING × missing/Superseded, clear and optionally re-propose. ForPENDING × Unconfirmed(nonce match), apply the ack path (evidence or supersede at next propose). ForPENDING × Active, adopt TP state (flip localACTIVE, re-enqueue confirm-idempotent no-op). ForACTIVE × Unconfirmed, re-enqueue confirm. ForACTIVE × Active, no further action is needed. ForACTIVE × Revoked/Superseded, clear (delisted). ForREVOKING × Unconfirmed/Active, retry the revoke (fresh reservation, same generation-binding CAS, never re-propose). ForREVOKING × Revoked, delete the tuple. Every cell is a vector. 4,096 abandoned templates can therefore delay capacity by at most the resolution window, never hold it forever.get_reservation= not-found retains ONE meaning (no reservation was ever created) and is unreachable from a valid local pointer within the resolution window; past it, the reconcile-from-get_consentrule governs. The supersede rule remains for the one orphan a crashed template could still leave: a propose CAS atn+1marks a still-standingUnconfirmed(n)asSupersededand proceeds;Supersededis aListingConsent.statusvalue with exactly one inbound transition (that CAS) and none outbound. Global bound: unconsumed-per-listing ≤ 1 (the retry consumes its predecessor in the same transaction) AND a combined capacity counterreserved + unconsumed_terminal ≤ RESERVATION_CAPACITY = 4_096: every propose/confirm/revoke creation reserves its terminal-capacity slot up front (a live row is a future terminal row, and terminalization itself can never fail, so the slot must exist before the row does), and the slot releases only at evidence consumption / tombstone GC. One counter, one cap, enforced at creation for all three legs, bounded against unbounded listings, and against the all-4096-expire-at-once shape a separate outstanding cap would miss. The recovery path is explicit and branches on what completed, read over the §2.1.2 bridge (get_reservation, in the list of read-only methods):- If expiry occurs before commit (
Reserved,completed = None), nothing reached the Trading Post. The handler clears the stale local tuple and creates a fresh reservation for the SAME generation withattempt + 1, one transaction, no window in which the guard accepts anything, no nonce consumed. - If the ack is lost after commit (
ExpiredfromAckPending,completed = Some{commit result, current_nonce}), the Trading Post already holdsUnconfirmed(n); re-running the proposal would correctly fail every guard, and MUST NOT be attempted. The persistedcompletedvalue IS the ack content: the handler applies it exactly as the ack directive would. On success, set localACTIVEand enqueue confirm. On failure, delete the tuple and reset the counter tocurrent_nonce. This redelivers the ack through a state read without a new message class. - The combination of local
ACTIVEand TPUnconfirmedafter a lost confirm persists only while the confirm reservation is un-terminalized; on its expiry the template re-enqueues the confirm atattempt + 1(Unconfirmed → ActiveCAS idempotent against the same nonce; a duplicate is a no-op rejection, not a fault). The vectors check that same-generation retry succeeds after pre-commit expiry, that state-read ack application activates after post-commit expiry without re-proposal, and that re-enqueuing an expired confirm activates the listing. Same-listing concurrent proposals reject at propose (no CAS loser exists to receive an ack). Different-listing proposals both succeed in disjoint nonce namespaces.
- If expiry occurs before commit (
fork_count consumed), commitment substitution after
consent (commitment_hash mismatch, version inactive), version-number
substitution, two declarations naming one template (each needs its own
consent), and quota/counters unchanged on every rejection path.
Handshake machinery tests: directive against a PENDING or
Unconfirmed-side tuple rejects; hire against an Unconfirmed consent
rejects; same-listing concurrent proposals reject at propose (no CAS
loser exists to receive an ack; see the recovery bullet);
failed-commit ack deletes the tuple and resyncs the counter; a
lost ack/confirm leaves the listing inactive until the same-generation retry
(reservation-expiry path) completes it; adversarial delivery interleavings (spawn-priority vs ack)
never find a PENDING template after Active consent (causality, not
scheduling); reserved-enqueue failure rolls back the local write;
revocation gap-window hire dead-letters on the guard’s first check and
reclaims (price in full, gas minus minimal consumption).
2.1.4 Hireability badges are discovery metadata
badges.human_hireable / badges.agent_hireable are advisory discovery
metadata, normatively unenforced: hire admits any caller kind regardless
of badge state, and no conformant implementation may reject a hire on badge
grounds. Consensus state cannot reliably classify the payer as human or
agent at hire execution. A human can drive an actor with one deploy, and
an actor’s owner can hire through an EOA with one signature. Either can
use a proxy to bypass badge enforcement. Handling actor-origin deferred
hires and contract-less accounts would require a consensus change. Badges tell stores and clients
what the creator intends and how to render the listing; filtering on them
is a client decision, like attester trust (§2.7).
2.1.5 Hire gates
A hire gate restricts who may create a new hire on one hiring path. The gate is a secp256k1 signer address; a gatedhire must carry a short-lived
gate pass that signer issued to the hirer. The Trading Post checks the
pass; the admission rule behind it (membership, an early-access window, a
waitlist) is the signer’s off-chain policy and never reaches the chain.
Each gate applies to a hiring path. A listing is exclusive to a store’s
gate only while the creator gates every other path (the direct path and every
other store’s grant) and keeps them gated; that exclusivity is the creator’s
commitment to the store, not a protocol guarantee. It is a deal between creator
and store. Anyone can check that commitment from public state:
declaration.hire_gate
and the gated flag on every grant in list_grants(declaration). Clients MAY
label a listing exclusive to a store only when that check passes. A store’s gate reaches
only grants the creator marked gated, so a store gains no admission power
without the creator’s opt-in, and never over another store’s grants. A
creator may set the direct-hire gate to Store(store_id); the store then
controls direct admission by the creator’s choice (§2.2). Store is resolved
at hire time against the store’s current key, so the delegation follows the
store’s rotations. The store’s gate key is separate from operator so a hot
signing service never holds the treasury key; set_hire_gate rotates or
clears it for every gated grant on the store, and every direct path delegated
to the store, at once. The path byte in the digest keeps a store’s grant passes
and direct passes distinct, so a store’s signer issues direct passes only if
its own policy chooses to.
hire takes an optional gate_pass = { expiry: BlockHeight, sig: EthSignature }, where sig is the codec’s 65-byte recoverable
secp256k1 signature r ‖ s ‖ v, low-s, v ∈ {0, 1}, over the raw 32-byte
digest below. The handler MUST reject v > 1 before recovery (the codec’s
recovery accepts recovery ids 0–3). The digest is signed as a prehash with no
EIP-191 prefix, so a pass produced with personal_sign does not verify:
hire resolves the path and before any escrow or
transfer, it classifies the gate:
- Granted hire,
grant.gatedand the store’shire_gateunset: reject. A gated grant fails closed. - Direct hire,
declaration.hire_gate = Store(id)and storeidis notActiveor itshire_gateis unset: reject. A delegated direct gate fails closed. - Granted hire,
grant.gatedand the store’shire_gate = G; direct hire anddeclaration.hire_gate = Signer(G); or direct hire,declaration.hire_gate = Store(id)and storeid’shire_gate = G:gate_passMUST be present,current_block ≤ expiry, and the address recovered fromsigovergate_digestMUST equalG. - Otherwise the path is ungated and
gate_passMUST be absent.
GATE_RECOVER_CYCLES = 10_000
cycles, equal to CRYPTO_SECP256K1_VERIFY_CYCLES in the CIP-3 §2.2.1
schedule, plus the digest’s Keccak-256 at the CIP-3 per-32-byte rate. An
ungated hire pays neither. The granted path already reads the grant’s
StoreRecord, so the store’s gate key is in its access set. A Store(id)
direct gate adds one StoreRecord point read to the direct path, which still
reads fewer keys than the granted path and so fits the existing fixed
TradingPostHire access reservation (Rk=12, Wk=6). The hire event carries
gate_signer: Option<Address>.
The gate admits new hires only. deposit, renew, Lapsed
reactivation, withdraw_unused, and Forked finalize_spawn are not gated. A
hirer who loses eligibility after hiring keeps the hire; removing it is the
existing lifecycle control: pause/revoke_hire by the grant’s store, or
the creator’s restricted direct-hire controls. Paid Subscription and
OneShot direct hires admitted under a gate are therefore permanent, as every
such direct hire is; PerCall and Free direct hires stay creator-revocable
(§2.4).
2.2 Direct hire and artifact pinning
hire(declaration, grant = None, ...) settles against the pinned version’s
default_split (typically 100% creator) and initializes the lease with the
protocol default lease_epoch_blocks = 1800. Stores MUST NOT be required for
any flow in this CIP unless the creator delegates the direct-hire gate to a
store with Store(store_id) (§2.1.5). Direct-hire pause/resume/revoke is creator-controlled
under the restricted rule of §2.4 (Free/PerCall terms only).
A granted hire MUST pin the granting store’s
Active artifact for the pinned version (unique per §2.1.2’s
one-Active-artifact invariant, so selection is deterministic). If the store
has registered none, the hire is rejected. Falling back to the creator’s artifact
0 is direct-hire only: a store-routed hire that silently served
unreviewed creator-volume code would carry the store’s trust without the
store’s review. The pinned artifact is the only volume the hire’s instances
run and the only escrow the lease will service (§2.5.1). Registration
also writes a permanent volume_id → (registered_owner, declaration, version, artifact_id) reverse index, keyed by the stable
volume_id alone everywhere in this section. That index is safe
by three pinned rules, because an unauthenticated writable index is itself a weapon (a
store registering someone else’s volume would make CIP-24 fail-close
that owner’s ordinary unbound jobs): (i) ownership consent:
register_artifact verifies the volume’s StorageCommitment.owner
equals the registrant’s authority (the creator for artifact 0; the
store’s operator account for snapshot artifacts) and rejects
otherwise; (ii) permanent uniqueness, keyed by volume_id alone: one
volume maps to at most one artifact, ever: a second registration of
the same volume_id under ANY owner, artifact, or version rejects (no
overwrite or set; reclassification is impossible by construction,
including after a CIP-9 ownership transfer), and the row is
tombstoned like every §2.6.4 index; (iii) exact codec, keyed by the stable identity: key =
volume_id alone (NOT (owner, volume_id): CIP-9 supports ownership
transfer, which mutates StorageCommitment.owner; an owner-composite
key would fail open after a transfer, missing the lookup under the new
owner and even permitting a second classification); value =
registered_owner(20) ‖ declaration_id(32) ‖ u32_be(version) ‖ u32_be(artifact_id) (the owner at registration, recorded as history,
never used as the lookup key), RPC get_artifact_by_volume(volume_id)
returning exactly that tuple or not-found. Global uniqueness is by
volume_id, transfer-proof by construction. cbssd classifies by one
indexed read, never a scan, which is what lets CIP-24’s “refuse
unbound jobs for registered volumes” rule fail closed. Lifecycle
vectors: foreign-volume registration rejected; duplicate-volume
registration rejected across versions and stores; classification
unchanged after artifact retirement, declaration retirement, and
a CIP-9 ownership transfer before and after a
running job (classification holds through both; no second
registration becomes possible).
Node commit 13de6a65 implements this permanent reverse index,
including artifact 0, and exposes the indexed volume lookup through Node RPC.
The separate cbssd classification consumer still needs to use that lookup
before the CIP-24 fail-closed rule is complete.
2.3 Split vectors
- Validated at
declare/declare_version/granttime: shares sum to exactly 10,000 bps; max 8 entries; no zero-share entries. - The effective vector (grant or default split, plus any
referral entry) is copied into the
Hireand every subsequentrenewandsettle_per_callsettles against the pinned copy. Editing a grant’s split affects only future hires. - Executed atomically inside
hire/renew/settle_per_call: the Trading Post receives or draws the payment (CBY or a CIP-20 token named in the term) and transfers each beneficiary’s share in the same method execution. Rounding dust (the remainder after integer division) accrues to the first entry (by convention, the creator). - Trading Post transfers mutate balances directly and do NOT invoke CIP-20 transfer hooks. A multi-leg split must not be abortable or reenterable by a beneficiary’s hook. Hook semantics consequently do not fire on hire settlement; tokens whose economics depend on transfer hooks should not be offered as pricing denominations. Standard CIP-20 transfer events ARE emitted per leg, so indexers observe every movement. A settlement fails closed as a whole if any participant’s token account is frozen.
- Referral and creator codes have no protocol mechanism. At hire time the client
MAY append at most one referral entry of up to the grant’s
max_referral_bps, deducted exclusively from the store’s share; the pinned vector still sums to 10,000. The protocol has no opinion about what codes mean. - The protocol itself takes no cut. Chain revenue from hiring is gas and compute, as for any other actor activity.
2.4 Pricing terms
token is a PaymentAsset (§2.1, NativeCby or Cip20 { token_id },
never a bare address); all amounts are u128 base units.
A PerCall term carries 1 to
8 UnitPrice components, each a unit label and a price per unit. A use is
charged Σ count × price over the units it consumed. One component prices a
single unit ([call: 5] per call, [result: 1] per result, [mb: 2] per
megabyte); several combine, e.g. [call: 5, result: 1] is a base fee per
call plus a charge per result. A label is 1 to 16 bytes of [a-z0-9_], and
labels within a term are distinct. The label names the unit for buyers and
receipts; the chain gives no label special meaning. Declaration MUST refuse a
PerCall term with no units, more than 8, a zero price, or an invalid or
duplicate label: a zero price would admit a funded hire with no reservation.
No method ever pulls from a hirer’s
wallet or actor balance: money enters a hire only as an explicit payment
attached to hire or deposit. renew draws each period’s price from the
hire’s available balance at the period boundary. It is callable by anyone, typically a
CIP-5 timer, since its effect is deterministic and boundary-gated.
If available balance is insufficient, the hire becomes Lapsed and its lease
stops. It can recover through deposit + renew while declaration and grant
remain Active. Available
balance is prepaid − reserved; withdraw_unused returns it to the hirer at
any time. Cancellation is set_renewal(false) + withdraw_unused; the
current period stays honored.
Term semantics:
- OneShot sets
paid_through = ∞and survives retirement: the creator’s escrow and serving obligation for already-sold one-shot hires is perpetual. Creators who want a sunset path MUST price asSubscription. - Subscription advances
paid_throughper successfulrenewby the gap-absorbing rule:paid_through := max(paid_through, current_block − 1) + period_blocks. The boundary is pinned against the validity rule as written (§2.5.1: valid whilecurrent_block ≤ paid_through, inclusive):renewis a silent no-op whilecurrent_block ≤ paid_throughand becomes eligible only atcurrent_block > paid_through, so an anyone-callable renew can never mutate, and neverLapsea hire, inside already-paid time, including the final paid block. At first eligibility (current_block = paid_through + 1) the formula givespaid_through + period_blocks, contiguous coverage, exactlyperiod_blocksnewly paid blocks. After a gap it givescurrent_block − 1 + period_blocks. Coverage starts at the draw block and has the same period length.Lapsedis set only by an eligible renew finding insufficient funds; boundary vectors atpaid_through,paid_through + 1, and a gapped draw pin all three. Without themax, an anyone-callablerenewon a long-stale hire would advance the old boundary by one period per call, each drawing a full period’s price for time already past: repeated calls drain the entire prepaid balance for zero service. With it, the first post-gap renew starts the period at the current block and the next renew is a boundary-gated no-op until that period ends. The drain vector checks that N rapidrenewcalls on a stale hire draw funds exactly once. - PerCall ignores
paid_through; validity is an open, funded MPP session (§2.6.3), where “funded” means the session’s reservation is covered byreservedand is at least the price of one unit at the term’s cheapest price. Reservations move balance from available toreservedat session open and release at settlement or session close, sowithdraw_unusedcan never strand an open session. - Free carries no money; validity is simply declaration ∧ grant (if any)
∧ hire all
Active.Private + Freeis legitimate (e.g., a free private beta).
retire_declaration and
revoke_grant stop new hires but MUST NOT strand paid time. Existing
hires remain serviceable (lease shares keep issuing, §2.5) until
paid_through, indefinitely for OneShot. Creators cannot terminate active subscribers’ paid time; they can only decline future renewals.
For store-side trust-and-safety actions,
pause and revoke_hire MAY stop service inside paid time (§2.5.2–2.5.3).
On revoke_hire the Trading Post auto-refunds the hire’s available balance
to the hirer. Funds already split for the in-progress period are not clawed
back at the protocol level in v1. Per-period escrow of executed splits remains
an open question; stores set their compensation policy for the
in-progress period. A store revoking a
OneShot hire strands the hirer’s perpetual access with no protocol remedy
beyond the (typically zero) available-balance refund. Clients SHOULD weight
store trust accordingly, and stores compete on their published compensation
policy.
Creator-side direct hires get no such exception. For direct hires, the
creator may pause/revoke_hire only Free and PerCall terms (nothing
prepaid is stranded; reservations settle first). Paid Subscription and
OneShot direct hires are not creator-revocable. The creator can decline
renewal through retire_declaration. The actor’s application logic handles
refusal of abusive hirers; the protocol grants no corresponding revocation power.
2.5 Key leases (private-code actors)
2.5.1 Mechanism
Forcode_visibility = Private, every ServingArtifact’s volume is an
ordinary CIP-9 private volume, and its key escrow is the standard
CIP-24 volume-DEK wrap, unmodified. The implementation MUST NOT introduce a
bespoke tradingpost/{…} IBE identity family, which CIP-24 does not
define (its identities are the account/secret and volume-DEK families,
each with required DST, AAD, epoch, and rewrap semantics). The reserved Trading Post secret key name in the
CBSS whitepaper does not define a volume-DEK identity and is not used to wrap
this artifact’s volume key. The registrant (creator for artifact 0, store
for snapshot artifacts) wraps the volume’s DEK exactly as any CIP-9
private volume’s owner does, with the same identity derivation, the same
DST/AAD/epoch fields, and the same rewrap machinery. Concretely, the volume’s own StorageCommitment carries
wrapped_dek (WrappedDek v2), cbss_release_key_material_hash, and
cbss_rewrap_required, exactly per CIP-24 §9.3; the artifact record
stores volume_id and its existing ibe_ciphertext field, but no
volume DEK wrap or new WrapRef. What this CIP adds is authorization only: for a volume registered
as a serving artifact, the CIP-24 §9.3 “release at mount” flow gains
one additional condition. The SealRequest is honored only when the
§2.5.1 issuance predicate (hire/term state) also passes. The reciprocal
one-paragraph CIP-24 amendment naming this condition ships in the same
release (its §9.3 release rule gains “…and, for Trading-Post-registered
volumes, the CIP-33 §2.5.1 predicate”). Identity derivation, DST, AAD, material-hash
binding, and rewrap semantics apply verbatim. For a Private artifact,
claimed_root == version.manifest_root records the registrant’s claim that the
copy contains the source content identified by that root. It does not assert
that the destination volume’s commitment equals the source commitment. The
Private registration path MUST NOT check destination-root equality; the
destination MUST exist, be Active and Private, and belong to the Store
operator. Node commit e89078ff implements these checks. The source-root
claim identifies the responsible registrant; consensus does not prove copy equivalence (§4).
cbssd enforces an issuance policy (chain-state-conditioned, as for
CIP-7 stream keys). An issuance request carries (runner_id, job_id). Hire and artifact
identities are NOT request fields: cbssd derives them from the
authenticated job binding below (matching CIP-24’s byte-unchanged
SealRequest rule). Shares for the hire’s pinned artifact volume are issued iff, per
node RPC at the current block:
(hire, runner, lease_epoch); the policy
is re-evaluated at every lease-epoch boundary
(lease_epoch = (block − hire_block) / lease_epoch_blocks). The node MUST
expose the job-assignment and hire-binding query this predicate reads.
lease_epoch_blocks is creator-set per grant (default 1800 blocks ≈ 30
min at the 1 s minimum block interval; recommended range 900–3600). It is
independent of consensus epochs (none exist; EPOCH_LENGTH = u64::MAX) and
of CBFS rent epochs.
2.5.2 Revocation latency
Two layers:- The fast path acts within seconds: runners MUST subscribe to Trading Post lifecycle
events (CIP-29 via indexer feed) and stop accepting/continuing jobs for a
hire upon observing
pause/revoke_hire. This is a runner-policy requirement tied to reputation/slashing (CIP-2), not consensus. - The cryptographic backstop acts within one lease epoch: share issuance stops at the next lease-epoch boundary regardless of runner behavior.
2.5.3 Residual risk — cached DEKs
A runner that has lawfully decrypted during epoch k may cache the DEK and compute beyond revocation. This is accepted and bounded: such execution earns nothing.cbssd issues no further shares, the Trading Post refuses
settlement for non-Active hires, and job results for revoked hires are
rejected in the existing runner settlement flow. The penalties cover the
runner’s stake and reputation (CIP-2, CIP-13). Rewrapping on a shorter
cadence leaves the DEK unchanged, so a cached key opens
the same ciphertext (CIP-9 §9.4.1); only real rotation with re-encryption
would, and it does not exist yet (§6.1, CIP-9 §9.4.2).
A pause limits a store to pausing future scheduling and key issuance for what it
distributed. It cannot reach into runners’
memory or affect the actor itself or hires routed through other stores.
2.6 Agent hire
A hiring actor assembles capabilities at runtime.2.6.1 Capability schema
capability_schema carries the capability document inline, or a CBFS path to
a document content-addressed by the version’s manifest_root. The document
describes: methods exposed to hirers
(names, JSON-Schema parameter/result types), supported PricingTerms, runner
requirements (models, mounts), and rate limits. The schema document format is
versioned ("cip33_schema": 1); evolution happens by document version, not
protocol change.
The field is opaque bytes of at most MAX_CAPABILITY_SCHEMA_BYTES = 4096. A
document that fits is carried inline; a larger one goes in CBFS and the field
carries its path. The cap applies to TradingPostDeclare,
TradingPostDeclareVersion and TradingPostDeclarePackage, from
TRADING_POST_CAPABILITY_SCHEMA_SIZE_ACTIVATION_HEIGHT
(CIP-50). Below that per-network height a
declaration whose capability_schema exceeds 1024 bytes is refused at
admission, by the proposer and in block verification. Store metadata and
attestation policy_uri keep their 1024-byte MAX_TRADING_POST_URI_BYTES
cap.
2.6.2 Discovery and hire
Hiring actors query listings either off-chain (their runner consults an indexer during a CIP-2 job and passes candidates into actor logic) or on-chain (call() into the read-only methods, §2.1.2). The hire itself is a
deferred system-instruction flow. A PVM handler cannot call the
Trading Post’s Rust mutators, so the hiring actor enqueues a deferred
TradingPostHire whose consensus sender and payer is the actor itself
(the same actor-originated deferred-system-instruction mechanism the
Intent path already uses, with sender_override to the actor). The hire
executes deterministically in the same pipeline, after the enqueuing
handler. The SDK’s dedicated host function (trading_post_hire(args))
enqueues a deferred TradingPostHire. The generic deferred mechanism produces only
ExecuteActor. The dedicated function uses the
enqueuing actor as consensus sender and payer, gated by an econ.hire
entitlement, args bounded by the HireArgs codec caps, gas drawn from the
enqueuing handler’s pool, sender overridden to the actor, and the result
surfaced via the hire receipt/event. Identity, balance debit, failure
rollback, and replay behavior carry dedicated tests. call() reaches only
the read-only methods (§2.1.2).
2.6.3 Metered usage
PerCall terms meter over an MPP session (CIP-8) bound to (hire_id, version), with per-call price from the pinned term. Session open moves the
session’s reservation from available balance into reserved (“funded” in
§2.5.1 means the reservation covers it). Settlement is explicit:
settle_per_call(hire, session_receipt) draws the
settled amount from reserved, releases the remainder to available, and
executes the hire’s pinned split. The receipt is the CIP-8
session-close statement (bilaterally signed call count/amount).
Receipts carry unit counts. Settlement names the cumulative count of each
unit of the hire’s term, in the term’s order, and the receipt commits to
them: the voucher’s usage_digest MUST equal
keccak256("cowboy.trading-post.per-call-usage.v1" ‖ u32(len) ‖ u64(count₀) ‖ …)
(big-endian), and its cumulative amount MUST equal Σ countᵢ × priceᵢ at the
pinned prices, computed without overflow. No count may fall below the
count last settled for that hire. So every settled amount shows which units it
paid for. A receipt signed for one mix of units cannot settle as another mix
with the same total, and a settlement cannot rewrite earlier usage. The
voucher layout and its EIP-712 type are CIP-8’s, unchanged; the chain keeps
the settled counts with the channel and reports them on the settlement event.
Disputes follow the CIP-8 session dispute
path and the CIP-2 result-dispute window; the Trading Post accepts only
receipts that validate against the session’s binding. Receipt validation is
fail-closed: a receipt that cannot be fully verified, including when the
implementation has no signature-verifying validator deployed, MUST be
rejected, never settled. Settlement ordering is likewise fail-closed as a
whole (§2.3): settle_per_call MUST validate and debit the settled amount
from reserved before any beneficiary payout, so an over-settle
(settled exceeding the reservation) aborts with no partial transfers.
Subscription terms require no session.
2.6.4 Instances
A listing declares one or both peer instance modes; neither is a degraded form of the other. A listing offering both MAY price them differently. Withinstance_mode: Shared, the listed actor serves all hires directly,
partitioning state and (where needed) per-hire private volumes keyed by
hire_id; per-user volume provisioning is performed by the creator’s runner
flow (CIP-2/CIP-9). Shared is the right mode when the creator’s actor is
the product: accumulated state, curated datasets, live credentials, a
creator-operated service. The creator maintains the code and fixes bugs for
every hirer at once. The hirer holds a hire_id claim, not an actor.
With instance_mode: Forked, each hire receives its own actor instance,
spawned by the listed actor itself via CIP-27 clean-mode fork
(fork(mode="clean", new_owner=hirer, payload=hire_config)). Forked is the
right mode when the hirer needs sovereignty: hard state isolation, an
instance they own and fund, private volumes bound to their own actor
address, and an enforced executable commitment (below) that proves the
instance runs exactly the reviewed, attested artifact.
No synchronous bridge exists in either direction between the Rust Trading
Post and PVM code. TradingPostHire cannot enter a PVM handler, and a PVM
handler cannot call the Trading Post’s Rust mutators (host cross-calls
intercept other system actors, not 0x1E, and PVM writes materialize
through the transaction overlay, invisible to the store the Rust handlers
read). Forked hires are therefore three-phase, escrow-backed, verified
against committed state:
-
hire(instance_mode: Forked, hire_config)(system instruction) validates the version’s executable commitment against the listed actor’s live binding (below), escrows the payment, and records aPendingSpawnpinning the complete proposed hire: hirer, version, payment asset and amount, the effective split vector, artifact pin, lease grant, term, upgrade policy, the exacthire_configbytes,child_profile_hash,consent_nonce, and both deadlines. The deadline source is canonical:delivery_deadline = hire_height + SPAWN_TTL_BLOCKSandfinalize_deadline = delivery_deadline + FINALIZE_WINDOW_BLOCKS, withSPAWN_TTL_BLOCKS = 600andFINALIZE_WINDOW_BLOCKS = 600(~10 min each at the 1 s minimum interval). Both are protocol constants, not caller-supplied. Two deadlines, not one, because one is unsatisfiable at the boundary: a directive validly delivered at the single deadline height D commits a child whose state is first inspectable by a finalize transaction at D+1, exactly when a single-deadline reclaim would already be eligible, making the race the protocol’s fault. Delivery is valid throughdelivery_deadline; finalize throughfinalize_deadline; reclaim fromfinalize_deadline + 1; D and D+1 CAS-ordering vectors at both boundaries are pinned. Pinning the full terms makes finalization deterministic. It must not race intervening declaration or pricing changes, and refund must be exact. It also enqueues a spawn directive into the template’s mailbox, a message fromTRADING_POST_SYSTEM_ACTOR(0x1E) with pinned codecb"cip33.spawn.v1" ‖ declaration_id ‖ u32_be(version) ‖ u64_be(consent_nonce) ‖ u64_be(hire_id) ‖ hirer(20) ‖ u64_be(delivery_deadline) ‖ u32_be(len(child_profile)) ‖ child_profile ‖ u32_be(len(hire_config)) ‖ hire_config, the listing identity and consent nonce included so the template can verify the directive’s listing authorization (§2.1.3: a genuine0x1Edirective can exist for a hostile listing if consent were absent), and theinstance_profilebytes included because the template must pass them aschild_manifestin phase 2. The directive IS the authorization, which requires one consensus change this CIP depends on: today mailbox materialization dropsMessage.from, and deferred delivery names the target actor astx.from, so a message-delivered handler’s sender is the actor itself and no origin is authenticatable. The amended rule, with the exact representation pinned:tx.fromon the materialized deferred transaction stays the target actor (for the ordinary deferred class, its account nonce, gas, and digest identity are unchanged, with no replay or fee consequence; theTradingPostSpawnclass below has its own nonce-less identity model), and delivery carriesMessage.fromin a new frame-origin field on the delivered PVM frame, exposed asget_sender(). This is the CIP-41 frame-scoped-context pattern reused: the frame origin is set at delivery, restored/cleared on nested dispatch exactly likeco_signers, and isNonefor ordinary transaction-entered frames.Message.fromis already consensus-written (send_messagestamps the true caller, the Trading Post writes0x1E), so exposing it makes provenance unforgeable without touchingtx.fromsemantics. Digest/replay validation is unaffected; clearing/restoration carries tests mirroring §the CIP-41 provenance suite. Tests: a forged ordinary-actor message presents that actor’s address (guard rejects); a genuine directive presents exactly0x1E; nested calls do not inherit it. Spawn gas is a separate native-CBY escrow, dimensionally distinct from the token price (which may be a CIP-20 token). Two escrows, two conservation equations, never summed: the price escrow satisfiesinitial_due(split) + prepaid + price_refund == price.amountin the price token; the gas escrow, in CBY wei, satisfiesconsumed_wei + returned_wei == deposit_wei. The gas path is fully specified, because no existing mechanism can fund it: the current mailbox rule materializes a deferred transaction that borrows the origin transaction’s gas with no caps, unusable here, where the origin is a hire instruction and the payer must be the escrow. The mechanics below define CIP-33 execution. Under the CIP-40 contract, kind 1 has no producer, lane, digest, fee path, delivery, or execution semantics; only its exact standalone decoder arm exists, and every external and consensus path rejects it as specified by the reciprocal contract below. Execution requires all these mechanisms to agree across their consumers. Required mechanics:-
hire’sgasargument (§2.1.2) supplies{budget: GasBudget, deposit_wei: u64}, deposit u64 like the native ledger; there is no ledger widening. Units are pinned end-to-end and they are wei, with no conversion anywhere:max_fee_per_cycle/max_fee_per_cell/max_fee_per_accessare wei per charged unit, the dimension the operative fee path actually uses (basefee, rate products, and fee debits are native-ledger wei throughout current code; an atto rate here would undercharge this class by 10^9 relative to every ordinary transaction, and this CIP does not propose a network-wide fee-unit change). Validation at hire:deposit_wei ≥ cycles_limit × max_fee_per_cycle + cells_limit × max_fee_per_cell + access_limit × max_fee_per_access(each product and the sum checked in u128, result must fit u64);access_limitis in charged units and is floor-converted to the structural capacity at delivery under CIP-43 §5.2, then scaled once at settlement. The pinned budget covers the complete directive, including its gate, setup, fork and callback; no Access charge may bypass this authority. Any limit of zero, or an overflowing product/sum, rejects. The deposit moves from the hirer to Trading Post custody in the hire execution;PendingSpawn.gas_escrowrecords{budget, deposit_wei, consumed_wei: 0}. -
This CIP’s third consensus change
(§1.2) is a new deferred transaction class,
TradingPostSpawn, not a payer flag on the existing class. The existing deferred class borrows origin gas, requires its fee fields zero, and charges the executing actor (or owner) only on success with error/OOG outcomes paying nothing; none of that composes with an escrow that must be debited on success and failure.TradingPostSpawnis consensus-produced only (materialized by the hire execution; it has no user-submittable form). Its authentication is a committed record binding the complete transaction: the hire execution constructs the fullTradingPostSpawntransaction deterministically, computes its canonical digest, and writes aSpawnDirective { hire_id, template, tx_digest, envelope_hash, consumed: bool }row in Trading Post state. Delivery validates by one comparison: the presented transaction’s canonical digest equals the committedtx_digest, which therefore binds origin =0x1E, budget = exactly the escrowed budget, the class discriminant, and the byte-exact directive body in a single check (no field is verified by convention, because every field is inside the digest), then a consume CAS (consumed: false → true); a transaction with no matching unconsumed row is invalid outright (no replay, no forgery, no second delivery). The template’s own consumed-mark independently prevents handler re-invocation. The0x1Eorigin is a typed field of the transaction class itself, which delivery loads directly into the frame-originget_sender()reads; the genericMessage.fromframe-origin rule above remains for ordinary mailbox traffic, but this class does not depend on that plumbing. Its identity model is pinned as nonce-less: kind-1 carries nochain_id, no account nonce, and no signature fields at all; replay protection is the consume-CAS on the committedSpawnDirectiverow (strictly stronger than a nonce: exactly one execution ever), and any future activated transaction identity must bind CIP-40’s exactChainIdentity. A genesis-header digest or locally inferred value cannot substitute for it. The template is named astx.fromfor frame-identity only; its account nonce is never read or mutated by this class. Before execution, delivery checks the digest/CAS match above,PendingSpawn.status == Pending, andheight ≤ delivery_deadline. A directive presented after reclaim, after finalization, or past its deadline is invalid with zero consumption, never merely faulted. It executes under the pinnedbudgetand settles at its own commit boundary: on every one of the six outcome cases, ONE outer commit atomically writes the whole fee tail (SpawnDirective.consumed = true,gas_escrow.consumed_wei, the escrow debit, and the fee burn/distribution), while the directive’s application effects commit only on success and roll back on failure inside it. The pairing is indivisible by construction: no outcome can consume the directive without settling, or settle without consuming, or roll backconsumedwhile a debit stands (each of those asymmetries is a replay or a theft). Mirror-image rule on the other side:reclaim_spawn’s single atomic authority is thePending → RefundedCAS on the pending record, and under it the directive row has two valid branches. It MUST NOT demand a fresh consume-CAS unconditionally, because every attempted deterministic delivery (guard fault or exhaustion of Cycles, Cells or Accesses included) terminalizesconsumed = true, and a reclaim that requiresfalse → trueafter a failed attempt would strand both escrows forever: (a)consumed == false(directive never delivered / expired) requires consuming it now, then refunding; (b)consumed == truefrom a terminal delivery outcome requires verifying the terminal settlement and refunding without a second CAS. Either way no live spawn authorization survives a refund. Vectors check reclaim after guard fault, OOC, OOCe, Access exhaustion and rate-cap failure (each refunding price in full anddeposit − consumed), reclaim after undelivered expiry, and the delivery-vs-reclaim ordering race (whichever commits first wins; the loser is invalid, nothing double-spends). The proposedSpawnDirective.tx_digestflow above is reserved: kind 1 has no transaction identity or signing digest at the v3 genesis. No code may invent one to execute that flow. A later CIP-33 specification must reconcile the directive commitment before enabling kind 1. Transaction-v3 uses the shared transaction envelope defined in CIP-40 §7.1:u8 version=3 ‖ u8 kind ‖ body. Kind 0 uses CIP-40’s exact ordinary field order, including per-slot algorithm/mode/public-key descriptors, the reserved nonce lane and sponsor with its fee/expiry terms, and delivery provenance. It carries no inner version byte. Only version 3 is decoded after fresh genesis; version 2 is rejected. The shared standalone decoder also recognizes kind 1 as the unsigned exact byte concatenationu64_be(hire_id) ‖ template[20] ‖ origin[20] ‖ u64_be(cycles_limit) ‖ u64_be(cells_limit) ‖ u64_be(access_limit) ‖ u64_be(max_fee_per_cycle) ‖ u64_be(max_fee_per_cell) ‖ u128_be(max_fee_per_access) ‖ u32_le(directive_len) ‖ directive[directive_len].directive_len <= CIP33_SPAWN_DIRECTIVE_MAX_BYTES = 49,254; length mismatch, cap excess, or trailing bytes reject. The sixu64fields and oneu128field are fixed-width big-endian and the directive length is fixed-width little-endian; this body does not use kind 0’s minimal-UIntscalar codec. It carries no signature fields. Under the CIP-40 contract, every external RPC/mempool path and every consensus block-validation, import, replay, and execution path rejects a decoded kind 1 before lane selection, digest use, recovery, state, event, or execution; a block containing it is invalid. No kind-1 producer or capability is advertised. CIP-33 must define and implement the complete execution policy before any lane or execution semantics below become active. Kind 0 alone has a signing hash and transaction identity:keccak256(b"cowboy.tx.v3" ‖ u64_be(chain_id) ‖ chain_instance_id(32) ‖ full v3 encoding with every slot signature value zeroed, preserving its length), except that an algorithm-5 slot contributes the empty vector (CIP-40 §7.1 owns this rule).chain_idandchain_instance_idare the indivisibleChainIdentityreturned by CIP-40’s closed/chain-inforesponse;genesis_digestis not a transaction context or response member. Kind 1 has no signing preimage, signing hash, typed-data object, or signature fixture under the CIP-40 contract. The corpus proves kind-0 native/EIP-712 signing, kind-1 standalone decode/re-encode followed by rejection at every external and consensus boundary, unknown-kind outer rejection, and cross-version/kind mutation failure. -
Fees debit
gas_escrow.deposit_wei, never the template’s balance, never origin gas. -
Directives execute in the deterministic deferred
pipeline, not a priced mempool, so there is no priority-fee or tip
dimension: consumption is charged at the block’s effective CIP-3
rates, capped by
max_fee_per_cycle/max_fee_per_cell/max_fee_per_access. If any block rate exceeds its corresponding cap at delivery, the directive is not executed, a spawn failure with zero consumption; it dead-letters and the full deposit is reclaimable. There is no retry in v1: one directive, one delivery attempt. -
As the directive executes, consumed Cycles/Cells and charged Accesses
price in wei exactly as an ordinary transaction’s do (same
constants, same arithmetic, no unit boundary exists to cross);
the settlement point writes the total into
gas_escrow.consumed_wei(≤deposit_weiby the budget bound). Consumed fees are burned/distributed exactly as ordinary CIP-3 fees. Escrow changes only the payer. OOG against the budget is a spawn failure that keepsconsumed_weias consumed, leaves the remainder and the whole price escrow reclaimable. The three-track budget and capped rates proveconsumed_wei <= deposit_wei; settlement and refund use checked arithmetic and reject any inconsistent escrow record before committing a debit or refund, never wrapping or silently clamping. Parity vectors pin that one cycle/cell/charged Access costs this class the same wei as an ordinary transaction at the same block.finalize_spawnandreclaim_spawneach returndeposit_wei − consumed_weito the hirer; consumed gas is never refunded; gas is the only cost a failed spawn can impose. The consensus outcome set covers exactly six cases: success, template guard fault,OutOfCycles,OutOfCells, Access exhaustion, and rate-cap rejection (the only zero-consumption case). Access exhaustion uses CIP-43’s existingExecutionStatus::OutOfGaswithaccesses_used, not a new receipt error code. The current error interface combines execution outcomes and node faults into oneStoreErrorthat becomes a zero-gas failed receipt. The fee model requires two distinct error classes. Deterministic resource rejections (StorageFull,MailboxFull, quota rejections, facts every validator computes identically from state) are guard-fault-class outcomes, charged and settled under the one outer commit like any fault the directive’s own code raises; validator-local faults (IO errors, corruption, events other validators did not experience) are a typed non-outcome: no receipt, no charge, no settlement, node-local halt/retry, because charging on them is consensus divergence by construction. EveryStoreErrorvariant MUST map explicitly to one of these two classes. Acceptance covers all six cases, plus exact Access capacity / capacity+1 and the maximum escrow bound, each proving exactly one escrow debit, the matchingconsumed_weiCAS update, correct fee burn/distribution, and the correct execution-state rollback alongside a committed fee settlement.
-
-
Spawn (mailbox delivery of the directive).
spawn_instanceruns as the directive’s message handler; the template’s guard checks, in order:get_sender() == TRADING_POST_SYSTEM_ACTOR(consensus-grounded provenance); the directive’s{declaration_id, version, consent_nonce}against the listing identity recorded in the template’s own storage at consent time (§2.1.3; provenance alone cannot distinguish an authorized listing from a hostile one, since both produce genuine0x1Edirectives); the deadline from the directive body; and a mark-directive-consumed flag in template storage (mailbox delivery is once; the mark prevents handler-level re-invocation). Nothing here trusts caller-supplied fields: every directive field was written by the hire instruction. A spawn attempt from any other sender, or for a listing the template never consented to, fails before any child exists orfork_countis consumed. The template then callsfork(mode="clean", new_owner=hirer, child_manifest=child_profile, payload=envelope).child_profileis the version’sinstance_profilebytes, delivered in the directive, and passing it is mandatory: the template’s own manifest necessarily carries grants (exec.forkat minimum) that the version’sinstance_profilecannot retain (§2.6.4’sdeclare_versionrejection rule), so a profile-less fork (valid under CIP-27 §3.7.1 only when the verbatim parent manifest passes) would produce a child whose manifest hash equals the template’s, failing theinstance_commitmentcheck at finalization. The envelope isThe widths, order, and golden vectors are fixed. The listing identity and authorization epoch are inside the payload the child provably received. A finalized child commits to its declaration, version, consent, and hire.MAX_CIP33_HIRE_CONFIG_BYTES = 32,768. The directive’s fixed overhead is exactly 102 bytes andMAX_FORK_PROFILE_BYTES = 16,384, so the 65,536-byte message limit permits at most65,536 − 102 − 16,384 = 49,050config bytes. The smaller 32,768-byte config cap is therefore closed with margin. The exact maximum directive isCIP33_SPAWN_DIRECTIVE_MAX_BYTES = 102 + 16,384 + 32,768 = 49,254bytes; its 108-byte fixed body overhead is8 + 20 + 20 + 5×8 + 16 + 4, so the maximum kind-1 body is 49,362 bytes and the complete version/kind shell is 49,364 bytes. Exact-max, cap+1, truncated-length, and trailing-byte vectors are pinned for the standalone decoder. The CIP-27 fork receipt (__FORK_MODE__,__FORK_PAYLOAD_HASH__, birth-only, host-written slots actor code cannot set) binds the child to the keccak of those exact delivered bytes. -
finalize_spawn(hire_id, instance_address)(system instruction, submittable by anyone) verifies the committed child state, fail-closed:parentequalsPendingSpawn.template_actor, the actor that actually forked, which is NOTdeclaration.actor(the Shared serving identity; the two coincide only when a listing points both at one actor); the child’scode_hashand CIP-26 library pins equal the version’sinstance_commitment(identical to the template’s by construction), and the child’s effective manifest hash equalsinstance_commitment.manifest_hash, the pinned fork profile. The template’s manifest necessarily differs (§the executable commitment below);__OWNER__is the hirer;__FORK_MODE__is clean; and__FORK_PAYLOAD_HASH__equals the keccak of the envelope re-encoded from the pinned record.PendingSpawnstores the exacthire_configbytes (≤MAX_CIP33_HIRE_CONFIG_BYTES),consent_nonce, andchild_profile_hash, so finalize re-encodesb"cip33.env.v2" ‖ declaration_id ‖ u32_be(version) ‖ u64_be(consent_nonce) ‖ u64_be(hire_id) ‖ u32_be(len) ‖ hire_configand compares byte-identical constructions, never a hash of a hash. This binds the child to this pending hire of this listing: declaration, version, andhire_idare all inside the envelope the callback actually received. Finalization is a compare-and-swap on the pending record’s state (Pending → Finalized, orPending → Refundedon reclaim; any other transition rejects), and the Trading Post maintains a uniqueness index oninstance_addressso one child can satisfy exactly one hire; two identical pending hires need two spawns. Settlement on success follows the existing hire economics, at finalize time: the pinned{initial_due, prepaid, token}releases onlyinitial_duethrough the split, the OneShot price, or zero for Free, the only v1 Forked terms (below); any surplus carries asHire.prepaid.hire_blockanchors at successful finalization, not phase-1 escrow (paid_through = ∞for OneShot; unused for Free), so creator delay burns nothing the hirer paid for. Both escrows conserve exactly across finalize, reclaim, and failure, each in its own equation (phase 1): the price token as split + prepaid + refund, the gas escrow as consumed + returned, with boundary and race tests. Only on success is theHirewritten withinstance_address. A pending spawn that missesfinalize_deadlinelets anyone trigger reclaim from the next block, returning the price escrow in full and the gas escrow minus consumption to the pinned hirer. An unresponsive creator costs the hirer time and at most the pinned gas budget, never the price.
- The protocol requires job submissions to carry their hire identity. The
Trading Post’s reverse index is a permanent
set: entries are written at version activation and survive consent
revocation, version retirement, declaration retirement, and every
other lifecycle transition forever, exactly like the serving-actor
tombstones, and no GC path removes them or
SpawnDirectiverows (this matters because the rule below that treats an actor with no match as ordinary fails open: it is only safe while the records it consults can never have been cleaned up). For a submission from an actor whoseparentis an ever-registeredtemplate_actor, dispatch and result acceptance read the child’s birth receipt: if__FORK_PAYLOAD_HASH__equals theenvelope_hashof a recordedSpawnDirective(the committed row of §2.6.4’s typed class; this IS the hire identity:envelope_hash → hire_id; rows are permanent, so the check holds for the child’s whole lifetime), the child is a hire instance and is admissible only as that hire’s finalizedserving_actorunder the canonical validity predicate. A pending or orphaned child cannot enter the compute layer. A child of a template whose receipt matches no recorded directive is not a hire instance and passes as an ordinary actor: the parentage test alone quarantines nothing, so a template’s own operational forks and their descendants are not overblocked. Lifecycle tests: the quarantine holds unchanged after directive consumption, after reclaim, after consent revocation, and after declaration/version retirement; an orphan never ages into an unbound job actor. - Templates conforming to this CIP
gate every application handler on an activation check that is a
read, not a message: the SDK base’s
on_fork_cleanrecords the envelope’shire_idand a pending mark; on invocation while pending, the gatecall()s the Trading Post read methods (get_hire(hire_id), over the §2.1.2 read bridge). What it may cache is immutable identity only. The statement “a finalizedHirewithinstance_address= me exists” remains true after finalization. What it MUST NOT cache is lifecycle: on every handler invocation the gate re-reads the hire’s mutable state and serves only whileHire.statusand the canonical §2.5.1 per-term predicate pass. A gate that latched a one-time positive check would keep serving throughpauseandrevoke_hire(and could even activate on a hire paused before the instance’s first call), bypassing the lifecycle controls the binding rules mandate. The re-read is one bridge call per invocation, priced like any cross-call read. The state reads are precise: before finalization noHireexists:get_hirereturns not-found and the pending/refunded states live onget_pending_spawn(hire_id), so the gate’s rule is “activate on a matching finalizedHire, stay inert on not-found or anyPendingSpawnstate,” never a status read of a record that isn’t there. Activation is a consensus-state read of the same fact as settlement:finalize_spawnwriting theHiresimultaneously makes the hirer’s payment effective and the child’s gate satisfiable, deterministically, on every validator, with no second message leg to fail. An unfinalized child reads not-found / aPendingSpawnstate and stays inert forever. This is actor code, but it is exactly the code theinstance_commitmentpins and the attestation covers: a template without the gate is visible in review, and the party it fails is its own creator (the free product is carved out of the creator’s revenue, nobody else’s). Attesters SHOULD treat a missing gate as review-relevant.
Hire commits), a hire paused
before the instance’s first call never serving, and pause /
revoke_hire after activation stopping service at the next invocation
(the per-invocation lifecycle re-read). Templates additionally carry the CIP-27 §3.7.1
fork profile: §2.6.4’s declare_version rejection rule enforces
that hired instances drop exec.fork, so
an instance cannot itself spawn further untracked clones.
A DeclarationVersion pins a CBFS
manifest_root that identifies content, not code. Fork clones the listed actor’s live
code_hash and library pins, so without a code commitment a creator could
upgrade the actor after version v1 was attested and every subsequent “v1”
hire would receive current, unreviewed code under v1’s attestations,
pricing, and leases. Forked-mode versions therefore pin two commitments at declaration
time, because one cannot serve both phases: the template necessarily runs
with grants (exec.fork at minimum) that the hired child’s profile MUST
NOT retain. This CIP’s MUST is enforced at
declare_version: a Forked instance_profile that retains
exec.fork rejects at declaration (conformance vector: an
instance_profile byte-identical to the template’s manifest rejects).
CIP-27 §3.7.1 supplies only a subset rule. The §3.7.1 rule admits equality, and
CIP-27 explicitly leaves recursive fork as “the template’s explicit
choice via the profile.” Without the rejection rule the premise below
fails (a profile retaining exec.fork and otherwise equal to the
template’s manifest would make the two commitment tuples byte-identical,
collapsing the two-tuple design). With it, the template’s manifest bytes
(which carry exec.fork) and the child’s (which cannot) are distinct
by construction, and their hashes differ except under a Keccak
collision. A single tuple would require hire()
and finalize_spawn to accept contradictory manifests.
There is no domain separation between the template and instance preimages.
Both are bare keccak256 over canonical manifest bytes (the template’s
node-derived manifest hash must remain comparable to hire()’s on-chain
read, which is why a CIP-33-local prefix is not used), so distinctness
depends on Keccak collision resistance over preimages the
declare_version rule keeps distinct. The guarantee is cryptographic, not structural. Role
substitution independently fails on the commitment’s positional tuple
binding. A future change of hash function MUST revisit this property.
template_commitment (code_hash, lib_pins_hash, manifest_hash) is the
template’s own live tuple: hire() checks the template against it.
instance_commitment shares code_hash/lib_pins_hash (clean fork
never changes code or pins) but its manifest_hash is
keccak256(instance_profile), the version’s pinned CIP-27 fork-profile
bytes, the attenuated manifest hired children actually run:
finalize_spawn checks the child against it. Hash canonicalization
(nothing here may depend on storage iteration order): lib_pins_hash =
keccak256(b"cip33.pins.v1" ‖ u32_be(pin_count) ‖ pins…) where each pin’s
preimage is u8(len(name)) ‖ name ‖ code_hash(32), where name is the
ActorLibPin.name ASCII bytes (1..=64, the pin table’s identity; there
is no other “library id”) and code_hash its pinned digest, pins sorted
bytewise ascending by name, duplicate names rejected, pin_count
exactly the actor’s pin-table size, and the preimage consumed to exact
EOF (trailing bytes reject). Each manifest_hash = keccak256 of the
manifest’s canonical codec bytes; each commitment’s codec bytes are the
three hashes in the order shown. Permutation vectors prove pin/manifest-entry
insertion order cannot change consent, finalize, or attestation identity.
Attestations (§2.7) on Forked-capable versions bind the full tuple, not
manifest_root alone: the attestation subject key is the §2.1
canonical form,
keccak256(b"cip33.attest.v1" ‖ declaration_id ‖ u32_be(version) ‖ code_hash ‖ lib_pins_hash ‖ template_manifest_hash ‖ instance_manifest_hash ‖ manifest_root). Two append-only versions can share a
manifest_root while differing in code, pins, or manifest, and a client
indexed by root would inherit an old Approved verdict for unreviewed
executables; per §2.1, root subjects never satisfy a Forked-version
requirement. Self-fork
cannot instantiate an old version if the listed actor has upgraded past
a version’s commitment, Forked hires of that version fail at hire() (the
live-binding precheck). Each Forked-capable DeclarationVersion carries an immutable
template_actor address whose live executable tuple must equal the
version’s template_commitment at hire() time; PendingSpawn pins it, phase 2’s
spawn targets it, and finalize_spawn’s parent check verifies against it.
declaration.actor remains the Shared-mode serving identity only. A
Forked template cannot upgrade_self in place (it must not
carry sys.upgrade in an instantiable manifest), so
each executable version is its own deployed template. Two simultaneously
live versions (two templates, distinct commitments, hires against both)
carry a dedicated test.
In Shared mode, the creator owns the state and pushes code fixes. In Forked
mode, the hirer owns the state and the instance’s code is frozen, with upgrades
discussed below. A Forked hire uses only clean-mode fork. The listed actor’s
hire ledgers, volume pointers, and credential references never reach an
instance. Full-copy fork is NOT a hire mode: cross-principal full copies
are ruled out by CIP-27’s identity-boundary inheritance rules, and a live mutable state
snapshot cannot be attested by this commitment. The commitment pins code; nothing pins what
the parent’s storage contained at spawn. Snapshot-semantics listings (a
pre-trained game world sold as state) would need a pinned, content-addressed
storage-root commitment of their own. This CIP leaves that mode to future work.
v1 Forked instances are frozen because sys.upgrade is registry non-inheritable, and
no fork of any kind may carry a non-inheritable grant across the identity boundary (CIP-27 §3.7.1), so an
instance structurally cannot upgrade_self, and ownership alone confers
no upgrade power anyway. Freezing is also what keeps the executable
commitment valid. An instance that could change its code would
invalidate the attestation, lease, and pricing its hire was granted
under. Instance upgrades, when they come, are a Trading Post version
transition, not an in-place mutation. They require a new version with a new
commitment and instance verification against it. That protocol is future work, and
upgrade_policy is reserved in the data model for it.
The canonical §2.1
definitions carry InstanceOffer, PendingSpawn, the
DeclarationVersion.{template_actor, template_commitment, instance_profile, instance_commitment} fields, the
Hire.{instance_mode, serving_actor, instance_address} fields, the tagged
AttestationSubject, and the hire / finalize_spawn / reclaim_spawn
methods. instance_offers is structurally bounded: one or two offers, modes
unique (a duplicate mode rejects at declare_version), at most four
terms per offer, no duplicate terms within an offer. Terms are
mode-qualified by construction (a Forked hire cannot
select a Shared-priced term); the deadline boundaries are inclusive (delivery through
delivery_deadline, finalize through
finalize_deadline, reclaim from finalize_deadline + 1);
finalize/reclaim are Pending → Finalized | Refunded CAS transitions with
any terminal-state call rejected (duplicate finalization, reclaim after
finalize); a uniqueness index on finalized instance_address enforces one
child per hire. serving_actor is the single canonical serving identity
every downstream authority (runner admission, CBSS release, MPP,
settle_per_call) compares against.
v1 Forked offers carry Free and OneShot terms only. Metered
terms (PerCall, Subscription) are rejected on a Forked InstanceOffer.
Metered revenue against a hirer-owned instance is uncollectable in v1: the
hirer may call their own instance directly, bypassing any MPP session.
Deferring metered Forked terms to a future version keeps the protocol from
listing revenue it cannot enforce.
Two binding rules are mandatory in v1 regardless of term, because even
Free/OneShot hires support pause/revoke/status. The reverse index is
scoped to Forked instances, with one hire per instance; a Shared serving_actor is declaration.actor serving
arbitrarily many hires and is deliberately NOT in this index (each Shared
job binds to its hire_id directly, as today). Job dispatch and result
acceptance (§the runner sections) require a submission from an indexed
serving_actor to carry its exact binding and that hire to pass the
canonical §2.5.1 term-validity predicate, the same one cbssd
evaluates, with its per-term conditions exactly as written there. The hire must be
Active. Subscription/OneShot checks paid_through (declaration
retirement and grant revocation deliberately do NOT invalidate paid
time, §2.4’s consumer-protection rule, which this predicate must not
quietly override; a OneShot hire outlives its listing by design);
PerCall requires an open funded session; Free requires the declaration and grant (if any)
to be Active (Free carries no paid time to protect, so listing state is its
validity). Neither Hire.status alone nor a blanket listing-liveness test
suffices; the term-specific checks apply. An unbound, wrong-binding, or predicate-failing
submission from an indexed address rejects. The index entry is
written at finalization and is permanent across every lifecycle state.
The dispatcher’s current
hire_binding is optional and validated only when present, so an address
that fell out of the index would re-enter the unindexed path and a
revoked public instance would serve again as an ordinary actor. Removing
the index entry would undo revocation. Revocation flips the hire’s
status; the tombstone mapping the address to its hire outlives every lifecycle state.
Instance ownership transfer leaves serving_actor, the index entry, and
the binding unchanged: owning the actor is not owning the hire. Tests:
unbound and wrong-binding submissions while Active, Paused, Revoked, and
after ownership transfer, all rejected; the revoked address never serves
unindexed; predicate transitions test per-term: declaration retirement /
grant revocation invalidate a Free hire at the transition block but
leave a paid-through OneShot/Subscription hire serving (§2.4); lapse and
an unfunded PerCall session invalidate their own terms. When metered Forked terms arrive, MPP binds to
(hire_id, version, serving_actor) and settle_per_call authority is
serving_actor.
A Forked hire’s spawn-time payment flows through the pinned
split vector (§2.3) at finalization like any other hire. Metered terms are
not offered on Forked hires in v1 (above); when a future version adds
them, the MPP session binds to (hire_id, version, serving_actor), the
serving identity. A binding to (hire_id, version) alone would omit that identity. Whether creators
receive a continuing share of a Forked instance’s downstream revenue
remains open (§6).
Acceptance (Forked mode): a spawn attempt from any sender other than
TRADING_POST_SYSTEM_ACTOR, a directive whose
{declaration_id, version, consent_nonce} does not match the template’s
recorded consent (§2.1.3), a re-invocation after the consumed mark, and
a directive past its deadline each rejected before any child exists
(no fork_count consumed); gas-escrow conservation
(consumed + returned == deposit) verified at all four terminals
(finalize, reclaim, rate-cap failure, OOG failure); envelope golden vectors byte-identical between
phase-2 construction and finalize re-encoding; duplicate finalization and reclaim-after-finalize fail against
the terminal CAS state; one child cannot finalize two identical pending
hires (uniqueness index); a Forked hire selecting a Shared-offer term
rejects; a child forked without the pinned profile (its effective
manifest hashing to the template’s, not instance_commitment’s) fails
finalization; attestation subject changes when any element of the
executable tuple, including either manifest hash, changes while
manifest_root is held constant; pin/manifest permutation vectors leave
every commitment, consent, and subject identity unchanged.
2.6.5 Transaction Decoding and Execution
CIP-40 defines the shared Transaction-v3 envelope, while CIP-33 defines its kind-1TradingPostSpawn body. Standalone decoding of that body is required for codec conformance; it does not authorize execution. External submission and consensus validation MUST reject kind 1 until the complete forked-hiring execution contract is implemented.
Forked hiring requires the producer, lane classification, escrow fee path, mailbox delivery, digest, execution handler, runner authorization, and lease authorization in §2.6.4. The protocol, node, PVM SDK, runner, CBSS, bindings, CLI, and wallet codecs MUST agree on the same executable identity, fee, and lifecycle contract, with cross-crate conformance tests. A decoder-only implementation is not a complete forked-hiring implementation.
Runner and lease authorization require extension. The current checks do
not know instances exist. Job binding today authorizes the hirer or
declaration.actor. It does not admit a per-hire instance address. The CBSS lease
release validates hire, version, artifact, and term, but neither the
instance address nor its current code binding. Forked mode adds both,
normatively, through the single canonical field: job authorization admits
Hire.serving_actor, and lease release verifies the requesting address
equals serving_actor and (Forked) the instance’s committed code
binding against the version’s executable commitment. A lease MUST NOT serve an instance
whose binding no longer matches (defense in depth under the v1 freeze; the
gate that matters if upgrades ever arrive). A clean-forked instance
carries no sealed state, so the lease is granted fresh to the instance
address at finalization.
2.7 Attestations
Attestation records bind(attester, subject, verdict, policy_uri), where
subject is the tagged AttestationSubject (§2.1), a bare
manifest_root (Shared-mode code) or a version’s full executable tuple
(ExecutableV1, mandatory for Forked-capable versions). Every index, cap,
and supersession rule below is keyed by the subject key (the recomputed
hash for ExecutableV1, the root for ManifestRootV1), never by
manifest_root alone. Properties:
- Any address may attest; there is no attester registry to gatekeep.
Wallets, dashboards, and stores choose
which attesters to honor and how to render unattested code (e.g.,
Android-style friction). The protocol ranks nothing. It imposes a hard cap of
MAX_ATTESTERS_PER_SUBJECT = 1024distinct attesters per subject key, the cap the current implementation already carries. Implementations must use this exact cap; choosing another would cause consensus divergence. At the cap, a new attester’s record rejects; supersession by an already-listed attester MUST still succeed, so a full index can never block an attester from downgrading a prior verdict. Whole-list reads are acceptable under the cap;list_attestationsreturns the full subject index in attester-key order, no cursor. - An attestation never carries to a different
subject key. A new root, or any change in a version’s executable tuple,
is a new subject and needs its own attestation (§2.6.4). Two versions sharing a
manifest_roothave distinctExecutableV1subject keys. - For a Public Store copy of Shared-mode content, approval of
the publisher source root does not approve a different serving root.
Clients that require Store approval MUST check the attestation on the
selected artifact’s
claimed_root. That attestation approves the copy; it does not independently prove equivalence with the source. A verdict downgrade on that serving root applies to the copy under the client’s policy. Root-only approval never satisfies a Forked-capable version’s attestation requirement. - State holds exactly one record
per
(attester, subject)key, and a new verdict replaces it, so an attester can downgrade a priorApprovedtoFlaggedorRejected, and per-subject state is bounded at1024 × one record(an append-only history under the attester cap would let one admitted attester grow a subject forever). Verdict history comes from CIP-29 events. Everyattestemits an event, and indexers reconstruct timelines from the event log, not consensus state.Flaggedis advisory. Clients SHOULD surface it prominently; it gates nothing protocol-side. - Cowboy Labs’ review organization is one attester, whose verdicts the flagship store and first-party clients choose to require.
2.8 Events
Every state transition in §2.1 emits a named CIP-29 event carrying the affected ids and (for lifecycle transitions) the acting party. Store-initiatedpause/revoke_hire events make store interventions publicly auditable.
3. Economics and neutrality
The Trading Post charges nothing beyond gas. Store commission is a market price set per grant; competing stores may undercut it; creators may multi-home across stores or sell direct. The chain’s revenue from a thriving hire economy is store-agnostic: every hire’s execution buys compute and gas regardless of which storefront brokered it. The protocol earns revenue from computation; distribution remains open to competing stores.4. Security considerations
- The Trading Post is a high-value target because it custodies split execution and lease state. Mitigations: CIP-12 upgrade governance, no operational superpowers to abuse (§2.1 neutrality invariant), splits executed by simple arithmetic over validated vectors, and the actor-model’s single-threaded method execution (no reentrancy across a split’s transfers; token transfers are CIP-20 syscalls inside one method execution).
- All mutating methods authenticate the caller
against the object’s authority field (creator, store operator, or hirer);
standard actor-call sender authentication. The one in-actor signature
check is the gate pass (§2.1.5), which adds admission and never
replaces sender authentication.
declaration_idpreimage verification (§2.1.1) prevents id squatting, and §2.1.3 listing consent prevents the inverse forgery, declaring an actor you do not control as your listing or template and steering protocol-authentic spawn directives at it. - The Trading Post holds per-hire balances; only the
hirer can withdraw, only
renew/settle_per_callcan draw, andrevoke_hirerefunds automatically. Balance accounting is per-hire and requires no pooled-fund invariants. - A Public Store registration binds the immutable source version to the actual serving root after the Store verifies the copy (§2.1.2). Consensus checks the destination commitment, ownership, visibility, status, and root at registration and pins Public volumes against manifest commits, owner transfers, owner deletion, and ID reuse while the count remains nonzero. It does not compare the source and destination files. A false equivalence claim is attributable to the registering operator and can be checked by readers of both pinned manifests and their contents. A serving-root attestation approves that copy. It does not prove equivalence with the source. Private artifacts retain the signed root-equality claim in §2.5.1. Readers with decryption access can compare their content with the claimed root. Attesters can downgrade their verdict (§2.7). A cryptographic equivalence proof remains an open question.
- The issuance policy in
cbssdreads chain state.cbssdimplements its own chain interaction and has drifted from node before. The policy check MUST be covered by e2e tests against a live devnet node; unit fixtures alone do not suffice. - Vector caps (8 entries, no zero shares) bound transfer fanout. Beneficiary addresses are not validated as live; a transfer to a dead address burns that share, which is the beneficiary’s risk, as with any CIP-20 transfer.
attestis open to any address (§2.7), so a hostile attester can grow a subject’s attestation index without bound. §2.7 bounds it with the exactMAX_ATTESTERS_PER_SUBJECT = 1024cap. The cap carries a residual: Sybil attesters can fill a subject’s index and block new attesters from recording verdicts on it. The protocol accepts this risk because filling costs gas per record and verdicts from unrecognized attesters carry no client trust weight; attesters clients rely on SHOULD attest at review time, before an adversary targets the root. Spam records themselves carry no trust weight because clients filter by attester.- A leaked store gate key admits anyone to that
store’s gated grants and to every direct path delegated to it with
Store(store_id), which is no worse than those paths being ungated; payment, splits, and leases are unaffected. The store rotates withset_hire_gate, and every outstanding pass under the old key fails at once on all of those paths because the check reads the current key. A leakedSignerdirect gate key is rotated by the creator withset_direct_hire_gate. - Scope-limited pause powers, open store registration, direct hire, and public events bound store-side censorship. A store’s gate censors only the paths a creator gated with that store (§2.1.5).
- The cached-DEK risk (§2.5.3) is bounded by settlement refusal and runner stake. Revisit it if runner trust assumptions weaken.
5. Out of scope
Review policy and curation; commission values; fork attribution economics (CIP-27 follow-up); creator-code semantics beyond split entries; store UX; fiat display and funding rails (CIP-18/CIP-28 territory).6. Open questions
- CIP-24 rewrapping keeps the DEK, so a shorter cadence changes nothing about what a cached key opens (CIP-9 §9.4.1). Real rotation requires re-encryption and does not exist yet; its requirements and unsolved problems are in CIP-9 §9.4.2–§9.4.3. Until one of those is filled, the cached-DEK residual this CIP accepts has no mitigation beyond shortening the hire term. Candidate for a CIP-33.r2 once runner-trust data exists.
- What
PerCallrate-limit defaults and MPP session caps should apply to hostile hiring actors. - Whether a curated capability-schema type catalog (beyond free-form JSON Schema) earns its complexity once agent-hire volume exists.
- Whether
instance_mode: Forkedshould become the default once CIP-27 stabilizes. - Per-period escrow of executed splits, enabling protocol-level pro-rata
clawback on trust-and-safety revocation (v1 refunds only unspent
prepaid, §2.4). - Cryptographic plaintext-equivalence proof binding a
ServingArtifactto its version’s executable subject (v1: signed claim + social detectability, §4).