← Protocols
EAS
01Description

Ethereum Attestation Service — open-source primitive for making onchain or offchain attestations against typed schemas. Deployed on mainnet and major EVM L2s.

02Best for
  • 01verifiable credentials / proofs
  • 02KYC and reputation badges
  • 03vouches and endorsements
  • 04Sybil resistance signals
  • 05schema-typed onchain claims
03Install
  • pnpm add @ethereum-attestation-service/eas-sdk ethers
04Environment variables
VariableScopeDescription
NEXT_PUBLIC_EAS_CONTRACT_ADDRESSClientEAS contract address for the target chain (e.g. `0xA1207F3BBa224E2c9c3c6D5aF63D0eb1582Ce587` on Ethereum mainnet).
NEXT_PUBLIC_EAS_SCHEMA_UIDClientUID of the registered schema you're attesting against (created via SchemaRegistry).
05Prompt snippet
Use `@ethereum-attestation-service/eas-sdk`. Initialize with `new EAS(contractAddress).connect(signer)` for the target chain (lookup address per chain in EAS docs — different on mainnet, Base, OP, Arbitrum, Scroll, Linea, Sepolia). Define schemas once via `SchemaRegistry.register({ schema, resolverAddress, revocable })` and store the returned UID. Encode attestation data with `SchemaEncoder` matching the schema string, then call `eas.attest({ schema, data: { recipient, expirationTime, revocable, data } })` for onchain, or `Offchain.signOffchainAttestation(...)` with EIP-712 for gasless offchain attestations. Verify offchain attestations with `Offchain.verifyOffchainAttestationSignature` and surface `getAttestation(uid)` to read state. Always check `revoked` and `revocationTime` before trusting an attestation.
06Gotchas
  • EAS contract addresses differ per chain — hardcoding mainnet's address on Base or OP will silently send tx to a non-existent contract. Always look up the address for the active `chainId`.
  • Revocation does NOT delete the attestation — it sets `revocationTime`. Always check `revoked === false` AND `revocationTime === 0` before trusting; stale UI that ignores revocation will show revoked credentials as valid.
  • Schemas must be marked `revocable: true` at registration to allow revocation — non-revocable schemas are permanent and cannot be undone, so design accordingly.
  • Offchain attestations are EIP-712 signatures — they require nothing onchain but also have no canonical storage. You're responsible for hosting/distributing them (IPFS, your DB, etc.) or they're lost.
  • `SchemaEncoder` is strict — the schema string passed to the encoder must match the registered schema exactly (types, names, order) or `encodeData` throws.
  • Resolver contracts can reject or charge fees on attestation/revocation — read the schema's resolver address before assuming a tx will succeed.
07Alternatives