Compute Module
TheComputeModule provides verifiable geospatial operations that run in a trusted execution environment. Each operation returns a signed delegated attestation that can be submitted to EAS.
Input Types
All compute methods accept flexible input types:Examples
Raw GeoJSON is not verified for authenticity. The
inputRefs will contain a keccak256 hash of the geometry rather than a UID.Compute Options
All methods require options:Schema Requirements
Numeric Operations
distance()
Calculate the geodesic distance between two geometries.Example
area()
Calculate the area of a polygon.Example
length()
Calculate the length of a LineString.Example
Boolean Operations
contains()
Check if a container geometry contains another geometry.Example
within()
Check if a geometry is within a specified radius of a target.Example
intersects()
Check if two geometries intersect (overlap).Example
Submission Methods
submit()
Submit a delegated attestation to EAS. You pay gas; Astral remains the attester.Example
estimate()
Estimate gas for attestation submission.Example
health()
Check the compute service health status.Example
Return Types
NumericComputeResult
BooleanComputeResult
DelegatedAttestation
Complete Example
How Delegated Attestations Work
This pattern means:
- Astral does not need to pay gas for every computation
- Developers control when/whether to submit onchain
- Smart contracts can verify attestations came from Astral
Signature Expiry
Delegated attestation signatures have a deadline:Next: EAS Integration
Learn how the SDK integrates with EAS