Skip to main content
Research Preview — APIs may change. GitHub

Onchain attestation

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.

The pattern

Step 1: Register a reference location

Create an onchain location record for the landmark.

Step 2: Deploy a resolver contract

The resolver receives the signed result via EAS’s onAttest callback and executes your business logic — in this case, minting an NFT.

Step 3: Register the schema

Register an EAS schema that points to your resolver contract.
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.

Step 4: Compute and submit

The user’s app gets their location, computes proximity, and submits the signed result onchain.

Other resolver patterns

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:
Access control — grant onchain permissions based on spatial verification:
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