Sharing Public Data App-to-App


#1

There have been discussions about the need to be able to share data between apps (even some encrypted data might need to be shared). However, as a start, being able to access public data across apps would be great.

Example: Graphite has a Contacts section. Within a contact card, it would be incredibly powerful for users to be able to see certain publicly exposed data from other apps. Perhaps one of your contacts is using the same messaging app on Blockstack or one of your contacts is using the same music app on Blockstack. Being able to discover this benefits app developers and users. It creates community around the social aspect and immerses users further into the Blockstack eco-system. But the data shared across apps would need to be more robust than that (I think). Right now, knowing what apps a user is currently using is easily exposed. But shareable data from within those apps will be key.

I believe @aaron may have an initial way to implement this, so I wanted to start the discussion!


#2

Thanks for starting this topic @jehunter5811!

The way that multi-reader storage is implemented could allow for reading information from another application somewhat directly, though the approach would involve a little bit of hacking, and it interacts with a component whose interface, while unlikely to change, is not yet fully specified.

Basically – when an application uses multi-player storage, it adds an entry to the user’s profile in the app array.

For example: If you look at @yukan.id, https://core.blockstack.org/v1/users/yukan.id , you’ll see these entries.

...
 "apps": {
        "http://app.graphitedocs.com": "https://gaia.blockstack.org/hub/143tnkzivRBSSvmyoW1wdMSnpdRzYFHuRW/", 
        "http://localhost:8080": "https://gaia.blockstack.org/hub/1DDUqfKtQgYNt722wuB4Z2fPC7aiNGQa5R/", 
        "http://publik.ykliao.com": "https://gaia.blockstack.org/hub/179isMHFbdMKFERKrAMUQhrbEynNR63vn2/", 
        "https://www.chat.hihermes.co": "https://gaia.blockstack.org/hub/1P9upXUxyNEAAPd3xVoLS5uJk1VRLYcKqZ/", 
        "https://www.stealthy.im": "https://gaia.blockstack.org/hub/1LbgBZcksXJugXSzSzszFX9KajkFrNBtNW/"
      }, 
...

You can find these entries using blockstack.js:

> let bsk = require('blockstack')
> let apps
> bsk.lookupProfile('yukan.id').then( profile => profile.apps ).then( console.log )

{ 'http://localhost:8080': 'https://gaia.blockstack.org/hub/1DDUqfKtQgYNt722wuB4Z2fPC7aiNGQa5R/',
  'http://publik.ykliao.com': 'https://gaia.blockstack.org/hub/179isMHFbdMKFERKrAMUQhrbEynNR63vn2/',
  'https://www.chat.hihermes.co': 'https://gaia.blockstack.org/hub/1P9upXUxyNEAAPd3xVoLS5uJk1VRLYcKqZ/',
  'http://app.graphitedocs.com': 'https://gaia.blockstack.org/hub/143tnkzivRBSSvmyoW1wdMSnpdRzYFHuRW/',
  'https://www.stealthy.im': 'https://gaia.blockstack.org/hub/1LbgBZcksXJugXSzSzszFX9KajkFrNBtNW/' }

Now – that can tell you what app the user has installed. In order to read data from the application (so long as the data is public, and therefore unencrypted) – you can:

let baseUrl = apps['https://www.stealthy.im']
let fileToRead = 'sharedInfo.json'
fetch(`${baseUrl}${fileToRead}`).then(console.log)

#3

Thanks, Aaron! This is really exciting. I can see app devs providing privacy settings in-app that would enable the sharing of specific pieces of data.

This seems like, at first glance, it would enable a public Medium-style blog clone. There’s need to be a personal backend that each user writes on and decides what can be shared. But on the public front-end (unless I’m missing something), blog posts could be displayed to unauthenticated users (which is key for blogs and magazines and such).

I hope this inspires some devs to get building, because I know I’m pretty excited about it!


#4

Are you going to be at the Berlin conference? I’m thinking there should be a hackathon session where we come up with a way to implement collections.

This was a concept that got backlogged in the development pipeline, but now that multireader storage is working, the apps field in the user’s profile could be extended to point to one or more cross-app data buckets that apps could request read or read/write access to. For example, there could be a generic Documents entry in the user’s profile’s apps object that Graphite could request read/write access to. Other apps could do likewise, and in doing so, share data without having to crawl a user’s app-specific data.

cc @larry @hologram @yukan.id


#5

I love this, and yes I’ll be at the conference. I won’t be there for the second day of the hackathon though because I fly out that day.

We’re talking about a ridiculously simple API-style integration to share data across apps, which is super exciting. Imagine being able to click a button and all your Dropbox Paper files are suddenly in Google Docs (except for pretend those services aren’t centralized). That’s what this would enable.

I could see this helping achieve something @cryptocracy and I were talking about today: Sharing read-only access across apps can help one app extend another. Basically, these would be public API endpoints. Like a spreadsheet in Graphite could be exposed (read-only) to a financial tracking app or a tax app, etc.

Excited to explore this more!


#6

Hey Justin!!

Thank you so much for starting this discussion… I believe this could be a bit of a silver bullet for Blockstack apps. An underlying data sharing protocol between apps would open the door to innovative ideas we can’t even imagine.

I think, for starters, that a super-simple process like @aaron described is going to be great for an initial version, but I would really love to see the shared data follow a more defined protocol. Getting there will take a bit more work. There are a lot of considerations there around who can read and write. For instance, can you overwrite data in a collection that was created on another app? In my mind, you SHOULD be able to do that since the user might want to modify a value on your app that they’ve set on another app. But we need to have well defined privileges in that case to avoid misuse.

This would be a great issue to address during the Berlin hackathon.