Skip to main content
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
FieldTypeDescription
geometrybytesEncoded GeoJSON geometry
geometryTypestring”Point”, “Polygon”, “LineString”, etc.
srsstringSpatial reference system (default: “EPSG:4326”)
propertiesbytesJSON-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
FieldTypeDescription
resultboolThe boolean computation result
inputRefsbytes32[]References to inputs (UIDs or hashes)
timestampuint64Unix timestamp of computation
operationstringOperation with parameters (e.g., “within:500”, “contains”)

NumericPolicyAttestation

For measurement operations (distance, length, area).
uint256 result, string units, bytes32[] inputRefs, uint64 timestamp, string operation
FieldTypeDescription
resultuint256Scaled integer result (centimeters or cm²)
unitsstringBase unit (“meters” or “square_meters”)
inputRefsbytes32[]References to inputs
timestampuint64Unix timestamp of computation
operationstringOperation 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)

SchemaUIDUse For
BooleanPolicyAttestation0x4958625091a773dcfb37a1c33099a378f32a975a7fb61f33d53c4be7589898f5contains, within, intersects
NumericPolicyAttestationRegister your owndistance, length, area
LocationRegister your ownLocation 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.

Input References

The inputRefs array contains a bytes32 for each input:
Input TypeReference
Onchain attestationThe UID
Offchain attestationThe UID
Raw GeoJSONkeccak256(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:
MeasurementStorageConversion
Distancecentimetersmeters = result / 100
Lengthcentimetersmeters = result / 100
Areasquare centimetersm² = 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