Plugins
The Astral SDK provides an extensible plugin system for integrating proof-of-location systems. Plugins implement a standard interface and are registered with the SDK at startup. TheStampsModule and ProofsModule then orchestrate across registered plugins.
LocationProofPlugin interface
Every plugin implements this interface. All methods are optional — plugins implement what makes sense for their environment and data source.Method responsibilities
| Method | Purpose | When to implement |
|---|---|---|
collect() | Gather raw signals from sensors/APIs | Plugin can actively collect evidence |
create() | Parse signals into an unsigned stamp | Plugin produces structured location data |
sign() | Add cryptographic signature to stamp | Plugin has its own signing mechanism |
verify() | Check stamp internal validity | Plugin can verify its own stamps |
Runtime type
PluginRegistry API
register()
Register a plugin with the SDK. Validates runtime compatibility and throws if the current environment is not supported.get()
Get a plugin by name. Throws if not found.has()
Check if a plugin is registered.list()
List metadata for all registered plugins.all()
Get all registered plugin instances.withMethod()
Find plugins that implement a specific method.Properties
Plugin status
| Plugin | Package | Status | collect | create | sign | verify |
|---|---|---|---|---|---|---|
| Mock | Built into SDK | Complete | Yes | Yes | Yes | Yes |
| ProofMode | @location-proofs/plugin-proofmode | Alpha | Coming soon | Yes | — | Yes |
| WitnessChain | @location-proofs/plugin-witnesschain | In development | Coming soon | Coming soon | Coming soon | Coming soon |
Plugin details
See the Plugins section for detailed documentation on each plugin.
MockPlugin
Built into the SDK for testing and development. Runs in all environments.How to write a custom plugin
Implement theLocationProofPlugin interface with whichever methods your system supports, then register with astral.plugins.register(). See Building a custom plugin for the complete guide with examples and testing patterns.
Next: Compute module
Geospatial computation methods