CosmWasm Anchored Spatial Data Registry
Last updated
Was this helpful?
Last updated
Was this helpful?
With geodata-anchor (Junø/CosmWasm contract) and geodata-rest (HTTP REST Server) we address the feasibility of providing performant and scalable access to geospatial data in geojson format, leveraging MongoDB’s geospatial data and queries. When a data item is ingested into the database, a hash of the relevant data is generated and stored on a CosmWasm contract which implements a cw-storage-plus indexed datastore. Validation results are stored on both the database and the contract. Validators would each run a MongoDB Atlas replica instance, with an independent compute instance performing the same hashing algorithm.
Fully written in Rust, using axum and cosmos-rust.
Role-based access to rest endpoints: admin role creates data items, validator role validates, and user role can query.
Polymorphic (polygon, point, line, etc.) geospatial data geometries within a single 2dsphere index.
Validation compute currently occurs via a REST endpoint based on userid/role and is not yet tied to a validator’s specific replica instance.
Integration tests for both geodata-anchor and geodata-rest run against a local instance of Junø via Docker; we have not yet deployed to a testnet.
Evolve hashing strategies via multi-hash.
Larger datasets could leverage MongoDB sharding features.
Reverse anchor hash from contract to database.
Move most data onchain, queried directly via secondary indexes, with links to IPFS, Arweave or MongoDB Atlas for large objects.
3D geospatial index design and implementation with cw-storage-plus secondary indexes.
Mostly beyond the scope of this PoC, but with interchain accounts and the Gravity Bridge on Cosmos, many possibilities exist for application-specific blockchains.
Thank you to dClimate for funding this PoC and providing valuable technical direction.