420Docs context
Skip to content

CMP-0.11 — Client, node and 420AI integration contracts

Status: PROTOCOL AND INTEGRATION SPECIFICATION ONLY. This increment does not add a runnable compute worker, published SDK, 420Compute UI, AI adapter, live registry record, funded job, deployment or dedicated integration test. Authority: frozen ComputeMarket V1 architecture, CMP-0 overview, CMP-0.1 source and integration audit and the canonical CMP-0.2–0.10 specifications. ComputeMarket is a provider-neutral application protocol: 420AI consumes it but cannot become a prerequisite or substitute for general-purpose compute.

1. Inspected source boundaries and classification

The CMP-0.1 audit of pinned main (277395931f5419af0728f3ea801800401a8bb336) located an existing node420 Geth/execution CLI and an existing packages directory, but not a compute provider CLI mode or a dedicated @420/compute-sdk package at the inspected paths. The proposed general-purpose CMP contracts were catalogued but not located at named contracts/src/compute/ paths. Existing AIJobManager.sol, AIJobEscrow.sol and AIProviderRegistry.sol have compatibility hooks, not a demonstrated CMP execution-and-payment integration. AssetVault420.sol implements general obligations; its vault-wide free balance alone cannot provide payer-isolated CMP refunds. These are source observations at the audited baseline, not claims about every external application repo or subsequent main change. Before coding any integration, repeat the exact-path and interface audit against the then-current integration branch, resolve actual ABI and deployment identifiers and record changed assumptions.

The intended component boundaries below are design targets, not claims that a named package, contract, URL, service or interface is currently deployed. Every privileged protocol endpoint must be deployed separately, runtime-code-hash verified, version/interface/dependency checked and authorized for publication in ProtocolRegistry. No CMP fixed Genesis predeploy or collision with the frozen AI, registry or consensus addresses is permitted. Discovery proves an identity/version and nothing about caller authorization, job funding or correctness.

2. One canonical protocol across client surfaces

A future @420/compute-sdk (or explicitly versioned equivalent within the existing shared SDK), 420Compute UI, CLI and AI adapter MUST consume the same authoritative registry-resolved request, offer, match, job, manifest, attempt, receipt, verification, dispute and settlement records. Publish a machine-readable versioned interface manifest binding chain ID, registry service key, verified implementation/code hash, ABI/schema hashes, supported contract versions, capability action identifiers, event schema, typed-signature domains, RPC finality assumptions and off-chain evidence/access protocol. Abort on unsupported version, wrong chain, unpublished or changed codehash, invalid registry authority, stale endpoint, mismatched EIP-712 domain or unverified dependency. Do not hardcode an unallocated ComputeMarket system address or silently fall back to an AI address or an arbitrary RPC service.

Client request flow: discover and validate the canonical CMP endpoints; obtain offers/resources/policy bytes and display their versions and expiry; independently authorize the immutable manifest under CMP-0.4 and a separate bounded request/funding consent under CMP-0.2/0.6/0.8; prove payer-specific deposit and backed reserve; obtain provider and requester acceptance of the exact matching snapshot; derive canonical unit and attempt IDs; submit only scoped input-access grants; monitor events with chain finality and reconstruct state from registries on restart; retrieve signed receipts, actual verifier decisions and challenge deadlines; distinguish VERIFIED from challenge-final provider claimable, provider wallet paid, payer refund claimable and payer wallet paid. Client-side optimistic labels (queued, submitted, verifying, payment requested) are observational, never canonical transitions or authorizations. Job, request, offer, match, unit, attempt, receipt, proof and Vault obligation IDs remain separate.

Every API write specifies its chain, verified target, actor principal/delegate capability, object ID, operation ID, version, deadline and nonce; duplicate same-intent retries return the same canonical result and conflicting replays fail. Signatures follow accepted EOA/ERC-1271 rules, are domain/action/object-scoped and never turn a relayer into a payer or worker into a verifier. Read APIs return immutable acceptance snapshots and evidence references with explicit provenance, pagination and finality; an indexer cache is not a state authority. Clients must reconcile pending/reverted/reorganized writes against chain records, preserve failed attempts for audit and avoid auto-retrying a spend or creating a second payment on RPC timeout.

