Ethereum Attestation Service — open-source primitive for making onchain or offchain attestations against typed schemas. Deployed on mainnet and major EVM L2s.
- 01verifiable credentials / proofs
- 02KYC and reputation badges
- 03vouches and endorsements
- 04Sybil resistance signals
- 05schema-typed onchain claims
- pnpm add @ethereum-attestation-service/eas-sdk ethers
| Variable | Scope | Description |
|---|---|---|
| NEXT_PUBLIC_EAS_CONTRACT_ADDRESS | Client | EAS contract address for the target chain (e.g. `0xA1207F3BBa224E2c9c3c6D5aF63D0eb1582Ce587` on Ethereum mainnet). |
| NEXT_PUBLIC_EAS_SCHEMA_UID | Client | UID of the registered schema you're attesting against (created via SchemaRegistry). |
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.
- ⚑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.