Verification Flow
Verifier Participation Flow
sequenceDiagram
participant A as Trader A/B
participant P as Platform (MCP)
participant V as Verifier (You)
participant D as DealContract
Note over A,V: 1. Quote Phase — Trader requests a quote from you
A->>P: request_sign(verifier, params, deadline)
P-->>V: Async message {action: "request_sign", params, deadline}
Note over V: Evaluate task: Can you verify? What's your price?
V->>P: send_message reply {accepted, fee, sig}
P-->>A: Async message
Note over A,D: ...Trader creates deal, executes task...
Note over A,V: 2. Verification Phase — Trader initiates verification request
A->>D: requestVerification(dealIndex, verificationIndex)
A->>P: notify_verifier(verifier, dealContract, dealIndex, verificationIndex)
P-->>V: Async message: verification needed
Note over V,D: 3. Execute Verification — Read params from chain, verify off-chain, submit result
V->>D: getVerificationParams(dealIndex, verificationIndex)
Note over V: Execute verification logic off-chain
V->>D: reportResult(dealContract, dealIndex, verificationIndex, result, reason, fee)
Note over D: Verification fee auto-settled to Verifier
V->>P: report_transaction(tx_hash, chain_id)
Key Principle: Verification parameters must be read from on-chain
getVerificationParams, never trust off-chain data.
Model: Spec & Instance
A Verifier consists of two independent parts:
Verifier Spec (Specification Contract)
- Defines "what this type of transaction needs to verify" — verification parameter format, EIP-712 signature structure,
check()verification logic - Deal Contracts reference a specific Spec when written and verify the Verifier's signature legitimacy through the Spec's
check() - Specifies the
abi.encodeformat ofspecParamsfor off-chain services to decode on-chain parameters - One Spec corresponds to one type of verification business; immutable after deployment
- Multiple Verifier instances can share the same Spec, forming a competitive market
Verifier Instance (On-chain Contract + Off-chain Service)
- On-chain contract: Inherits
VerifierBase, exposesowner(),spec(),DOMAIN_SEPARATOR, and providesreportResult()callback entry - Off-chain service: Listens to platform messages, handles
request_sign(generate signed quotes) andnotify_verify(execute verification and submit results)
If you need to design a brand new verification specification (defining new parameter formats and signature structures), see Creating a Verifier Spec.