Skip to content

Support onchain attestations and ERC-1271 contract attesters (ERC-8176) #69

Description

@manuelwedler

Follow-up to #65 (ERC-8176 attestation support, closes #61).

#65 verifies only one form of attestation: EAS offchain attestations (version 2) with an EOA signature, stored in the registry's sigs/ directory. ERC-8176 defines two more cases that the library rejects today. Both need one eth_call, so the ChainClient from #65 (ExternalDataProvider.chainClient) is the hook for them.

1. Onchain attestations

The ERC allows the same attestation onchain: "call attest() on the EAS contract with schema = <canonical UID>, data = abi.encode(descriptorHash)", or attestByDelegation(). "Both forms carry identical information content."

Verification differs from the offchain form. There is no file and no signature to recover. The ERC says: "the attester is recorded in the attestation record. Trust the EAS contract's record as authoritative." Revocation comes from eas.getAttestation(uid).revocationTime.

Work:

  • Read getAttestation(uid) on the mainnet EAS contract through chainClient.call, decode the record (schema, attester, data, expirationTime, revocationTime), and apply the same checks as the offchain path (canonical schema, data == descriptorHash, not expired, not revoked, attester trusted).
  • Open question: discovery. The verifier needs the uid. The registry has no file convention for onchain attestation uids yet. Options: a small JSON file in sigs/ that holds the uid, or an EAS indexer query. This needs alignment with the registry maintainers.

2. ERC-1271 contract attesters

The ERC permits a contract (multisig, smart account) as the attester of an offchain attestation: "the signature MAY be produced by any party authorized by the contract's ERC-1271 logic; the contract is the attester regardless of which key produced the signature bytes."

Today verifyAttestation uses ECDSA recovery only. For a contract attester, recovery yields a random EOA address that does not match the trusted attester, so the attestation is rejected.

Work:

  • When the trusted attester address has code (or when recovery does not match), call isValidSignature(digest, signature) on the attester contract through chainClient.call and accept the attestation on the ERC-1271 magic value.
  • Note the ERC's caveat: contract attesters "are verified via ERC-1271 at the current block. Their endorsement reflects the contract's state at verification time, not at issuance time."

References

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions