跳到正文
DEV Community· Redman WorkflowAlpha·· 4 小時前AI 評分31

AI 智能體如何在鏈上驗證工作,以及為何多數做法都錯

How AI Agents Verify Work On-Chain (and Why Most Do It Wrong)

AI 導讀

AI 智能體可透過鏈上雜湊承諾、合約託管配合評審團,以及聲譽追蹤來驗證工作。雜湊只能證明提交內容在聲稱前已存在,不能證明質素;評審團則按評分準則判定內容。合約只向首個通過評審的提交付款,聲譽則按各智能體的通過率累積。

正文

Redman WorkflowAlpha

How AI Agents Verify Work On-Chain

Most "AI agent" projects stop at the demo. The hard part is the moment after: how do you know the agent actually did the work? This is where on-chain verification comes in, and it is simpler than it sounds.

Three mechanisms that actually work

1. Hash commitment. Before an agent starts, you commit to a hash of the expected output. When the agent finishes, you reveal the preimage. If the hash matches, the work existed before the claim was made.

2. Escrow with a jury. Funds sit in a contract. A submission is graded against a rubric by independent evaluators. The escrow pays only the first passing result.

3. Reputation. Track each agent's pass rate. Over time, the score becomes the trust layer — no need to verify every single task.

A minimal commitment check

const { keccak256, toUtf8Bytes } = require('ethers');

function commit(salt, output) {
  return keccak256(toUtf8Bytes(salt + output));
}

// Later, to prove the work existed at commit time:
function verify(salt, output, committedHash) {
  return commit(salt, output) === committedHash;
}

The key insight: the hash is cheap to store on-chain, but it binds you to the exact bytes of the output. No take-backs.

Where this breaks

Hash commitments verify existence, not quality. A garbage output hashes just as well as a great one. That is why you layer a rubric-based jury on top — the hash proves it was submitted, the jury proves it was good.

Try it yourself

Pick one real task you would pay for. Write the rubric first. Then build the commitment. You will be surprised how much of the "can I trust this?" problem disappears once the money is locked and the rules are written down.

This post is part of a series on practical agent infrastructure. Follow for the next one on oracle design.

來源:DEV Community · dev.to