3. Worker and optional node420 compute runtime isolation

A general worker may run as an independent supervised service or a separately opted-in node420 compute companion, but it MUST NOT execute arbitrary customer code in the consensus, block-production, EVM engine, validator-key, bridge or wallet process. Existing Geth synchronization, block finality and validator operations cannot depend on worker scheduling, private workload retrieval or receipt creation (CMP-INV-001). A worker failure, hang, compromised job image, capacity overload or network outage must not starve consensus resources or expose node/validator signing keys. On a cohost, enforce explicit CPU/GPU/memory/disk/network quotas, nonprivileged process identity, sandboxed runtime, immutable artifact-digest verification, timeouts, egress allowlist and host/tenant separation; high-assurance or sensitive jobs require the preaccepted isolation/attestation policy, not an unverified marketing assertion.

Worker start-up validates the exact provider→node→resource ancestry/status and active action-scoped registration; verifies its manifest bytes and executable digest, authorized assignment/attempt nonce, immutable job/match economics, chain/deadline, approved resource and input-access policy before running. An optional local scheduler can propose capacity and distribute payloads but cannot accept matches, mint attempts, change beneficiaries, verify its own work when independence is required or release Vault money. Rotate worker keys using identity-preserving grants with effective times and revocations; never share a provider execution signer with Vault custody or a validator. Make assignment leases finite and recoverable across crash/restart; a replacement worker may start only a separately authorized attempt of the same canonical payable unit, within reserved budget and the accepted retry/reassignment policy. Produce CMP-0.9 attempt-bound signed receipts and policy-required evidence; do not claim correctness based on successful process exit, a worker signature or GPU telemetry alone.

Secrets, inputs and outputs travel only through authenticated, encrypted, object- and purpose-scoped off-chain channels authorized independently by the dataset provider/result consumer. Never log raw inputs, output bytes, access tokens, private prompt/model contents or credentials to chain, CI or public diagnostic endpoints. Bind evidence retention and access grants to the accepted CMP-0.10 challenge/appeal window, enforce deletion/revocation when allowed, and preserve nonsecret commitments for reconstructability. Health/metrics expose operational readiness and aggregate utilization without leaking customer payloads. Backpressure, rate limits, per-tenant quotas and version negotiation must fail closed on unsupported workloads and exhausted capacity.

4. 420AI compatibility adapter: strict translation, no alternate market

The existing fixed-address AI facade remains separate from the registry-resolved general CMP application. An implemented AI-to-CMP adapter must authenticate the actual AI requester and translate its bounded request, deadline, provider/model constraints and manifest into a new or exactly mapped CMP request/job under an immutable one-to-one correlation record. It cannot use the AI manager's legacy unbounded-spend creation path for paid execution. Verify the payer's distinct signed amount cap and real payer-backed CMP Vault funding before confirming FUNDED in the AI facade; reject an AI facade status change lacking corresponding canonical CMP evidence. AI provider computeProviderRef is a mapping reference, not automatically active CMP provider identity, valid collateral or resource eligibility. Resolve real CMP provider/node/resource and accepted beneficiary independently; AI provider suspension must not erase already-earned claims.

Use the AIJobManager's configured computeAdapter and AIJobEscrow's configured settlement/Vault adapter routes only after their real binding, authorization and deployed interface/codehash are verified. The existing AI escrow confirmation methods are accounting confirmations, not physical Vault transfers: only a successful, payer-isolated CMP operation may advance AI funded/claimable/refundable/paid indications. Establish immutable (chainId, aiJobId, cmpJobId, requestId, matchId, fundingRef) correlation with one-time consumption and reconcile each AI state transition against actual CMP lifecycle/economics. A rerun, callback race, fabricated AI event or alternative adapter may not create a second CMP job/entitlement or rebind the payer/provider. An AI result display may use AI-specific model metadata, but canonical correctness, receipt, dispute and settlement rights remain under the accepted CMP verifier and Vault policy. AI adapter privileges are client-only and narrow; no generic CMP market administrator, shared worker identity, unilateral match, verifier shortcut, Vault withdrawal, unrestricted AI governance or reverse dependency for non-AI requests.

5. UI, indexer and ecosystem interoperability

