Skip to main content
Research preview — APIs may change. GitHub

Compute

The Compute endpoint runs geospatial operations on location data inside the TEE and returns signed results. It answers spatial questions — how far apart are these locations? is this point inside that boundary? — with cryptographically verifiable answers.

Accepted Inputs

The compute endpoint accepts location data at any level of the verifiability spectrum:
Input typeWhat it isTrust properties
Raw GeoJSONUnsigned geometryProves computation was correct; does not prove input provenance
Signed location recordEAS attestation UID (onchain) or UID + URI (offchain)Attribution + integrity + correct computation
Verified location proofUID of a verified location proofEvidence of physical correspondence + correct computation
You can mix input types in a single operation. A geofencing check might use raw GeoJSON for the boundary (a publicly known polygon) and a verified location proof for the user’s position.

Inside the TEE

The compute engine is PostGIS backed by GEOS — the same C++ library that powers QGIS, GDAL, and most professional geospatial software. PostGIS runs inside the Docker container within the TEE, not as an external service. Computation is stateless and deterministic. Each request brings all required inputs. Results are rounded to centimeter precision before signing to ensure reproducibility. Same inputs always produce the same output.

Available Operations

Measurements (Numeric Results)

OperationWhat it computesUnitPostGIS function
DistanceNearest distance between two geometriesmetersST_Distance
AreaArea of a polygonsquare metersST_Area
LengthLength of a linemetersST_Length

Predicates (Boolean Results)

OperationWhat it checksPostGIS function
ContainsIs geometry B entirely inside geometry A?ST_Contains
WithinIs geometry within a specified radius of target?ST_DWithin
IntersectsDo geometries share any space?ST_Intersects
All measurements use metric units. No unit conversion is provided — convert client-side if needed.

Precision and Determinism

Results are stored with centimeter precision as scaled integers:
TypePrecisionScaling
Distance / Length0.01 m523.45 meters → stored as 52345
Area0.0001 m²1234.5678 m² → stored as 12345678
This scaling ensures deterministic integer representation, which is important for smart contract integration where floating-point arithmetic isn’t available.

Output

Every compute operation returns a signed result containing:
  • The computed answer (boolean or numeric)
  • References to the specific inputs used
  • A timestamp
  • The operation name
  • A cryptographic signature from the TEE-held signing key
The signed result can be used offchain (in an agent, application, or database) or submitted onchain via EAS delegated attestation. EAS resolvers allow those attestations to trigger smart contract logic.

What’s Next

The current operation set covers the most common spatial questions, but PostGIS exposes a much larger surface. Areas we’re exploring:
  • More predicates and measurementsdisjoint, touches, crosses, nearest-neighbor queries
  • Geometry transformations — buffers, centroids, unions, intersections. These return new geometries rather than scalar or boolean values, which raises open design questions about signed result format and storage
  • Spatial selection queries — operations over sets of geometries, like “which of these polygons contains this point?” or “find all zones within 1km of this location”
  • Compositional queries — chaining multiple operations into a single verified request, so you could express something like “is this point within 500m of any geometry in this set that intersects this boundary?” without multiple round trips
The operation set is extensible. If you need a spatial operation that isn’t listed here, open an issue.

Next: Signed results

Output formats and how to use them

See also: