420Docs context
Skip to content

CMP-0.4 — Signed execution manifest and authorization envelope

Status: PROTOCOL SPECIFICATION ONLY. No manifest verifier, contract, key-management service, worker execution or executable signature fixtures are introduced by this document. Authority: the frozen ComputeMarket V1 architecture, CMP-0, CMP-0.2 canonical job schema, and CMP-0.3 deterministic work-unit identity. CMP-0.4 defines the signed manifest, not a new on-chain job, economic consent, or scheduler authority. No new fixed Genesis predeploy, active service publication, custody privilege or consensus execution dependency.

1. Authoritative objects and binding moments

A ManifestPayloadV1 is a versioned immutable declaration of what may execute and what evidence/output policy applies. Its authorizer is the canonical request owner or an independently verified, narrowly scoped delegate. A provider's acceptance of the match and a worker's receipt are distinct signatures with distinct purposes; neither substitutes for requester authorization. A manifest can be prepared before a job exists: do not require a jobId or matchId inside its creation-time digest. Instead, the request commits to manifestHash; the accepted job inherits that hash through its one authoritative request, and the accepted match is checked against its constraints. At ACCEPTED, manifest, execution version, resource/verification policy, partition plan and maximum spend are locked. A changed payload or material term needs an authorized new request/match/job, never an in-place mutation or reuse of the old work-unit identity.

Distinguish payload hash, signature digest and signed envelope ID. manifestHash is the Keccak-256 hash of canonical typed payload encoding, without a signature; the owner's signature authenticates a separate chain-bound authorization digest over that hash and the exact request. The signed envelope may carry the signature and off-chain retrieval metadata, but its mutable transport URL and signature bytes never change the manifest payload hash. A new signature over the same payload/request does not create a new job, work unit or payment entitlement.

2. Version-1 canonical payload and serialization

Define PAYLOAD_DOMAIN_V1 = keccak256(utf8("420Integrated.ComputeMarket.ManifestPayload.v1")). Define ManifestPayloadV1 as the following ordered static ABI tuple, with all bytes32 values exactly 32 bytes and all integers encoded as unsigned, big-endian, left-zero-padded 32-byte standard ABI words; abi.encodePacked, JSON hashes, normalized text guesses, SHA3-256 and implicit default fields are prohibited:

(bytes32 payloadDomain, uint32 manifestSchemaVersion,
 bytes32 workloadTypeId, bytes32 runtimeProfileId, uint32 runtimeProfileVersion,
 bytes32 executableDigest, bytes32 commandSpecHash,
 bytes32 inputCommitment, bytes32 inputAccessPolicyHash,
 bytes32 outputSchemaHash, bytes32 outputAccessPolicyHash,
 bytes32 resourceProfileHash, bytes32 resourceLimitHash,
 uint64 executionTimeoutSeconds, uint64 executionDeadline,
 bytes32 partitionSchemeId, uint32 partitionSchemeVersion,
 bytes32 partitionPlanHash, uint32 partitionCount, uint32 replicationFactor,
 bytes32 verificationProfileId, uint32 verificationProfileVersion,
 bytes32 verificationPolicyHash, bytes32 executionPolicyHash)

manifestHash = keccak256(abi.encode(the ordered fields above)), with the first field set to PAYLOAD_DOMAIN_V1 and manifestSchemaVersion = 1. All referenced policy/profile hashes resolve to separately canonical, immutable, versioned bytes at acceptance; an unresolved, revocable or mutable pointer is insufficient. A hash-only executable is insufficient without a pinned digest algorithm and immutable byte retrieval/verification policy: executableDigest commits to the exact image/artifact bytes under the runtime profile's explicitly named algorithm, and workers MUST verify bytes before launch. commandSpecHash commits to canonical argv, entrypoint, environment names and allowed nonsecret values, working directory and execution flags, under a versioned command schema. No unbounded free-form shell command is inferred from display text. The exact representation of each subordinate profile/policy and its vectors remains an implementation gate; unsupported versions fail closed.

Require nonzero domain, workload, runtime profile/version, executable digest, command, input commitment, output schema, resource profile/limits, partition scheme/version/plan, verification profile/version and hashes for access/execution policies. A policy may explicitly define an empty optional resource or access set with a nonzero domain-specific canonical hash, not a zero sentinel that silently removes constraints. partitionCount and replicationFactor are both at least one and bounded by the accepted policy and total authorized job budget. Deadline and timeout must be finite and within the accepted request; no manifest can extend the request deadline or allocate additional replicas after acceptance. The payload has no wallet keys, plaintext private inputs, source datasets, raw output, passwords, secret environment values or bearer tokens; private material moves through independently authorized encrypted off-chain channels.

3. Chain-bound signed authorization (EIP-712 V1)

Use the EIP-712 digest keccak256(0x1901 || domainSeparator || structHash), where domainSeparator = keccak256(abi.encode(keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), keccak256(bytes("420Integrated.ComputeMarket")), keccak256(bytes("1")), uint256(chainId), address(manifestAuthorizationVerifier))). The verifier address MUST be a real deployed, code-hash-verified, authorized registry-resolved CMP authorization endpoint on that chain; do not use a hypothetical or fixed Genesis address. Off-chain implementations must be given the exact verified endpoint and chain ID. Reject zero/foreign chain IDs, unregistered verifier, codehash/version mismatch or expired signer grant.

