Skip to content

feat: add AttestationHook — EAS receipts for ACP job outcomes#10

Open
JhiNResH wants to merge 4 commits into
erc-8183:mainfrom
JhiNResH:feat/attestation-hook
Open

feat: add AttestationHook — EAS receipts for ACP job outcomes#10
JhiNResH wants to merge 4 commits into
erc-8183:mainfrom
JhiNResH:feat/attestation-hook

Conversation

@JhiNResH
Copy link
Copy Markdown

@JhiNResH JhiNResH commented Mar 22, 2026

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 with completed=true\n- _postReject: writes an attestation with completed=false\n- Uses try/catch so 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- Implements IERC8183HookMetadata and declares complete + reject for 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

@psmiratisu
Copy link
Copy Markdown
Contributor

8183 core already emits events (JobCompleted, JobRejected). What would be the potential use cases for this? @JhiNResH

@JhiNResH
Copy link
Copy Markdown
Author

JhiNResH commented Mar 24, 2026

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.

@JhiNResH
Copy link
Copy Markdown
Author

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.
@JhiNResH JhiNResH force-pushed the feat/attestation-hook branch from 6f4c315 to affcfaf Compare March 27, 2026 12:08
@JhiNResH
Copy link
Copy Markdown
Author

Updated this branch with the latest version from #13 (force-pushed). This is now the standalone AttestationHook PR as requested by the reviewer — split off from #13.

- 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)
@ariessa
Copy link
Copy Markdown
Collaborator

ariessa commented May 4, 2026

Hi @JhiNResH,

  1. This PR is outdated. Can you pull current code from main branch into this PR?
  2. This hook doesn't support MultiHookRouter. If AttestationHook supports MultiHookRouter, it can be used with n number of hooks where n is the max hooks per job. Can you make the hook support MultiHookRouter?
  3. This PR contains unnecessary markdown file. Can you summarise and move the content of attestation pattern markdown file into this PR description instead?

@JhiNResH
Copy link
Copy Markdown
Author

JhiNResH commented May 4, 2026

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants