A job from brief to payout
01
Fund
The client escrows the budget and names the evaluator.
Public: budget and parties02
Submit
The work is encrypted to the client and evaluator only.
Public: file hash03
Decide
Approve pays the provider. Reject refunds the client.
Public: the verdict04
Or expire
Past the deadline, anyone can refund the client.
Public: refundWho can do what
StateAllowed
FundedProvider submits. Client or evaluator cancels. Anyone expires it after the deadline.
SubmittedEvaluator completes (escrow to provider) or rejects (escrow to client). Anyone expires it after the deadline.
FinalCompleted, rejected and expired jobs never move again.
Money can only reach the provider on completion or the client on refund. An evaluator can't pay itself and a client can't approve its own job.
Seal the work, prove it's the same file
The hash on chain lets anyone check the stored file is the one submitted, without being able to read it.
const sealed = ag.sealDeliverable(file, clientKey, evaluatorKey); await upload(uri, sealed.ciphertext); await send([provider], ag.submitIx({ provider, job, deliverableHash: sealed.hash, uri, wraps: sealed.wraps }));