Development of Attestation System (EAS — Ethereum Attestation Service)
EAS (Ethereum Attestation Service) — open protocol for creating on-chain and off-chain attestations on Ethereum and L2. Attestation — any statement by one address about another address or fact. "Address A confirms that address B passed KYC", "Address A confirms that B is a DAO participant".
Key EAS Concepts
Schema: data structure of attestation. Registered on-chain in SchemaRegistry. Defines fields and their types.
Attestation: specific confirmation based on schema. Contains data, attester (who confirmed), recipient (about whom), expiration, revocable flag.
On-chain vs Off-chain: attestations can be stored on-chain (expensive, but permanent) or off-chain (IPFS/Arweave) with on-chain UID for verification.
Schema Registration
import { ISchemaRegistry, SchemaRecord } from "@ethereum-attestation-service/eas-contracts/contracts/ISchemaRegistry.sol";
ISchemaRegistry schemaRegistry = ISchemaRegistry(EAS_SCHEMA_REGISTRY);
// Register schema
bytes32 schemaUID = schemaRegistry.register(
"bool isKYCVerified, uint8 verificationLevel, string jurisdiction",
ISchemaResolver(resolverAddress), // optional resolver contract
true // revocable
);
Creating Attestation
import { IEAS, AttestationRequest, AttestationRequestData } from "@ethereum-attestation-service/eas-contracts/contracts/IEAS.sol";
IEAS eas = IEAS(EAS_ADDRESS);
bytes32 attestationUID = eas.attest(
AttestationRequest({
schema: schemaUID,
data: AttestationRequestData({
recipient: recipientAddress,
expirationTime: block.timestamp + 365 days,
revocable: true,
refUID: bytes32(0),
data: abi.encode(true, 2, "EU"), // isKYCVerified, level, jurisdiction
value: 0
})
})
);
Schema Resolver
Optional smart contract called when creating/revoking attestation — for additional logic:
import { SchemaResolver } from "@ethereum-attestation-service/eas-contracts/contracts/resolver/SchemaResolver.sol";
contract KYCAttestationResolver is SchemaResolver {
mapping(address => bool) public verifiedAddresses;
function onAttest(Attestation calldata attestation, uint256)
internal override returns (bool) {
// Only whitelist attesters can create
require(authorizedAttesters[attestation.attester], "Not authorized");
(, uint8 level,) = abi.decode(attestation.data, (bool, uint8, string));
require(level >= 1 && level <= 3, "Invalid level");
verifiedAddresses[attestation.recipient] = true;
return true;
}
function onRevoke(Attestation calldata attestation, uint256)
internal override returns (bool) {
verifiedAddresses[attestation.recipient] = false;
return true;
}
}
EAS SDK (TypeScript)
import { EAS, SchemaEncoder } from "@ethereum-attestation-service/eas-sdk";
const eas = new EAS(EAS_ADDRESS);
eas.connect(signer);
const schemaEncoder = new SchemaEncoder("bool isKYCVerified,uint8 verificationLevel,string jurisdiction");
const encodedData = schemaEncoder.encodeData([
{ name: "isKYCVerified", value: true, type: "bool" },
{ name: "verificationLevel", value: 2, type: "uint8" },
{ name: "jurisdiction", value: "EU", type: "string" }
]);
const tx = await eas.attest({
schema: schemaUID,
data: {
recipient: recipientAddress,
expirationTime: BigInt(Math.floor(Date.now() / 1000) + 365 * 24 * 3600),
revocable: true,
data: encodedData
}
});
const uid = await tx.wait();
Use Cases
EAS is used in: Gitcoin Passport (attestations of on-chain activity), Optimism Retro Funding (attestations of contribution), Safe (attestations of trusted addresses).
Development of system based on EAS — 2-4 weeks for custom schema + resolver + frontend.







