How does blockstack index data?


#1

For example, I want to find/buy an ebook by its name on blockstack. How does blcokstack find Gaia hubs with this ebook?


#2

Broadly speaking, Blockstack maintains two kinds of data: its on-chain and chain-anchored name state, and application data hosted off-chain.

Your application data is stored via your Gaia hub, which in turn writes it to whatever backend storage provider you choose to host it. Within your Gaia hub, your data is stored in per-app buckets, where each bucket implements a key/value store accessible in blockstack.js via getFile() and putFile(). For example, all your documents in Graphite are stored in Gaia.

Name-related data – including name/ownership bindings for application assets – is stored either directly on the Bitcoin blockchain, or indirectly via the Atlas peer network. For example, Blockusign stores document signatures in Atlas in order to non-repudiably show that a document was signed by a particular set of keys at a particular date.

Depending on what information you’re trying to store and what relationships you’re trying to encode, you’d store data either in Atlas, Gaia, or a combination. For example, you could store the ebook data encrypted in Gaia (since it’s big), but store its hash and current owner in Atlas, anchored to an on-chain name. Then, the individual who owns the ebook’s name also “owns” the ebook. You could “sell” the ebook by transferring the name to the new owner in exchange for a fee, and you could also re-encrypt the ebook so only they could decrypt it once they own the name.


#3

Thank you for your answer, and I am sorry that my question is not fully
expressed by my words. In fact, instead of who owns the ownership of this ebook, I want to know how blockstack indexes data. For example, in this case, I want to find an e-book on the blockstack. I only know its name. How does blockstack find the Gaias by the name of ebook?


#4

You would need to build a crawler that scanned through the public data in each user’s applications and build up a reverse index. This is not something Blockstack does by itself.