420Docs context
Skip to content

CMP-0.6 — Offers, requests and immutable matching

Status: PROTOCOL SPECIFICATION ONLY. This increment adds no executable offer/request/match contracts, live quote, funded job, production marketplace or dedicated tests. Authority: frozen ComputeMarket V1 architecture, CMP-0 overview, CMP-0.2 canonical job, CMP-0.3 units, CMP-0.4 signed manifest, and CMP-0.5 provider/node/resource identities. Provider-neutral; 420AI is one client, not a prerequisite. Registry-resolved applications are publishable only after deployment, code-hash verification and authorized publication. No new fixed Genesis predeploy or unrestricted custody, settlement, scheduler or consensus authority.

1. Ownership and canonical objects

The offer registry owns ComputeOffer, the request registry owns ComputeRequest, and the match registry owns the immutable accepted ComputeMatch; neither UI nor scheduler owns the authoritative versions. offerId, requestId, matchId, and jobId are distinct nonzero bytes32 IDs in separate chain-scoped namespaces, never recycled. Registry allocation must be collision-resistant, single-use and reconstruction-safe; the exact ID encoding and checked-in vectors remain an implementation gate, not an assumed executable mechanism. Every event identifies chain, registry/version, record ID, revision, actor and predecessor commitment where applicable. Mutable display metadata, transport routes, external market rankings and cache entries are non-authoritative.

Offer minimum canonical fields: offerId, authorized providerId, optional advertised resourceId or a bounded class profile, compute class/runtime and capability profile versions, service-unit/capacity definition and remaining reservable quantity, pricing policy ID/version and immutable formula/quote-parameter commitment, min/max per-job and concurrency constraints, availability start/end, region/privacy policy commitments, verification-compatible profiles, SLA policy ID/version, expiresAt, revision and ACTIVE | PAUSED | CANCELLED | EXPIRED state. Do not permit unbounded free-text prices, floating-point settlement, ambiguous unit conversions or a hidden provider-specific billing formula. An offer references the actual CMP-0.5 active provider and corresponding policy/security eligibility; a class-based offer has no accepted resource until a single eligible concrete node/resource is atomically resolved at matching. Different hardware listings can share an offer only when all accepted capacity and policy constraints remain explicit and objectively checkable.

Request minimum canonical fields: requestId, authenticated requester/payer and separately verified scoped delegates, CMP-0.4 manifestHash and accepted manifest authorization evidence, workload/resource/runtime requirements, input commitment, output/privacy/region/data-access constraints, partition/replica plan, verification profile ID/version and policy commitment, SLA/deadline, price/billing constraints, maximumAuthorizedSpend denominated in native $420 at Genesis, asset/payer-bound funding reference, creation/expiry, revision and OPEN | CANCELLED | EXPIRED | MATCHED status. requestId and manifestHash are bound by the requester's authorization, not inferred from a scheduler's payload. A request can exist before match; match/provider/resource/beneficiary must not be invented at creation. A signature on a manifest is not authority to debit a wallet, raise a budget, relax matching constraints or transfer custody. Any budget increase requires a separate requester-authorized funding action under CMP-0.8.

Accepted match minimum canonical fields: matchId, exact requestId and offerId with accepted versions/commitments, concrete providerId, resourceId and derived immutable-parent nodeId, accepted provider/node/resource revisions and eligibility snapshots, accepted manifest and work-plan commitments, accepted pricing formula/policy/version and fixed maximum/quoted total, service-unit and bounded metering terms, SLA/verification/privacy/region policy hashes, acceptedAt, policy-bound execution deadlines, capacity reservation reference, canonical provider-derived beneficiary/settlement reference, requester/payer/funding reference, and authorization evidence for both sides. The match is write-once after successful atomic acceptance. A separate canonical jobId may be linked under the CMP-0.2 authorized job/match binding; do not silently equate match and job IDs or create a second writable source for their economics.

2. Revision, authorization and publication

Offer creation/revision/cancel requires the provider's offer.publish/update/cancel capability scoped to providerId and to the underlying resource or class; a node liveness signature cannot set prices or redirect payout. Requests require requester or narrowly scoped request.create/update/cancel authority for the precise request and a separately bounded funding capability; provider keys never authorize payer funds. Match acceptance must prove both the requester-side authorized selection/constraints (direct selection or preauthorized bounded open-market selection) and the provider-side offer commitment/acceptance under the applicable published policy. An off-chain scheduler can recommend or relay a match but cannot accept on behalf of either party without a valid object-scoped grant. Direct matchmaking checks the exact requested offer/resource; open-market matching checks all published constraints and a requester-approved selection rule. No hidden matcher or admin override can broaden either side's constraints.

An offer revision updates only future eligibility. A materially changed price, resource class, capacity definition, privacy, verification, SLA, window or beneficiary policy invalidates outstanding unaccepted quote assumptions unless the requester explicitly authorizes the revised offer. A request revision changing manifest, spend, deadline, verification or constraints invalidates unaccepted match proposals and requires reauthorization as prescribed by the request policy. Existing accepted matches never inherit later revisions; preserve reconstructable snapshots and canonical revision events. Revocation/cancellation prevents new acceptance while preserving prior commitments and legitimate earned entitlements. Expiry is checked against canonical verification time at the moment of acceptance, not just at off-chain quote generation; expired offers/requests cannot be revived by replay or stale cache.

3. Atomic eligibility and match construction

At proposal time and again atomically at acceptance, fetch authoritative offer/request/provider/node/resource/policy/manifest/funding state and reject unsupported or stale versions. Check both parties' signatures/grants, chain and verifier domains, nonces, expiry, availability window, minimum/maximum job size, capacity, operational ACTIVE ancestry, AVAILABLE concrete resource, endpoint freshness, security/stake policy and required objective hardware evidence. Resolve class-based offers to exactly one eligible resource of the offered provider before match commitment; verify its immutable node/provider parent and runtime/capability revisions. Check that resource/region/privacy/verification policy, data-access permission, partition/replication and deadline meet all request and offer bounds. The accepted manifest and CMP-0.3 partition plan must match byte-for-byte; scheduling may not change executable, input, verification or resource requirements.

Compute a deterministic, integer-only accepted maximum from the bound pricing policy and quoted work plan. For fixed-price work, use the exact accepted fixed amount. For metered work, bind rounding direction, service-unit scale, maximum billable units, rate, timeout and any minimum/maximum fee so an independent client can reproduce the ceiling without external mutable rates; freeze the price-feed value/version if one is permitted by the policy. Quote the aggregate across partitionCount × replicationFactor, authorized retries/overheads, protocol fees and all providers/hops (if applicable), and prove checked multiplication/addition never exceeds maximumAuthorizedSpend or the actual funded reserve. A retry cannot create a fresh payable unit, reprice the match or increase the ceiling. No speculative overbooking: atomically reserve the exact resource capacity and required payer-bound Vault funding/obligation before a paid job may be ACCEPTED/RUNNING under CMP-0.7/0.8. Mere FUNDED bookkeeping is not proof of Vault custody. If any eligibility, reservation, nonce-consumption or funding check fails, revert the entire acceptance with no match ID, partial reserve or consumed authorization; concurrent acceptances must not oversubscribe capacity or double-spend the same request/offer budget.

On success, emit reconstructable MatchAccepted evidence with the exact canonical IDs, versions and economic/profile commitments; bind the selected provider-derived beneficiary and payer refund reference once. One request may be matched only as allowed by its explicit bounded multi-match policy; the V1 default is one accepted match per request. Multiple requests against an offer are allowed only while individual and aggregate capacity constraints hold. A partial-fill or multi-provider workflow requires a separately specified versioned policy allocating non-overlapping units, budgets, capacity and beneficiaries before acceptance; it is not enabled by a scheduler splitting a request informally. Cancellation/expiration races and duplicate message delivery are idempotent: a repeat of an identical accepted operation returns the same canonical result where policy permits, never a second economic commitment.

