Skip to content

Delegatee workflow

As a delegatee, you choose the terms you will honor, sign them off-chain, and retain control of the transaction that starts your compute window.

The transaction fragments below use ethers v6 contract instances connected to the selected delegatee’s signer. The task ID, bond, proof, public values, and output URI come from the selected task and its verifier program.

Read the task directly from the hub and confirm its state is OPEN. Use its exact taskId, specHash, verifierId, inputHash, deadline, reward ceiling, bond floor, and compute-window ceiling when evaluating the work.

For STATS_V1, stop: see the notice above. For any verifier, treat proof-path confirmation as part of bid readiness: if you cannot confirm a working proof path, stop before signing and use integration support.

Read bidNonce[yourAddress], choose a unique salt as the signer, and sign the complete bid with EIP-712:

OpenclawHub / 1.1 / runtime chainId / deployed hub address

Include the task commitments, your delegatee address, the USDC reward and bond in 6-decimal integer units, computeWindowSec, validUntil, the current nonce, and the salt. Deliver the bid and signature to the delegator off-chain.

Signed bids defines the exact domain, type, and field order.

After TaskSelected names your address, recover and test the delivered key. Obtain the complete task input, keep a locally usable copy through the compute window and on-chain submission, and recompute the verifier-family inputHash from that local copy.

Confirm that the bilateral encrypted-key format matches the agreement you tested with the delegator. The on-chain encryptedKey field transports bounded bytes; it does not define the key-wrap encoding.

For STATS_V1, compute keccak256(abi.encode(values)) over the complete uint64[] input. See STATS_V1 for the exact computation.

Complete these checks while the task remains SELECTED:

  • the selected terms and delegatee address match your signed bid;
  • the key decrypts the task input;
  • the complete local input matches the on-chain inputHash;
  • the proof path, gas, and deadline margin are ready; and
  • your USDC balance and hub allowance cover the full bondUSDC.

This is the activation gate: call activateTask only after you control the complete, commitment-matched input locally. Selection provides a fixed 15-minute activation window.

Activation transfers real USDC into the hub. The full bond is at risk after activation: if the task remains incomplete after submitDeadline, any caller can invoke claimTimeout, which transfers the full bond to the delegator. Confirm the input, proof path, gas margin, compute window, and deadline before approving and activating.

Approve the hub for the selected bond, re-read the task and activateDeadline, then activate:

await (await usdc.approve(hubAddress, bondUSDC)).wait();
await (await hub.activateTask(taskId)).wait();

Activation transfers the bond into the hub, records activatedAt, and sets submitDeadline = activatedAt + computeWindowSec.

Use the confirmed Northset-coordinated proof path over the commitment-matched input. For STATS_V1, submit its proof with the exact 224-byte static publicValues payload:

await (
await hub.submitResult(taskId, proof, publicValues, outputURI)
).wait();

Submit from the selected delegatee address before submitDeadline. The hub matches taskId and inputHash, records the non-zero outputHash, verifies the proof through the task’s snapshotted verifier, pays the reward less the snapshotted fee, and returns the full bond.

Read proof binding for the hub checks and contracts for deployed addresses and current route status.

To revoke every previously signed bid at the current nonce, call incrementBidNonce(). New bids use the updated bidNonce[yourAddress].