Set AUTH_TYPEHASH_V1 = keccak256("ComputeManifestAuthorization(bytes32 manifestHash,bytes32 requestId,address authorizer,uint64 nonce,uint64 expiresAt)"); structHash = keccak256(abi.encode(AUTH_TYPEHASH_V1, manifestHash, requestId, authorizer, nonce, expiresAt)). The payload and authorization encoding are separate and must not be conflated. requestId is the canonical request registry ID; the registry must demonstrate that the named authorizer is the actual requester or a currently authorized scoped delegate, with the job/request funding maximum and execution policy independently accepted by that requester. The signature never grants fresh funding or widens constraints. Require nonzero manifest/request IDs, nonzero authorized address, a per-authorizer/per-request nonce allocated under a published single-use rule, and an expiry strictly after verification time but no later than the bound request/manifest execution authorization deadline. Consume the nonce atomically upon successful request binding; rollback on rejection; replays, cross-request reuse and altered payloads fail. Define how revoked delegations affect not-yet-accepted manifests, while already accepted jobs retain frozen obligations and can be halted/refunded only by explicit lifecycle policy.

For EOAs, require validated ECDSA recovery with low-s and valid v and reject zero-address recovery; for contract wallets, use ERC-1271 isValidSignature against the exact digest and require correct magic-value return. ERC-1271 signatures are time/state-sensitive: verify at acceptance, commit the authorization outcome and signer/capability evidence, and do not treat later unrelated smart-wallet state changes as permission to rewrite accepted terms. If a future account-abstraction/session-key route is added it must validate the precise action, request ID, profile, nonce, expiry and maximum scope, not merely possession of a provider/scheduler key. No unsigned mode or fallback to personal_sign is permitted for paid V1 execution.

4. Worker verification and cross-phase correspondence

Before accepting or running a paid unit, resolve canonical job -> request -> accepted match -> manifestHash; retrieve the exact payload by its hash, recompute manifestHash, authenticate the request-bound signature and verify stored acceptance evidence, runtime profile/version, bytes of executable, policy references, deadlines, resource/region/privacy constraints, input-access authorization, verification profile and bounded work plan. Compare manifestHash, scheme/version, partition plan/count and replication factor byte-for-byte with the fields committed by CMP-0.3; the unit ID is derived from that accepted state. The scheduler can distribute bytes and propose assignments but cannot replace the payload, issue authorization, broaden policy or change payouts. A provider must check assignment and match eligibility separately; a valid requester signature does not authorize an arbitrary provider or grant dataset access.

Every attempt and signed receipt references the canonical job, unit, attempt, manifest hash and assigned provider/resource. The receipt signer attests to its claim, not to correct execution. The selected verifier profile supplies correctness/evidence requirements. Reject mismatched manifest, executable digest, command, input commitment, output schema, partition, resource/verification policy, accepted price cap or expired authorization. Terminal jobs do not become runnable because a signature remains cryptographically valid. No secret content or unrestricted transport locator is written on chain.

5. Threat model and executable qualification gate

Positive tests: independently reconstruct payload ABI bytes and hash in Solidity and Go/TypeScript; produce pinned full ABI-word and EIP-712 typed-data fixtures with expected payload hash, domain separator, struct hash, final digest and valid EOA/ERC-1271 cases; authenticate one canonical request/match/job, verify scheduler-independent payload retrieval, and show one payload produces exactly the CMP-0.3 unit IDs under the accepted plan. Use independent implementations over shared checked-in vectors; a CI pass for unrelated Go/docs tests does not prove this gate.

Negative tests MUST cover reordered/dropped/added fields, packed ABI, SHA3 substitution, altered subordinate profile bytes, mutable locator, altered image bytes/command/input/output/limits/partition/replication/verifier, zero/unsupported versions, excessive timeout/expired request, wrong chain/verifier/codehash, cross-request replay, duplicate nonce and concurrent acceptance, revoked or overbroad delegation, malleable ECDSA signature, bad ERC-1271 return, unsigned manifests, changed policy between matching and acceptance, resource/privacy mismatch, unauthorized dataset/output access, forged worker receipt, altered or stale attempt reference, duplicate settlement across re-signing and scheduler substitution, and emergency/cancel/refund/retry boundary cases. Reject on every mismatch without consuming funds or creating a new settlement entitlement. Record exact invariant-to-test mapping for CMP-INV-001–030 and include contract/application qualification once implementations exist.

Completion boundary: This increment specifies the canonical payload and request-bound EIP-712 envelope and required verification/negative-test behavior. Executable vectors, deployed verifier, authorization nonce storage, wallets, worker enforcement, real Vault-funded job execution and settlement remain not implemented or verified by this document. Keep PR #367 draft until the remaining CMP-0 gates, latest-main reconciliation and exact-head qualification are satisfied.