This walkthrough covers the complete blockchain flow: register reference locations, compute a spatial relationship, submit the signed result as an EAS attestation, and let a resolver contract execute business logic.The example builds an NFT that mints when the user is near a landmark — but the same pattern applies to any onchain action gated by spatial computation.
Register an EAS schema that points to your resolver contract.
import { SchemaRegistry } from '@ethereum-attestation-service/eas-sdk';const schemaRegistry = new SchemaRegistry(SCHEMA_REGISTRY_ADDRESS);// Boolean result schema for 'within' operationconst schema = "bool result,bytes32[] inputRefs,uint64 timestamp,string operation";const tx = await schemaRegistry.connect(signer).register({ schema, resolverAddress: nftContract.address, revocable: true // Must be true — Astral signs with revocable=true});const receipt = await tx.wait();const SCHEMA_UID = receipt.logs[0].args.uid;
Schema must use revocable: true — Astral signs delegated attestations with revocable: true. If your schema is registered with revocable: false, EAS will reject the attestation.
The same flow works for any onchain action. Swap the resolver logic to fit your use case:Token distribution — airdrop tokens to users who prove they visited a location:
function _executeAction(address recipient) internal override { token.transfer(recipient, amount);}
Access control — grant onchain permissions based on spatial verification:
function _executeAction(address recipient) internal override { hasAccess[recipient] = true;}
Geofenced transfers — restrict token transfers to users within a region (see the geofenced token guide for the full implementation).For more resolver patterns, decoding signed results, and blockchain integration details, see Blockchain integration.
Next: Blockchain integration
Deep dive into resolver patterns and chain configuration