Development Preview — Schema UIDs will be published when deployed.
EAS Schemas
Astral Location Services uses the Ethereum Attestation Service (EAS) for all attestations. This page documents the schema definitions.
Location Attestation Schema
Used for storing spatial data (points, polygons, routes).
bytes geometry, string geometryType, string srs, bytes properties
Field Type Description geometrybytes Encoded GeoJSON geometry geometryTypestring ”Point”, “Polygon”, “LineString”, etc. srsstring Spatial reference system (default: “EPSG:4326”) propertiesbytes JSON-encoded metadata
Policy Attestation Schemas
Output schemas for geospatial computations.
BooleanPolicyAttestation
For predicate operations (contains, within, intersects).
bool result, bytes32[] inputRefs, uint64 timestamp, string operation
Field Type Description resultbool The boolean computation result inputRefsbytes32[] References to inputs (UIDs or hashes) timestampuint64 Unix timestamp of computation operationstring Operation with parameters (e.g., “within:500”, “contains”)
NumericPolicyAttestation
For measurement operations (distance, length, area).
uint256 result, string units, bytes32[] inputRefs, uint64 timestamp, string operation
Field Type Description resultuint256 Scaled integer result (centimeters or cm²) unitsstring Base unit (“meters” or “square_meters”) inputRefsbytes32[] References to inputs timestampuint64 Unix timestamp of computation operationstring Operation with parameters (e.g., “distance”, “area”)
GeometryPolicyAttestation (Future)
For transformation operations (buffer, centroid, union).
bytes geometry, string geometryType, bytes32[] inputRefs, uint64 timestamp, string operation
Operation strings include parameters — For example, the within operation returns "within:50000" (radius in centimeters), not just "within". Resolver contracts should use prefix matching when validating operations.
Default Schema UIDs
Astral provides pre-registered schemas without resolver contracts for general use. Use these when you don’t need custom validation logic.
Base Sepolia (84532)
Schema UID Use For BooleanPolicyAttestation 0x4958625091a773dcfb37a1c33099a378f32a975a7fb61f33d53c4be7589898f5contains, within, intersectsNumericPolicyAttestation Register your own distance, length, areaLocation Register your own Location attestations
The BooleanPolicyAttestation schema UID above is the default used by the staging API. For production use or custom resolver logic, register your own schema.
Custom schemas : If you need a resolver contract for custom validation (like the Location-Gated NFT), register your own schema with the same field types. The schema UID will be different, but the data encoding is identical.
The inputRefs array contains a bytes32 for each input:
Input Type Reference Onchain attestation The UID Offchain attestation The UID Raw GeoJSON keccak256(abi.encode(geojson))
This enables verification that specific inputs were used:
( bool result, bytes32 [] memory inputRefs, , ) = abi . decode (...);
// Verify expected landmark was checked
require (inputRefs[ 1 ] == EXPECTED_LANDMARK_UID, "Wrong location" );
Result Scaling
Numeric results are stored as scaled integers:
Measurement Storage Conversion Distance centimeters meters = result / 100Length centimeters meters = result / 100Area square centimeters m² = result / 10000
// In your resolver
( uint256 resultCm, , , , ) = abi . decode (...);
uint256 meters = resultCm / 100 ;
Decoding in Solidity
Boolean Policy
function decodeBooleanPolicy ( bytes memory data ) public pure returns (
bool result ,
bytes32 [] memory inputRefs ,
uint64 timestamp ,
string memory operation
) {
return abi . decode (data, ( bool , bytes32 [], uint64 , string ));
}
Numeric Policy
function decodeNumericPolicy ( bytes memory data ) public pure returns (
uint256 result ,
string memory units ,
bytes32 [] memory inputRefs ,
uint64 timestamp ,
string memory operation
) {
return abi . decode (data, ( uint256 , string , bytes32 [], uint64 , string ));
}
Schema Registry
Schemas are registered in the EAS SchemaRegistry. When deploying your resolver:
import { SchemaRegistry } from '@ethereum-attestation-service/eas-sdk' ;
const registry = new SchemaRegistry ( REGISTRY_ADDRESS );
// Register schema with your resolver
// IMPORTANT: Use revocable: true - Astral signs with revocable=true
const tx = await registry . connect ( signer ). register ({
schema: "bool result,bytes32[] inputRefs,uint64 timestamp,string operation" ,
resolverAddress: yourResolver . address ,
revocable: true
});
const receipt = await tx . wait ();
const schemaUID = receipt . logs [ 0 ]. args . uid ;
Next: Security Security considerations