The 420Compute UI must clearly distinguish requester (quote/consent/funding/status/results/refund), provider (identity/resource/offer/capacity/assigned attempts/evidence/earned claims) and verifier/challenger (policy-scoped evidence, deadlines and case status) surfaces. Present accepted price breakdown including units, replicas, retries, fees, challenge window, actual reserved amount and refund route before final consent. Do not show a scheduler-estimated quote as accepted, a receipt as verified, a released Vault obligation as wallet-paid, a Vault cancellation as refunded or a paused dispute as completed. On stale indexer or divergent RPC results, mark records unconfirmed and require canonical chain refresh. Any transaction builder must show target registry-resolved verified contract, chain, action, amount and recipient and require the right principal/delegate signature; no silent auto-claim or custody privilege escalation.

420Trust receives only authenticated, policy-approved, privacy-minimized post-finality performance/dispute signals; neither reputation nor matching recommendations become canonical provider correctness, slashing, consent or payment authority. Existing Resource Protocol sessions/usage receipts and arbitration case IDs may be linked by explicit versioned mappings, but cannot substitute for CMP unit IDs, correctness decisions or funding obligations. Non-AI clients (rendering, proving, simulation, transcoding and batch) follow exactly the same protocol without importing, registering with or paying through 420AI. Frontend/CDN/indexer compromise may delay presentation but must not replace immutable accepted terms or cause unauthorized on-chain actions.

6. Implementation ownership, verification and release gates

Implement in the following dependency order, recording actual source paths and deployment artifacts as each becomes real: (1) CMP deployed/versioned registries, canonical ABI and capability contracts; (2) payer-segregated Vault adapter and funded immutable match; (3) job/attempt/manifest/receipt verifier and dispute finality; (4) minimal provider-neutral SDK with independent EIP-712 and ABI fixture parity; (5) isolated worker/optional CLI and deterministic recovery; (6) requester/provider UI and indexer with finality reconciliation; (7) the strict AI facade adapter and separately proven non-AI client; (8) operational deployment, runbooks, key/capacity controls and monitored failure recovery. No stage is claimed implemented by documenting it. Publishing a client package or toggling a CLI flag does not establish a live paid job.

Positive executable acceptance cases: SDK/client independently derives the frozen manifest/unit/attempt/receipt IDs; valid EOA/ERC-1271 request and provider consent; a funded non-AI request completes one real worker attempt, independent verification, challenge finality, provider actual Vault claim and payer unused-credit refund; the AI adapter completes an independently funded bounded AI job through those same CMP components; an optional cohost worker failure leaves consensus live; client crash/reorg/retry reconstructs exactly one job, unit entitlement and payout; provider key rotation and suspended-resource policy preserve earned claims; confidential input/output remains off-chain and scoped; an honest disputed job preserves other uncontested entitlements. Assert real transfer balances, payer credits, job/AI correlation, immutable beneficiary, registry codehash and operation IDs.

Negative acceptance cases: fake registry/codehash/chain, invalid signer/capability/nonce or expired consent, mutable offer/manifest/price, unbounded AI legacy creation, AI escrow confirmVaultFunding without actual payer deposit, AI provider reference mistaken for an eligible CMP resource, scheduler-forged acceptance/correctness, worker resource/attempt reassignment without authority, double payout across retries and AI callbacks, mixed payer credit or redirected refund, stale indexer presented as final, external RPC timeout creating a second spend, compromised worker accessing validator keys, worker crash stopping consensus, sensitive evidence leaked via public event/log, incompatible SDK ABI, provider-self-verification where independent profile is required, and AI dependency imposed on a non-AI request. Rejected actions cannot consume another job's funds or reopen a terminal job. Map tests explicitly to CMP-INV-001–030 and run actual contract, worker, SDK, UI/adapter, integration and exact-head repository qualification after executable components exist.

Completion boundary: CMP-0.11 specifies verifiable component contracts, operator isolation, facade translation, UI truth-in-status and executable integration criteria; it introduces none of those runtime implementations. Proceed to CMP-0.12 qualification/closeout planning without representing this documentation PR as a qualified general-purpose ComputeMarket release. Keep PR #367 draft/unmerged until scope is explicitly reconciled and qualified.