Regarding storage, you’re spot on. If you and I share state in an app, then what happens is I write my data to my (publicly-routable) preferred storage providers, and you read from them. Similarly, if you want to share something with me in an app, you write to your preferred storage providers, and I read from them. However, I don’t write to your storage, and you don’t write to my storage. Instead, the app itself would mash up both our data to give us the same view.
For example, if we were using a shared calendar app in Blockstack, my calendar items would live in my storage and your calendar items would live in your storage. When I load the page, Blockstack would load both my items and your items and render them together. The app would find your storage providers through the Atlas network, and would find your public key (to authenticate your data) from BNS using your name.
Regarding polling, this is something we’re working on. Just like how we can each have our preferred storage providers, we can also have our preferred “multicast message channels” (e.g. an IRC channel, a ZMQ instance, a Comet endpoint, a phone number for MMS, and so on). If you’re using an app that gives notifications, then when I’m using the app, I’ll receive your notifications by subscribing to your preferred multicast message channels (the endpoints will be discovered through Atlas, just like the preferred storage providers are).
In the calendar example, if you updated a calendar entry while I was viewing the page, your browser would use blockstack.js
to find my preferred messaging channel and relay a (signed) notification to my browser. The calendar app page running in my browser would receive and handle the message in some calendar-specific way (e.g. show a pop-up, update the calendar view, etc.).
This all happens under the hood, of course . Blockstack Core has drivers for storage providers to give them all the same API, kind of like how your OS has drivers for various hard drives. This API is available through blockstack.js
, which gives Blockstack Web apps a filesystem-like interface for reading, writing, and searching for files. Similarly, we’ll have drivers for multicast message channels that make them all look like Web sockets (or something like them) to Blockstack Web apps. At the end of the day, you can pick your preferred storage and messaging services, and Blockstack Web apps will be able to use them via blockstack.js
without having to care about the implementation.