4. Frozen economics, execution and exceptional paths

The accepted match fixes provider/resource identity and revisions, beneficiary entitlement basis, unit price/ceiling, verification profile, deadline, manifest and work plan. No admin, scheduler, endpoint/key rotation or later provider-registration update can redirect that entitlement, expand acceptable compute class or move a node to another provider. Attempt-specific reassignment within the accepted provider is allowed only under CMP-0.5's explicitly preaccepted equivalence/recovery policy; a material provider/resource change requires a separately requester-authorized new match/job or rigorously specified recovery preserving prior obligations and at-most-once unit payment. Accepted execution remains subject to CMP-0.7 lifecycle checks; the match does not itself verify output, release Vault funds or guarantee a worker ran.

Offer pause, provider suspension, endpoint expiry and emergency pause stop new matching and unsafe new assignments but never confiscate already-earned verified claims or redirect payer refunds. An accepted job may enter explicit fail/dispute/refund routes on subsequent provider ineligibility; it must not silently reopen terminal states or erase signed history. Release an offer capacity reservation exactly once upon its authorized completion/cancel/fail/expiry path, with replay-safe accounting. AssetVault420.cancelObligation only restores the vault's free balance; actual payer withdrawal/refund must remain payer-bound and is specified/tested in CMP-0.8. No matching event alone unlocks a payout. Off-chain matching is replaceable, cannot block consensus/finality, and must not expose plaintext inputs, private location or bearer credentials in canonical state.

5. Implementation and executable qualification gate

Proposed code ownership follows frozen architecture: ComputeOfferRegistry420.sol validates provider capacity and versioned offer revisions; ComputeRequestRegistry420.sol validates requester-authorized manifest/constraints and funding references; ComputeMatch420.sol atomically checks both sides' live eligibility, concrete resource ancestry, pricing, capacity, authorizations, reservation and immutable acceptance. They call, rather than copy and independently mutate, CMP-0.5 registries, the CMP-0.4 manifest authorization verifier, CMP-0.2 job registry and an explicitly authorized CMP-0.8 Vault adapter. Proposed paths are not claimed to exist as executable files. Registry-resolved deployment and authorized code-hash publication must precede any active entry.

Check in complete versioned offer/request/match typed schemas, canonical encoding and hash/ID test vectors; independently implement Solidity and Go/TypeScript assertions. Add Foundry and client integration tests for direct and open-market matching, fixed and metered aggregate price ceilings, class-offer resolution, scoped dual authorization, exact funded reserve, snapshot reconstruction, concurrent capacity reservations and idempotent retry/cancel/replay. Negative tests: stale revisions or endpoint; inactive ancestry; forged/revoked signer; wrong request/offer/chain; unsupported policy or incompatible class/runtime/verification/privacy/region; expired window; changed manifest/partition/replication; insufficient reserve; integer overflow or rounding attack; hidden fees; unbounded price oracle; overbid; double match or offer oversubscription; partial fill without explicit policy; beneficiary substitution; cross-provider reassignment; canceled/terminal resurrection; replayed nonces; emergency confiscation; provider suspension redirecting earned funds; Vault release or refund without verified authorized entitlement. For every failure assert no extra match, funded obligation, capacity reservation or payout and no consumed nonce after reverted acceptance. Map assertions to CMP-INV-001–030, emphasizing 002–013, 018–020, 024–030. Run relevant contract/application suites after actual implementation and full repository CI at each exact PR head; docs/Go/Geth green alone cannot satisfy these gates.

Completion classification: canonical offer/request/match boundaries, dual authorization, immutable acceptance and version snapshots, compatibility, capacity/funding atomicity, price ceiling, exceptional paths and test obligations are specified only. No executable matching engine, live registry, real capacity reservation, Vault funding/settlement, dedicated tests or end-to-end paid compute has been demonstrated. Keep PR #367 draft/unmerged pending remaining CMP-0 gates and latest-main reconciliation. CMP-0.7 next specifies authorized job lifecycle and transitions.