Documentation Index
Fetch the complete documentation index at: https://docs.astral.global/llms.txt
Use this file to discover all available pages before exploring further.
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).| Field | Type | Description |
|---|---|---|
geometry | bytes | Encoded GeoJSON geometry |
geometryType | string | ”Point”, “Polygon”, “LineString”, etc. |
srs | string | Spatial reference system (default: “EPSG:4326”) |
properties | bytes | JSON-encoded metadata |
Policy Attestation Schemas
Output schemas for geospatial computations.BooleanPolicyAttestation
For predicate operations (contains, within, intersects).
| Field | Type | Description |
|---|---|---|
result | bool | The boolean computation result |
inputRefs | bytes32[] | References to inputs (UIDs or hashes) |
timestamp | uint64 | Unix timestamp of computation |
operation | string | Operation with parameters (e.g., “within:500”, “contains”) |
NumericPolicyAttestation
For measurement operations (distance, length, area).
| Field | Type | Description |
|---|---|---|
result | uint256 | Scaled integer result (centimeters or cm²) |
units | string | Base unit (“meters” or “square_meters”) |
inputRefs | bytes32[] | References to inputs |
timestamp | uint64 | Unix timestamp of computation |
operation | string | Operation with parameters (e.g., “distance”, “area”) |
GeometryPolicyAttestation (Future)
For transformation operations (buffer, centroid, union).
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 | 0x4958625091a773dcfb37a1c33099a378f32a975a7fb61f33d53c4be7589898f5 | contains, within, intersects |
| NumericPolicyAttestation | Register your own | distance, length, area |
| Location | 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.
Input References
TheinputRefs array contains a bytes32 for each input:
| Input Type | Reference |
|---|---|
| Onchain attestation | The UID |
| Offchain attestation | The UID |
| Raw GeoJSON | keccak256(abi.encode(geojson)) |
Result Scaling
Numeric results are stored as scaled integers:| Measurement | Storage | Conversion |
|---|---|---|
| Distance | centimeters | meters = result / 100 |
| Length | centimeters | meters = result / 100 |
| Area | square centimeters | m² = result / 10000 |
Decoding in Solidity
Boolean Policy
Numeric Policy
Schema Registry
Schemas are registered in the EAS SchemaRegistry. When deploying your resolver:Next: Security
Security considerations