Status: Draft
Type: Standards Track
Category: Core
Created: 2026-06-17
Requires: CIP-2 (Off-chain Compute / Runners), CIP-20 (Fungible Tokens), CIP-24 (CBSS Secrets Manager — v1 SEALED mode uses the §3.4.6 Time-Lock Release amendment, now merged; see §Sealed-Bid), CIP-25 (Cross-Chain Architecture)
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.
Revision history
- r1 (2026-06-17): Defines the intent-settlement primitive (a Verifier system actor, runner solvers and CBSS sealing) and pluggable cross-chain backends (native CIP-25, ERC-7683/OIF and NEAR Intents) as CIP-25 L3 applications.
- r2 (2026-06-29): Account-path CBY deposits debit the native-CBY account directly (the tx model has no attached-value field). States the v1 SEALED-mode CIP-24 dependency (caller-chosen auction identity, height-triggered release). Specifies checked-
i128conservation arithmetic. Allocates opcodes in theSystemInstructionenum (the WP has no §9.2 opcode table). Specifies the sealed-solver dispute mapping and cites WP §16.3 forEventListener.- r6 (2026-06-29): WP §9.1 allocates
0x14toINTENT_SETTLEMENT(this change amends the table) and reassigns the deferredEventListenerto0x15. Reserves opcodes146–151(next free above codec max145) for the sixIntent*instructions. Fills the Parameters table with defaults (MAX_SETTLE_INTENTS=64,MAX_DIFFS_PER_INTENT=16,GC_GRACE=256,AUCTION_GRACE=50,RECLAIM_GRACE=256,WITHDRAW_TTL=86_400blocks,SETTLEMENT_DOMAIN_VERSION=1; inbound caps per corridor with a mandatory kill switch).- r5 (2026-06-29): Constrains a Withdraw intent to exactly one outbound diff, so the escrow target is unambiguous. Enumerates the signing-digest
method/kindas a fixedIntentKindenum (SETTLE|WITHDRAW), so a signature for one kind cannot be replayed as another.- r4 (2026-06-29): Credits
TokenDiffsurplus to the solver (a non-solver signer receives exactly theirMinReceivefloor). Adds the Parameters table and splitsGRACEintoGC_GRACE,AUCTION_GRACEandRECLAIM_GRACE. Measuresmin_finalityin destination-chain blocks, enforced throughfinality_level()atbegin()andprove_delivery. MakesSETTLEMENT_DOMAIN_VERSIONa stableu16. Defines theopen_auctionAuctionGrant delegation, CBY’sLedger-Backinganalog, and the pegged-token mint_authority bootstrap.- r3 (2026-06-29): Backs inbound
credit_depositwith a checked CIP-20 mint and adds theLedger-Backinginvariant. Bounds bundle work withMAX_SETTLE_INTENTSandMAX_DIFFS_PER_INTENT. Garbage-collects the consumed-(signer,nonce)set and broadcast records by deadline. Requires compute-then-commit buffering insettle. ReservesCBY_SENTINELoutside the token_id space. Denominatesmax_valuein the single outbound token and states the reentrancy posture ofrequest_withdrawandcredit_deposit.- r7 (2026-07-03): §Sealed-Bid now specifies SEALED mode as implemented in node and cbss. Reveal is a permissionless
RevealAuctiontransaction (opcode156) that anyone can submit afterreveal_height. It is not a CIP-5 timer callback, because CIP-5 timers fire only PVM actor handlers. The sealed instructions areOpenAuction=154,SubmitSealedBid=155andRevealAuction=156, the next free opcodes above the146–153block (152/153are the CIP-24 §3.4.6RegisterTlockRelease/SubmitTlockReleaseinstructions this mode consumes). A bid ciphertext is a versionedWrappedDek(the CIP-24 §3.4.3 IBE envelope, tlock HKDF domaincbss/tlock/v1) whose base AAD the chain recomputes asrequest_id ‖ u64_le(reveal_height). Reveal decrypts on chain: it Lagrange-combines at least t committee partials into σ = MSK·I and decrypts with AES-256-GCM. Reveal combines only partials from onequorum_epoch; otherwise the key is not releasable (the counterpart of CIP-24 §9aMixedEpochReceipts, also stated in CIP-24 §3.4.6). Lagrange interpolation uses 1-based committee indices. TheAuctionGrantoriginator is bound to the intent’s owner through the broadcast resting record, and the grant digest is bound to the node’s ownchain_id. The winner is the first bid, in bidder-list order, that decodes to a conservingSettlementBundleand fillsrequest_id; a compute-then-commit try-settle loop with per-attempt gas applies it. No escrow is held in v1, so cancellation refunds nothing. The liveness fallback cancels withCancelledGraceExpired. A reveal whose key was released but that has no valid decrypted bid cancels withCancelledNoValidBid. Neither case falls back to OPEN. Theopen_auctionchecks are listed in the code’s precedence order, because error codes are consensus-visible. Reveal gas is charged in the system lane, not the CIP-2 lane. New parameters areMAX_SEALED_BIDS_PER_AUCTION=256,MAX_AUCTION_REVEAL_HORIZON=1_000_000,MAX_SEALED_BID_BYTES=8192and the reveal gas, with error codes1746–1754. The solver-mode dispute (§Solver Model) is not implemented. Node and cbss verify the shared crypto envelope against the same golden vectors.- r8 (2026-07-03): Bootstraps the keyless
0x14committee throughGovRequestSystemDkg(CIP-24 §3.5, opcode 158), the governance-authorized (0x09) DKG path for a keyless system-actor scope, which MUST run once before the firstOpenAuction. Aforce_rekeyre-DKG installs a freshMPKand strands in-flight sealed bids, so their auctions cancel; routine refresh usesRequestReshare, which preservesMPK.
Abstract
CIP-34 defines intent-based settlement for Cowboy and its pluggable cross-chain backends.Background
An account is a user, agent, or solver holding a secp256k1 key. It uses that key to sign an intent such as “I give up exactly X of token A; I want at least Y of token B” as a token diff.Goal
This CIP specifies the on-chain settlement core in full and the external backends at the interface level.Settlement model
PVM actors hold no account key. They participate through the in-actor translator and are authorized by caller provenance (§Intent Authorization). Off-chain solvers (CIP-2 runners) compete to fill an intent. The on-chain Settlement system actor is a native module at a reserved address, like CBSS and RAS. This Verifier holds deposited balances in an internal ledger and applies a matched set of intents atomically, only if the bundle conserves value (creates no token). Solvers can compete in a CBSS-sealed auction (CIP-24 time-lock), which prevents last-look and bid-sniping. NEAR’s open solver market does not provide this property. Cross-chain legs go through a uniformICrossChainSettlement interface with pluggable backends, which governance selects per corridor (CIP-25 §1.4 / WP-v2 §16.2): the native CIP-25 bridge (first-party, trust-minimized), an ERC-7683 / Open Intents Framework solver-facing adapter (EVM corridors, led by Across), and NEAR Intents (1Click and Chain Signatures, for BTC and non-EVM reach). External solvers supply liquidity by fronting capital against a settlement mechanism they trust. ERC-7683 standardizes only how a solver evaluates an order. NEAR must onboard each supported chain. The native core works without these backends.
Motivation
Why intents, not an order book or an AMM
Continuous-clearing auctions and liquidity pools do not solve general-purpose, cross-asset, cross-chain settlement for the agent economy this protocol serves:- AMMs leak value to LPs and MEV, and their price degrades with pool depth, which makes them a poor fit for large or long-tail pairs.
- Order books need continuous liquidity and on-chain matching cost.
- Intents let a third party (a solver) source liquidity, route orders, and cross chains. The chain only checks that the signer received the requested outcome and that the bundle created no value. This supports agent-to-agent commerce (CIP-28 banking), inference billing (CIP-2 outputs priced in CIP-20 tokens), and agent swarms that must exchange value without a human in the loop. Accounts authorize by signature, and actors authorize by caller provenance.
Why Cowboy is unusually well-suited
Cowboy already has a primitive for each role in intent settlement:Why external backends — and what they do not give you
CIP-25 proves facts across chains. The native settlement core escrows funds and reimburses the filler. Solvers supply liquidity by holding inventory on each corridor. External backends are how Cowboy reaches existing solver liquidity instead of bootstrapping all of it:- NEAR Intents is a production solver network with BTC and non-EVM reach (1Click API and Chain Signatures). NEAR decides whether to onboard Cowboy as a supported chain.
- ERC-7683 / OIF is the EVM order-evaluation standard (led by Across, broad EVM ecosystem). It lets external solvers evaluate a Cowboy order without a bespoke integration. It standardizes only the solver-facing resolution and leaves escrow, settlement, pricing, and liquidity out of scope (§Where liquidity comes from).
What this CIP is NOT
- This CIP does not change L0 or the consensus mechanism. It adds a system actor, a new WP §9.1 address, and new
SystemInstructionopcodes, allocated in the enum and its uniqueness test (there is no central WP §9.2 opcode table; see §Protocol Allocations). It does not modify block production, finality, or the token model. Settled assets are existing CIP-20 tokens and CBY. - This CIP does not mandate any one backend. NEAR Intents, the ERC-7683/OIF adapter, and the native CIP-25 bridge are interchangeable
ICrossChainSettlementbackends, and governance selects one per corridor (CIP-25 §1.4). The adapter is anIResolverorder interface that uses CIP-25 reimbursement, because 7683 alone is not a settlement backend. - This CIP does not re-specify CIP-25. Transport, anchoring, and the lock-mint/burn-release bridge mechanics live in CIP-25, and this CIP consumes them.
Specification
Overview
Withdraw and Deposit intents engage the cross-chain backend.
Core Data Structures
Intent Authorization Model
The Settlement actor is a system actor: a native module at a reserved low-byte address, the pattern Cowboy already uses for RAS, CBSS, the runner registry, entitlements, basefee, etc. An account signs its intents with its own secp256k1 key. Actors authorize by caller provenance instead, through the caller paths described below.- The user signs an EIP-712-style typed digest of the intent with the same secp256k1 key that signs transactions.
- The Settlement system actor recovers
signerfrom theEthSignaturethrough nativerecover_address, checks that it matches the intent’s declared signer, then enforces the nonce and deadline.
INTENT_SETTLEMENT address, SETTLEMENT_DOMAIN_VERSION, the method/kind, the signer, nonce, deadline, every (token_id, amount) diff, dest_chain, dest_recipient, and any trust constraints (allowed_backends, max_value, min_finality, min_received). SETTLEMENT_DOMAIN_VERSION is a fixed u16, bumped only on consensus-critical interface or invariant changes and never on document revisions. The method/kind is the IntentKind enum (SETTLE | WITHDRAW), so a signature for one kind cannot be replayed as another. The digest borrows EIP-712’s field-binding discipline but does not use the EIP-712 wire format. The preimage is the flat concatenation INTENT_SIGNING_DOMAIN ‖ u16_be(SETTLEMENT_DOMAIN_VERSION) ‖ INTENT_SETTLEMENT ‖ u64_be(chain_id) ‖ codec(intent_without_signature) hashed with a single keccak256, with no 0x1901 prefix and no hashStruct/typeHash. Wallets sign the raw 32-byte digest. Omitting any field widens the replay surface, including on the NEAR / Chain-Signatures paths.
The user signs once off-chain, and a solver relays and settles the intent with no account-abstraction ceremony. Settlement executes as an Instruction::System opcode, so the O(intents × tokens) settle loop runs natively in the system lane without the per-instruction PVM cycle ceiling. LANE_SYSTEM_CYCLES = 32,800,000 (1.64× the 20,000,000-cycle block target; the basefee 2× target clamp is a separate fee-adjustment bound) is a per-block budget shared by all system instructions, and the block rejects further system txs once it is exhausted. settle therefore enforces MAX_SETTLE_INTENTS and MAX_DIFFS_PER_INTENT, which keep a single bundle’s worst-case cycles well below LANE_SYSTEM_CYCLES so one settle cannot starve basefee, RAS, CBSS, runner-registry, and timer ops. It rejects an over-cap bundle before any work.
Callers invoke Settlement through two paths:
- An account (a user, agent, solver, or relayer holding a secp256k1 key) submits a top-level
Instruction::Systemtx carrying anyIntent*instruction. The signature authorizes it, so a solver can relay it. This is the only path forIntentSettle, because the heavy O(intents×tokens) loop runs top-level with explicit gas. - A PVM actor sends a message to
INTENT_SETTLEMENTand is authorized by provenance. v0 adds an explicit system-target branch to actor-instruction execution. For the self-service instructionsIntentBroadcast,IntentDeposit, andIntentWithdrawonly, the branch decodes and validates the payload and creates a deferredInstruction::System(...)withsender = message.from, as the job-dispatcher system target does. It does not enqueue a message to the system address. It does not translateIntentSettle, because next-block-deferred execution is capped atDEFERRED_CYCLES_LIMIT = 100k, too small for the settle loop, and it does not translate the cross-chain instructions.
signer = tx.from and never trusts a payload signer. It requires an empty signature, a live actor (get_actor(signer).is_some()), and an econ.intent manifest entitlement with token/amount bounds, mirroring how system Transfer gates actor senders through the econ.transfer manifest entitlement. An account-origin instruction requires a non-empty, valid signature. The two modes are mutually exclusive: the runtime rejects an empty-signature account intent and never treats it as an actor intent.
An actor cannot relay provenance, so it authorizes through IntentBroadcast. The broadcast records a resting intent bound to its canonical intent_hash over {signer, nonce, deadline, diffs, dest_chain, dest_recipient, method}. The record becomes active at the block where the broadcast executes (the next block, not PVM emit time), and deadline is checked there and again at settle. The runtime rejects a second active broadcast for the same (signer, nonce) instead of replacing the first. A solver later includes the intent in a top-level IntentSettle bundle. settle() accepts an unsigned actor intent only if it matches an active record by exact intent_hash, and it consumes the record and (signer, nonce) atomically. It rejects an inline unsigned intent with no matching record, so a solver cannot fabricate actor intents.
Every intent carries a deadline that settle and broadcast re-check. A consumed (signer, nonce) pair or an unsettled broadcast record needs to be retained only until deadline + GC_GRACE, after which the deadline check alone rejects any replay, so both are garbage-collected down to the active-deadline window. This keeps the non-monotonic consumed set finite; a monotonic O(1) nonce counter would forbid out-of-order and concurrent settlement.
Deadlines for broadcast intents and for signed intents in an IntentSettle bundle MUST be at most block_height.saturating_add(MAX_INTENT_DEADLINE_HORIZON) at acceptance. Auction grants apply the same bound to expires. A consumed (originator, nonce) grant marker is retained through expires + GC_GRACE and becomes eligible for bounded garbage collection only after that height. After the marker is collected, a freshly signed grant may reuse the nonce, and the expiry check still rejects the old signed grant.
The design rejects three alternatives:
Protocol Allocations
Cowboy’s executor dispatches top-level transactions byInstruction type rather than by target address: Instruction::System(SystemInstruction) routes to system-instruction execution, Instruction::Actor to PVM execution, and Instruction::Custom is unsupported. A native system actor is therefore exposed as explicit SystemInstruction variants, each an opcode with a match arm, like RunnerRegister, TokenTransfer, and EntitlementGrant. Settlement touches the WP §9.1 address table, the system-instruction opcode allocation, and, for the actor-authorization path, the entitlement registry:
- The WP §9.1 table allocates
0x14toINTENT_SETTLEMENT, and this governance bundle amends the table accordingly. The allocation follows the §9.1.3 next-free rule:0x10RECEIPT_REGISTRY,0x11VALIDATOR_SET(CIP-11, code-deployed),0x12PaymentGate, and0x13CONTAINER_REGISTRY(CIP-10, code-deployed) were already reserved. BankActor (CIP-28) was mis-penciled at0x13and must relocate (see WP §9.1 reconciliation). WP §16.3 penciled the deferredEventListenerbridge oracle at0x14but deferred its address to allocation time, so that entry was a snapshot, not a binding §9.1 reservation. CIP-34 binds0x14in the §9.1 table under the §9.1.3 rules and reassignsEventListenerto0x15, the next free slot. The implementation MUST add theINTENT_SETTLEMENT = 0x14constant and extend the uniqueness/low-byte reservation test, which must account for the non-dense reservationsEVENT_SUBSCRIPTION_SYSTEM_ACTOR0x1DandTradingPost0x1E. - Settlement adds six
SystemInstructionvariants:IntentDeposit,IntentWithdraw,IntentSettle,IntentBroadcast,IntentRequestWithdraw, andIntentCreditDeposit. Each claims the next free opcode and adds a system-instruction dispatch arm. The Technical WP normatively fixes only the §9.1 address table, so there is no WP §9.2 opcode table to amend. Opcodes are allocated in theSystemInstructionenum and the opcode-uniqueness test, and each subsystem documents its range in its sub-whitepaper (for example timers48–50and CBSS WP §3 opcodes68–84). The implementation MUST therefore (i) claim the reserved contiguous block146–151, the next free opcodes above the then-current max145:IntentDeposit=146,IntentWithdraw=147,IntentSettle=148,IntentBroadcast=149,IntentRequestWithdraw=150,IntentCreditDeposit=151, re-pinned at implementation time against the then-current max; (ii) extend the opcode-uniqueness test; and (iii) record the block where the existing subsystem opcodes are documented, since no central normative opcode registry exists. The block continues contiguously through the SEALED-mode instructions:RegisterTlockRelease=152andSubmitTlockRelease=153(the CIP-24 §3.4.6 tlock backend this mode consumes), then Settlement’s ownOpenAuction=154,SubmitSealedBid=155, andRevealAuction=156.IntentRequestWithdrawandIntentCreditDeposit(150/151) decode and dispatch but returnUnsupportedInstructionuntil the v2 cross-chain path exists. TheIntent*prefix and theINTENT_SETTLEMENTaddress avoid a clash with the unrelatedUpdateSettlementConfig/SettlementConfig(staking-reward settlement). Option (b)‘s generalecrecoverhost call would need its own opcode and is out of scope. - The actor-authorization path (§Intent Authorization) gates actor-origin intents on an
econ.intentmanifest entitlement, which the entitlement registry does not yet define. The implementation MUST addecon.intentto the entitlement registry and to manifest validation.
Settlement Invariants
Settlement-Conservation is the core of the model. The actor never needs to trust the solver, because a bundle that would create value fails the check. A non-solver signer therefore receives exactly their Settlement-MinReceive floor, and the per-token surplus is the solver’s fee (see TokenDiff).
The per-token accumulator is checked i128. CIP-20 declares max_supply: u256 | None and does not bound a token’s supply below 2^127, so a TokenDiff may legitimately carry |amount| ≥ 2^127. If any diff or running per-token sum would overflow signed 128-bit, the bundle reverts; the arithmetic never wraps. A token whose supply is itself ≥ 2^127 cannot be represented as a signed i128 delta and is not settleable until CIP-20 caps supply or the ledger widens.
Before the first inbound credit_deposit for a corridor asset, governance creates the pegged CIP-20 representation with mint_authority = INTENT_SETTLEMENT (token_create with owner = governance, mint_authority = Settlement) and records the token_id in the corridor metadata. A credit_deposit for a token whose mint_authority is not Settlement reverts, because Settlement cannot mint it and the credit would be unbacked. This setup is therefore a hard precondition of Ledger-Backing.
Settlement Actor Interface
The signatures below are the conceptual interface; on the wire each maps to aSystemInstruction variant (§Protocol Allocations): deposit → IntentDeposit, withdraw_local → IntentWithdraw, settle → IntentSettle, broadcast_intent → IntentBroadcast, request_withdraw → IntentRequestWithdraw, credit_deposit → IntentCreditDeposit.
Custody & Reentrancy
The v0 Settlement actor is a system actor (§Intent Authorization). It custodies two asset classes in one internal ledger, keyed bytoken_id:
- For CIP-20 tokens, the caller first calls
token_approve(token_id, INTENT_SETTLEMENT, amount). The nativeIntentDeposithandler then invokes token core directly with spender = INTENT_SETTLEMENT (allowance key(user, INTENT_SETTLEMENT, token_id)). It MUST NOT route through the publicSystemInstruction::TokenTransferFrom, which has no spender field and usescaller = tx.from, so it would check an allowance from the user to the same user and fail. Withdraw is symmetric. The nativeIntentWithdrawhandler invokes token core with from = INTENT_SETTLEMENT, recipient = caller. It does not use the publicSystemInstruction::TokenTransfer, which debitssender = tx.fromand would debit the user instead of the Settlement balance.increase_allowance/decrease_allowanceare preferred over bareapprovebecause of the CIP-20 approve race. Amounts are u128 (the CIP-20 type). - Native CBY is not a CIP-20 token (CIP-20 §“CBY Relationship”) and occupies a reserved
CBY_SENTINELtoken_id in the ledger. The tx model has no attached-value field, so both deposit paths debit the caller’s CBY account directly: an account’sIntentDeposit(CBY_SENTINEL, amount)under the tx signature, asSystemInstruction::Transferdebitstx.from, and an actor’s deferredIntentDepositunder theecon.intentgrant (asend_messagecarriesvalue = 0). Both creditbalances[caller][CBY_SENTINEL]. Withdraw debits the ledger and credits the CBY account.CBY_SENTINELis a fixed reservedbytes32outside the CIP-20 token_id space (token_id =keccak256(creator ‖ symbol ‖ nonce)), andtoken_createrejects it, so no CIP-20 token can collide with the native-CBY ledger key.
- CIP-20 tokens may carry transfer hooks.
depositandwithdraw_localare the only paths that call CIP-20 transfer. They MUST follow checks-effects-interactions (mutate the ledger, then transfer) and hold a reentrancy guard, so a hostile token hook cannot re-entersettleorwithdraw_localmid-update.settleandrequest_withdrawmove value only within the internal ledger and make no external token call, so no hook can re-enter them. The only external call incredit_depositis the CIP-20 mint into Settlement’s own balance, which uses CEI and the reentrancy guard asdepositdoes. - Settlement credits the conserved surplus (−Σ diff per token, ≥ 0) inside the same execution and transfers nothing out during
settle.
Sealed-Bid Auctions (CBSS / CIP-24)
OPEN mode is the minimum viable settlement path. SEALED mode adds bid privacy and is built on CIP-24’s threshold-IBE time-lock. A caller always opens an auction: the Settlement actor never auto-opens one, and sealed mode is opt-in perrequest_id.
CIP-24’s per-secret release interface binds each ciphertext to a fixed per-version identity hash(SecretId ‖ version ‖ wrap_epoch) and releases the key on a signed ReleaseRequest at job time. Sealed solving needs (a) a caller-chosen auction identity (identity = request_id) and (b) automatic release at a height/round (reveal_height) with no per-secret request, so that a non-revealing bidder cannot block clearing. CIP-24 §3.4.6 (Time-Lock Release mode) provides this profile: a domain-separated (cbss/tlock/v1), height-gated, permissionless release on the same CBSS committee. A bid encrypts to identity = request_id with target_height = reveal_height, and the committee posts the release at that height (RegisterTlockRelease / SubmitTlockRelease). Only SEALED mode carries this dependency; v0 (OPEN) and Backend A do not.
Three native SystemInstructions implement SEALED mode: OpenAuction (opcode 154), SubmitSealedBid (155), and RevealAuction (156). Reveal is a permissionless transaction. CIP-5 timers fire only PVM actor handlers, and a native reveal must be crankable by anyone once the key exists, so any account may submit RevealAuction(request_id) after reveal_height.
WrappedDek (v2), the same envelope CIP-24 §3.4.3 uses for IBE, with the HKDF domain cbss/tlock/v1: {version, ciphertext, nonce(12), ephemeral_u(96 = compressed G2 U = r·G2), aad}. The AEAD aad MUST equal base_aad ‖ compress(U), where the CIP-34 base AAD is request_id(32) ‖ u64_le(reveal_height). Reveal reconstructs this AAD on chain and checks full equality, which binds each bid to its auction and height. The key is K = HKDF-SHA256(ikm = compress(e(σ, U)) [288 B], salt = "cbss/tlock/v1", info = "cbss/tlock/v1" ‖ aad), and e(σ, U) = e(MSK·I, r·G2) = e(I, MPK)^r matches the encryptor. The tlock identity is I = hash_to_G1(request_id ‖ u64_le(reveal_height), "cbss/tlock/v1").
The release committee is the CBSS committee of the INTENT_SETTLEMENT (0x14) account. 0x14 is keyless and cannot self-issue RequestAccountDkg (CIP-24 §9.6), so governance bootstraps the committee once through GovRequestSystemDkg (CIP-24 §3.5, opcode 158) before the first OpenAuction. Node and CBSS MUST implement this envelope and decrypt identically, and shared golden vectors cross-anchor the two implementations.
Reveal combines the posted partials only if their quorum_epoch equals the current committee epoch. The Lagrange x-coordinates are committee positions in the signing epoch, so after a reshuffle reveal returns TlockNotReleased (CancelledGraceExpired after grace) instead of producing the wrong σ. Interpolation is evaluated at x = 0, with each partial’s x-coordinate set to its 1-based index in the committee ordering (its position in the release key’s committee list, plus one). Reveal rejects index 0 and duplicate indices. This ordering matches cbss-crypto, so node and CBSS agree byte-for-byte, and the shared combine_partials golden vector pins it.
Sealed bids keep their own base AAD,SEALED mode gives three properties that an open market cannot:request_id(32) ‖ u64_le(reveal_height)undercbss/tlock/v1, outside the CIP-24 account-secret binding. It omits thechain_idprefix and the trailingmpk_g2that CIP-24’s account-secretbase_aadbinds (chain_id ‖ account ‖ key_hash ‖ version ‖ wrap_epoch ‖ mpk_g2, 172 bytes; CIP-24 §3.4.3 / History). Each CBSS IBE family defines its own base AAD (CIP-24 §3.4.6), so a change to the account-secret AAD leaves this envelope, its golden vectors, and therequest_id ‖ reveal_heightcontract unchanged. An AAD change here would not address the residual key-substitution risk for sealed bids, in which aRpcCommitteeMpkserves a substituted committeempk'.submit_sealed_bidstoresciphertextverbatim without validating the envelope, and a submit-time rejection would arrive after the substituting party already holds both the key and the bid. Two separate CBSS workstreams address this risk: the encryptor authenticates the committeeMPKagainst the release key’srelease_key_material_hash(which the release-key RPC already serves), and the tlock signer independently checks the reveal height on the committee side.
- A solver cannot last-look, that is, observe competitors’ bids and re-quote, because every bid is committed before the key exists.
- Solvers cannot snipe bids, because the reveal height is fixed and there is no end-of-auction timing game.
- The intent itself may optionally be IBE-encrypted to the auction identity, which hides the order from front-runners until reveal.
reveal_height + AUCTION_GRACE (default 50 blocks), a permissionless RevealAuction cancels the auction (CancelledGraceExpired) and clears its state without reopening a plaintext round. v1 holds no escrow at open or bid time: balances move only inside settle_bundle at a successful reveal, so a cancelled auction has nothing to refund.
PVM actors are never trusted decryptors or auction adjudicators in v0 or v1. Only the CBSS committee and native code seal bids, release keys, and evaluate bids, and an actor never receives a decryption key.
Solver Model (CIP-2 runners)
- Solvers are CIP-2 runners. Open-mode solving is permissionless: anyone may submit a valid
settle. Sealed-mode bidding requires CIP-2 registration so that misbehavior, such as submitting undecryptable ciphertext or a revealed bundle that fails verification, is slashable. The native handler detects these offences on chain atreveal/settle, and a solver-mode dispute adjudicates them within a dispute window using CIP-2’s stake and slashing economics, outside the JobSpec job-dispute lifecycle. The solver-mode dispute is not implemented. v1 enforces only the registration gate; reveal skips an undecryptable or invalid bid, but its submitter is not penalized. - A solver is an off-chain program that watches
IntentBroadcastevents and submits settlement transactions in an external loop, without the Job Dispatcher. It runs on CIP-2 runner infrastructure for stake, identity, and slashing, in a new runner mode distinct from the current JobSpec/Job-Dispatcher request/response path (LLM/HTTP/MCP jobs with a submitter address). This CIP introduces that mode. - A solver fills an intent by signing one or more
Intents with its own secp256k1 account key, with diffs that oppose the users’, and including them in the bundle. The solver profits from the surplus (−Σ diff per token, ≥ 0) credited to its account. - Solvers discover open intents through
IntentBroadcastevents and an optional off-chain mempool service. LLM-assisted routing over the local-inference path is an off-chain solver concern, and the chain sees only the resulting signed bundle.
Cross-Chain Backends
The Settlement actor calls a uniformICrossChainSettlement interface for any leg that leaves Cowboy. A backend pairs two separate concerns. The order surface determines how an external solver sees and evaluates a Cowboy intent. The settlement rail determines how value crosses and how the filler is reimbursed and comes to trust that reimbursement. This CIP defines three backends, and governance selects among them per corridor (CIP-25 §1.4). No backend creates liquidity (§Where liquidity comes from).
begin emits a CIP-25 L2 message, an L3 asset bridge (lock-mint or burn-release, CIP-25 §3.1) moves value, and prove_delivery checks a CIP-25 L1 inclusion proof of the destination Delivered event. Trust rests on the CIP-25 backend for that pair (runner committee, ZK, or optimistic), with no third party beyond Cowboy’s runners. Cowboy’s own solver supplies liquidity, so no external party can block this backend.
Backend B is the ERC-7683 / OIF adapter for EVM corridors, led by Across.
- On the order surface, a solver-facing
IResolverpresents a Cowboy intent as a 7683ResolvedOrder(steps/variables/payments/Assumption[]). The current EIP-7683 is resolver-centric and standardizes only this solver-facing resolution; it “does not require protocols to use a common escrow, settlement contract, or fill function”. Its deprecated “Previous Draft” held the oldopen/fillsettler model. Cowboy execution is non-EVM, so the resolver is an EVM-RPC-shaped gateway that an external solver caneth_call. Without it, EVM solver tooling cannot read a native Cowboy actor.Assumption[]carries the proof backend, finality/challenge window, TTL/reclaim, and value caps a filler must accept. - On the settlement rail, the native actor escrows and reimburses, and a filler is repaid against a CIP-25 settlement proof it has opted into. 7683 alone does not make a filler trust Cowboy: the filler must have onboarded Cowboy’s CIP-25 backend and accepted its finality and challenge economics. Targeting Across specifically requires an Across-over-7683 adapter (Across may expose its own surface), which goes beyond generic 7683 compliance.
Cross-Chain Trust Constraints (user-signed)
A Withdraw intent MAY narrow how it is filled through fields bound into the signed digest, so a relayer cannot strip them:allowed_backends: only theseICrossChainSettlementbackends may fill (e.g. native CIP-25 only, no NEAR).max_value: per-intent cap on the single cross-chain outbound token of the Withdraw. It is not a multi-token aggregate, because there is no cross-token denomination. The effective cap ismin(max_value, governance corridor cap).min_finality: minimum destination-chain finality the user accepts, in dest-chain blocks.min_received: signed delivery floor on the destination leg, enforced atprove_delivery.
request_withdraw validates canonical RequestConstraints and stores them under request_id. begin() MUST select a backend that satisfies both the stored user constraints and current governance corridor policy, then persist the chosen backend and proof policy. prove_delivery verifies against that stored choice. Governance may tighten policy after the request, for example by lowering a cap or pausing a backend, but MUST NEVER loosen a user-signed constraint. begin() enforces min_finality: the actor reverts if the selected backend’s finality_level(dst_chain) is below it, and prove_delivery re-checks the delivered event’s finality depth against the persisted policy.
Chain Signatures (secp256k1, domain 0)
Cowboy accounts are secp256k1/EVM-style (20-byte address;EthSignature recovered over a keccak256 digest). NEAR’s Chain Signatures MPC signs secp256k1 (domain 0) and ed25519 (domain 1). NEAR already uses secp256k1 domain 0 to control Ethereum and Bitcoin accounts, so a NEAR identity can control a Cowboy account exactly as it controls an Ethereum account, with a signing primitive already in production.
The hard part is transaction construction. The MPC signs an arbitrary 32-byte digest and cannot build a valid Cowboy transaction (the canonical fields, encoding, and keccak digest the node recovers against). This CIP therefore requires the Chain-Signatures relayer to construct Cowboy transactions through the canonical node transaction builder, which produces the exact encoding the node validates. A divergent encoder is a correctness bug.
Once the relayer exists, it enables two things:
- NEAR can settle an intent into a Cowboy account by having its MPC sign a Cowboy transaction that calls
credit_depositor transfers CBY, with no wrapped representation. - NEAR can custody native CBY, which lets NEAR Intents list native Cowboy assets.
Where liquidity comes from
No standard or backend supplies liquidity. Solvers supply it by fronting capital on a corridor, and they require a settlement mechanism they trust to reimburse them.- ERC-7683 is a compatibility layer for solver evaluation. It supplies neither liquidity nor a settlement guarantee. Solver inventory stays fragmented per protocol: a solver that fills Across orders cannot automatically fill UniswapX orders, even though both use 7683. Each network independently onboards Cowboy, inventories the corridor, and accepts a settlement path.
- NEAR controls Cowboy’s NEAR reach, because NEAR decides whether to onboard Cowboy as a supported chain.
- Cowboy fully controls only its own first-party solver over Backend A (native CIP-25). Every external source needs business development, a settlement rail that fillers accept, and, because Cowboy is non-EVM, an adapter.
v0 (domestic), v1 (sealed), and Backend A, including a trust-minimized inbound path, therefore need no external cooperation. Backends B and C extend reach, but each requires solver onboarding and a settlement rail that fillers accept, and neither supplies liquidity.
Timeout, Cancellation, Refund
Settlement follows the CIP-25 §2.6 timeout-and-reclaim pattern with its own grace sizing.RECLAIM_GRACE = 256 blocks, sized against DISPUTE_WINDOW_BLOCKS = 75, is relative to deadline and shorter than CIP-25 §2.6’s expiry + GRACE, where GRACE ≈ 1h ≈ 3,600 blocks. The settlement deadline already bounds validity, so the extra margin need only cover finality lag.
- Settlement enforces every
Intent.deadlineand every cross-chainQuote.quote_deadline, and expired intents and quotes revert. - If a Withdraw is not proven delivered within
WITHDRAW_TTL(default 24h, matching the CIP-25 asset-bridge TTL),reclaim(request_id)unlocks, and the user recovers escrow afterdeadline + RECLAIM_GRACE. - The Settlement actor invokes the originating actor’s
on_settlement_timeout(request_id)hook so application state can unwind. The hook is best-effort: a reverting or out-of-gas hook MUST NOT block the reclaim or refund, so it can never trap the user’s escrow.
Events
Parameters
OpenAuction reserves 16 reads and 8 writes (Rk(16)+Wk(8)). Of these, the consumed-grant GC index and its pause checks account for 3 reads and 2 writes, and writer pause checks account for 6 reads.
Every parameter is consensus-affecting: changing one can change which transactions or bundles succeed and their receipt_root. The table gives each default and policy note.
Worked Examples
A. Domestic agent-to-agent settlement (no cross-chain)
B. Cross-chain swap via Backend C / NEAR Intents (CBY → USDC on Ethereum)
Security Considerations
Adversary notes
- Conservation is the trust anchor. Unlike a bridge that must attest external truth, domestic settlement requires zero external trust: the worst a malicious solver can do is submit a bundle that reverts.
- Cross-chain legs inherit backend trust. Backend A’s adversary model is exactly CIP-25’s (committee, ZK, or optimistic). Backend B (7683) inherits whichever CIP-25 settlement backend the filler opted into, and 7683 adds no trust of its own. Backend C additionally trusts NEAR’s solver network and the chosen delivery attestation. Both external backends trade added trust for liquidity reach, and each requires an explicit, capped governance choice. Neither is a default.
Rationale
Settlement checks token diffs instead of running an order book. Conservation-checking a signed diff set is O(intents) and stateless beyond the ledger, and it needs no resting orders, on-chain matching engine, or price oracle. Solvers perform matching off-chain. NEAR’s verifier and CowSwap’s batch settlement use the same approach. Settlement is a system actor (§Intent Authorization) that holds all deposits and runs the conservation loop. CIP-20 also uses native execution for its core token operations. Native execution verifies the account’s own secp256k1 key, with no separate intent key and no PVMecrecover host call, and avoids the per-settle PVM cycle ceiling. Only the stable core is native; solvers, sealing, and cross-chain stay off the consensus-critical path.
CIP-2 runners act as solvers because runners already carry stake, VRF selection, and a dispute window, which is the accountability a sealed-bid auction needs. A parallel solver registry would duplicate CIP-2 and fragment slashing.
Sealed auctions use CBSS time-lock encryption. Naive commit-reveal lets a solver withhold its reveal to grief the auction. A threshold-IBE time-lock makes the key become available at the reveal height independent of any bidder, so a non-revealing solver cannot block clearing. This still assumes CBSS committee liveness, and §Sealed-Bid specifies the AUCTION_GRACE fallback if the committee fails. CIP-24’s tlock construction supports the scheme, and the CIP-24 §3.4.6 Time-Lock Release profile provides the height-triggered, auction-identity release (§Sealed-Bid).
Cross-chain networks implement settlement backends. CIP-25 §1.4 / WP-v2 §16.2 already make bridge selection a governance decision. Treating NEAR Intents and the ERC-7683/OIF adapter as ICrossChainSettlement implementations keeps trust-minimized native settlement (Backend A) available and lets governance opt into external reach (Backends B/C) only where the liquidity justifies the added trust and onboarding cost.
Native settlement keeps domestic transfers independent of NEAR Intents. Using NEAR Intents for every settlement would require a custodial third party even for domestic transfers. It would also remove CBSS-sealed auctions, domestic settlement without external trust, and inference billing.
Backwards Compatibility
CIP-34 is a new standard. Settled assets are existing CIP-20 tokens and CBY. The Settlement actor is additive, and no existing CIP changes behavior.Reference Implementation
- The Settlement system actor (ledger,
settle, invariants, and native secp256k1 verification) is a native module at address 0x14 (WP §9.1), invoked through itsSystemInstructionopcodes (§Protocol Allocations). The actor-instruction system-target branch forINTENT_SETTLEMENTdecodes and validates only the self-serviceIntentBroadcast/IntentDeposit/IntentWithdraw, defers anInstruction::Systemwithsender = message.from, enqueues no message, and uses a distinct source event. Its tests cover sender stamping, no-enqueue, malformed-payload fail-closed, insufficient gas, duplicate nonce, and forged-signer rejection. An OPEN-mode solver-loop example runs a domestic match (Worked Example A) on devnet with no cross-chain dependency. examples/settlement-sealed/runs a CIP-24 sealed-bid auction revealed by the permissionlessRevealAuction(opcode 156), using only the native handler and CBSS committee, with no PVM secret path (v1; Worked Example B without the external leg).- The ERC-7683 resolver adapter (Backend B) is an EVM-RPC gateway exposing
IResolver/ResolvedOrder. The Across-over-7683 settlement path is a follow-on. - The NEAR backend (Backend C) and the Chain-Signatures relayer spike are tracked separately. The relayer MUST build Cowboy txs through the node’s canonical builder.
Phasing
- In v0, the Settlement system actor provides a native ledger, conservation checks, and secp256k1 verification. PVM actors self-serve through translated
IntentBroadcast/IntentDeposit/IntentWithdraw, authorized by provenance and gated byecon.intent, andIntentSettlestays top-level. OPEN mode uses one runner-solver for domestic settlement only, validated on devnet. - In v1, SEALED mode (CIP-24) adds competitive solvers.
- In v2, cross-chain settlement uses Backend A (native CIP-25) first; then Backend B (ERC-7683/OIF resolver adapter, Across corridor) and Backend C (NEAR 1Click + Chain-Signatures) as reach extensions, each gated on a settlement rail fillers accept.
Acknowledgments
The settlement model follows NEAR Intents and its Verifier contract (introduction, intent types & execution), and the broader intents lineage (CowSwap batch auctions, UniswapX). The ERC-7683 / Open Intents Framework backend follows the current resolver-centric EIP-7683 (IResolver / ResolvedOrder) and Across’s ERC-7683 settlement model. NEAR docs corroborate the verifier internal-ledger model, Message Bus atomic execution, the 1Click trusted-swapping-agent custody window, and Chain Signatures domains (0 = secp256k1, 1 = ed25519). Chain Signatures background from NEAR’s chain-abstraction docs. The cross-chain timeout/refund semantics follow CIP-25 §2.6.