Blockstore client API write-up

@jude recently submitted an issue on GitHub to start a discussion about the blockstore client API. If you’re interested in joining the conversation, feel free to jump in and share your thoughts:

1 Like

They’re both pre-defined servers yet the location can change? What’s the difference? Is location the path? How are servers pre-defined?

Hi Larry,

The location(s) cannot change. At least, without putting a new route and putting its signature into the blockchain. But, the data can change, and can do so while at the same time preventing the storage systems hosting it from convincingly lying to other readers about the mutable data your wrote (the worst it can do is deny service, or continue to serve everyone stale data you wrote; both failure modes are easily detected).

A location is a storage-defined URI. For example, a piece of data may be available via FTP, via BitTorrent, and via IPFS, in which case, there will be an FTP URL, a BitTorrent magnet link, and an IPFS Merkle root. As long as the data’s author will keep all of the replicas up-to-date with changes, then a prospective reader can use any of these storage systems to fetch it.

As hinted by the API listing, blockstack will support plugins to interface with different storage systems. When you install blockstack, you can hook it into whatever storage system(s) you want via their storage-specific plugins. The plugin itself will generate and parse the URI, not the application–all the application needs to do is call into this higher-level API.

For example, the reference implementation I’m working on uses a Kademlia DHT for hosting both immutable and mutable data. The DHT’s plugin might generate a route to mutable data that looks like:

{
  "id": "foo",
  "urls": [
      "dht:0123456789abcdef"
   ]
}

The URI dht:0123456789abcdef is interpreted by the DHT plugin. The hash of the above JSON doc is written to the blockchain and signed with my private key. The application can get fresh data with get_mutable("foo"), and can get the data and verify that I wrote it with get_mutable("foo", name="judecn").

Does that answer your questions?

Yes it does. Thank you! I like how you called “blockstore”, “blockstack” in your explanation :smiley: I wonder how often we will make that mistake. :wink: