Interactive playground for exploring verifiable geospatial computations with Astral Protocol.
Astral Playground lets you experiment with geospatial operations and publish the results as on-chain attestations via EAS (Ethereum Attestation Service).
Features:
- Interactive map with draggable markers and polygon/line drawing
- Real-time preview using Turf.js
- Verified results computed via PostGIS in a Trusted Execution Environment
- Publish attestations to Ethereum, Base, Sepolia, or Base Sepolia
- SDK and cURL code snippets for integration
| Operation | Description | Input |
|---|---|---|
| Distance | Distance between two points | 2 points |
| Within | Is point A within radius of point B? | 2 points + radius |
| Contains | Does polygon contain point? | polygon + point |
| Intersects | Do geometries overlap? | 2 geometries |
| Area | Area of a polygon | polygon |
| Length | Length of a line | linestring |
- Node.js 18+
- Mapbox access token
npm installCopy the example environment file and add your Mapbox token:
cp .env.example .envEdit .env:
VITE_MAPBOX_TOKEN=pk.your_mapbox_public_token
VITE_API_URL=https://api.astral.global
npm run devnpm run build- Select an operation from the dropdown
- Drag markers or draw polygons on the map
- See real-time preview results (Turf.js approximation)
- Click "Get Verified Result" for precise PostGIS computation
- Switch to "Policy Builder" tab
- Connect your wallet
- Select target chain and schema UID
- Compute verified result
- Publish attestation on-chain
- React 19 + TypeScript
- Vite
- Mapbox GL + react-map-gl
- Turf.js for client-side geospatial operations
- wagmi + RainbowKit for wallet connection
- viem for Ethereum interactions
- Astral Protocol - Verifiable location infrastructure
- Astral API Docs - API reference
- EAS - Ethereum Attestation Service
MIT