Verifying Identity with EAS on Maroo
A complete walkthrough of registering a schema, issuing an attestation, and verifying it via standard EVM JSON-RPC.
What You Will Learn
- ✓How to register a schema with the Maroo EAS Schema Registry
- ✓How to issue an on-chain attestation
- ✓How to query the attestation back via standard EVM tooling (cast / viem / eas-sdk)
Prerequisites
- Maroo Testnet Account with OKRW
- Basic Solidity/Ethers.js knowledge
Tools Needed
Hardhat (or Foundry)Node.js 20+Foundry's cast (optional, for shell verification)
In this tutorial, we will simulate a KYC provider issuing an 'IsVerified' attestation to a user. We will then read the attestation back over standard EVM JSON-RPC — the same path a frontend dApp or backend service would use to verify a user's status. EAS on Maroo is a Solidity contract preinstall, so any EVM tooling (viem, ethers, cast, eas-sdk) reads it directly.
1
1. Define the Schema
First, we need to register a schema. For this tutorial, our schema is simple:
bool isVerified. We will use a script to register this with the global EAS Schema Registry. scripts/register.js javascript
const { SchemaRegistry } = require("@ethereum-attestation-service/eas-sdk");
// ... setup provider/signer ...
const schemaRegistry = new SchemaRegistry(SCHEMA_REGISTRY_ADDRESS);
const schema = "bool isVerified";
const resolverAddress = "0x0000000000000000000000000000000000000000"; // No resolver
const revocable = true;
const tx = await schemaRegistry.register({ schema, resolverAddress, revocable });
const uid = await tx.wait();
console.log("Schema UID:", uid); 2
2. Create an Attestation
Now, act as the issuer. We will attest that a specific recipient address is verified.
scripts/attest.js javascript
const { EAS, SchemaEncoder } = require("@ethereum-attestation-service/eas-sdk");
const eas = new EAS(EAS_CONTRACT_ADDRESS);
eas.connect(signer);
const schemaEncoder = new SchemaEncoder("bool isVerified");
const encodedData = schemaEncoder.encodeData([{ name: "isVerified", value: true, type: "bool" }]);
const tx = await eas.attest({
schema: SCHEMA_UID,
data: {
recipient: "0xRecipientAddress...",
expirationTime: 0,
revocable: true,
data: encodedData,
},
});
const newAttestationUID = await tx.wait();
console.log("Attestation UID:", newAttestationUID); 3
3. Verify via JSON-RPC
Read the attestation back with
getAttestation(uid) against the EAS contract. Either cast from a shell or a viem/ethers call from app code — both hit the same EVM view. terminal bash
cast call $EAS_CONTRACT \
"getAttestation(bytes32)" \
$ATTESTATION_UID \
--rpc-url $MAROO_RPC viem typescript
const att = await publicClient.readContract({
address: EAS_CONTRACT,
abi: easAbi,
functionName: "getAttestation",
args: [attestationUID],
});
const valid =
att.revocationTime === 0n &&
(att.expirationTime === 0n || att.expirationTime > BigInt(Math.floor(Date.now()/1000))); Tip: Check `revocationTime` (must be 0) and `expirationTime` (must be 0 = never, or in the future) — those are exactly the same checks PCL's `EAS_POLICY` runs on the AnteHandler path.
Conclusion
You issued an attestation with the standard eas-sdk and verified it with standard EVM tools. No specialized CLI needed — EAS on Maroo behaves like EAS on any EVM chain. For reverse lookups ("what attestations does this user have under schema X?") see
querying-eas-data and the Indexer methods.