feat: add AttestationHook — EAS receipts for ACP job outcomes#10
feat: add AttestationHook — EAS receipts for ACP job outcomes#10JhiNResH wants to merge 4 commits into
Conversation
|
8183 core already emits events (JobCompleted, JobRejected). What would be the potential use cases for this? @JhiNResH |
|
Good question — events work great for off-chain indexing, but they're not readable on-chain by other contracts. The goal here is portable agent reputation: each attestation is tied to the provider address, so other hooks (like TrustGateHook) can read a provider's job history directly on-chain — no oracle needed. Think of it as building an on-chain resume for every agent, composable across any ERC-8183 deployment. |
|
Updated — removed vendor-specific references. AttestationHook was already fairly generic; just cleaned up the security contact. |
Writes EAS attestations on job completion/rejection. - CEI pattern with pending sentinel for idempotency - Non-revocable attestations (outcomes are facts) - Two-step ownership transfer - Creates immutable on-chain receipts for reputation systems and agent credit histories Includes 05-attestation-patterns.md documentation.
6f4c315 to
affcfaf
Compare
- Changed supportsInterface from external pure to public view override - Added super.supportsInterface(interfaceId) call for proper ERC-165 inheritance - Fixes compilation error after BaseACPHook interface refactor (2026-03-26)
|
Hi @JhiNResH,
|
|
Updated PR #10 in commit 1849650.\n\nAddressed the requested changes:\n1. Pulled current upstream main into this branch.\n2. Added MultiHookRouter support by implementing IERC8183HookMetadata; requiredSelectors() now declares complete + reject.\n3. Removed 05-attestation-patterns.md and summarized its relevant content into the PR description.\n\nThe PR diff is now a single file: contracts/hooks/AttestationHook.sol. |
Summary\n\nAdds
AttestationHook.sol, an afterAction hook that writes EAS-compatible attestations for ERC-8183 job completion and rejection. The hook turns job outcomes into immutable, queryable receipts that downstream reputation systems can index.\n\n## Hook Contract\n\n###contracts/hooks/AttestationHook.sol\n\n-_postComplete: writes an attestation withcompleted=true\n-_postReject: writes an attestation withcompleted=false\n- Usestry/catchso EAS failures do not revert the parent job transition\n- Stores one attestation UID per job using a CEI sentinel guard\n- Uses provider as recipient so providers accumulate portable outcome history\n- ImplementsIERC8183HookMetadataand declarescomplete+rejectfor MultiHookRouter support\n\n## Motivation\n\nERC-8183 core events are useful for off-chain indexing, but they are not a standardized receipt object. EAS attestations provide a durable receipt layer for agentic commerce:\n\n1. Credit history: every provider can accumulate completed/rejected job receipts.\n2. Reputation aggregation: indexers can compute completion rate, volume, client diversity, and recency.\n3. Composability: other systems can query attestations without custom event pipelines.\n4. Market signal: outcome-derived metrics can support agent reputation and token analysis.\n\n## Design Decisions\n\n| Decision | Rationale |\n|---|---|\n| afterAction only | Records outcomes without gating job lifecycle |\n| try/catch on EAS | External attestation failure must not break jobs |\n| recipient = provider | Providers accumulate reputation receipts |\n| revocable = false | Job outcomes are immutable facts |\n| expirationTime = 0 | Receipts are permanent |\n| MultiHookRouter metadata | Router can compose this hook with other hooks safely |\n\n## Schema\n\n\nuint256 jobId, address client, address provider, address evaluator, uint256 budget, bytes32 reason, bool completed\n\n