Research Preview — Smart contract patterns need audit. GitHub
Blockchain integration
Astral’s signed results can be submitted onchain as EAS attestations, making them available to smart contracts. This guide covers the full blockchain integration flow.What is EAS?
The Ethereum Attestation Service (EAS) is an open protocol for making onchain and offchain attestations. Attestations are structured, signed claims — “entity X attests that Y is true.” EAS supports two storage modes:- Onchain attestations — stored directly in EAS contracts, referenced by UID
- Offchain attestations — signed with EIP-712, stored on IPFS or other storage, verifiable without gas costs
The pattern
The core flow: compute a spatial result, sign it, submit it onchain, and let a resolver contract react.Delegated attestation flow
Astral uses EAS’s delegated attestation pattern to separate signing from submission: The delegated attestation pattern means:- Astral signs the attestation data offchain (inside the TEE)
- Developer submits with Astral’s signature (pays gas)
- EAS verifies the signature and records Astral as attester
- Resolver contracts can verify
attestation.attester == astralSigner
delegatedAttestation.deadline indicates when the signature expires. Submissions after the deadline will fail:
Writing a resolver contract
In EAS, a resolver is a smart contract that gets called whenever an attestation is made against a specific schema. This enables:- Validation — accept or reject attestations based on custom logic
- Side effects — execute actions atomically with attestation creation
- Composability — combine attestations with any onchain logic
Basic resolver (LocationGatedAction)
About the Astral signer: The
astralSigner address is the key that signs attestations inside the TEE. Signer management (multisig, key rotation, etc.) is on the roadmap. See Security for more details.Common patterns
NFT minting
Token distribution
Access control
Numeric policies (distance-based)
Use numeric attestations (distance, area, length) for more sophisticated logic like spatial demurrage — where transfer fees vary based on distance from a target location.Decoding attestation data
Boolean policies
Numeric policies
Registering your schema
Before submitting attestations, register your schema with EAS and point it at your resolver:Onchain vs offchain location records
Location attestations — the spatial inputs to computations — can be stored onchain or offchain:Onchain attestations
- Stored on EAS contracts
- Referenced by UID alone
- Higher gas cost
- Permanent, immutable
Offchain attestations
- Stored on IPFS, servers, etc.
- Referenced by UID + URI
- No gas cost to create
- EIP-712 signed
Onchain
Offchain
Chain configuration
Astral supports EAS on multiple EVM-compatible chains. See Schema registry for schema UIDs by chain.Verification best practices
Verify attester
Verify attester
Always check
attestation.attester == astralSigner:Check timestamp
Check timestamp
Prevent replay of old attestations:
Verify input references
Verify input references
Ensure the right locations were checked:
Track used attestations
Track used attestations
Prevent reuse of attestations:
Key rotation
Resolver contracts should support updating the Astral signer address. For the Research Preview, a simple owner-controlled approach works:For production deployments, you may want the owner to be a multisig. We plan to provide more graceful key rotation mechanisms in future releases.