Private, non-shared data in repo? #3363
Replies: 8 comments 16 replies
|
I think this could work. You'd still want to CBOR-ify it (since CIDs are integral to various APIs, and the data model in general), but you could skip MST updates and the firehose broadcast. You'd need to make sure the records can only be fetched by the currently-authed user (from their own repo). |
|
I've been thinking about this some more, and I have a similar but modified idea. Rather than using special NSIDs, I propose using a special "private DID" prefix. This could be something like ( This addresses two issues:
The only downside I can think of is that you couldn't use applyWrites to write public and private records in the same transaction. |
|
To hint at the direction we are thinking for folding this in to the protocol proper:
We aren't fully committed to that overall architecture, but that is the general idea of what we are thinking. |
|
@CanRau drafts are a good use-case and example! I think they would work fine in this setup, as long as the draft isn't "the same entity" as the final post. For example, if you shared a draft with a couple friends, and they commented, those comments would not come along to the final post. The final post would have a different URI/URL from the draft, as another example. It is your last example, going from public to private that would not really work. You could of course copy the content to a new private version of the post, but it wouldn't be the same as the public one. @MikeBeas migration would work by pulling a copy and uploading to the new PDS. David covers the case which you mention: best practice would be to keep independent backups. Optimistically, that sort of backup will get automated, either by client apps or folks configuring a backup service that holds on to everything for them. In the long run, we see PDS hosting as fairly commodity/utility. Something you might pay a small amount for, or get as part of a package of digital hosting. In that case interests would be aligned and the provider is less likely to pull the rug. If the provider isn't an app/network/brand, they don't have as much of a network effect to exploit. Note that today Bluesky PBC, specifically, is both an app/brand and a PDS hosting provider. Bookmarks would definitely fit in as personal data. |
|
For now, could a workaround be implemented with preferences (app.bsky.actor.getPreferences)? I'm not familiar but it appears to be private synced data (or is that stored in the appview and not the pds?) |
In the case of a rogue PDS, this would be devastating. This feels a little disappointing to read, in essence giving the providers full access to your private data. |
|
@whyrusleeping wants me to make a proposal based on Peergos. So here goes. You could use the Peergos design as is by just switching Bluesky dids for our dids. I'll try and give a high level overview of this here. You PDS would have a private blockstore which is for access controlled blocks. The blocks in this store form distinct writing spaces. Each writing space is a champ (compressed hash array mapped prefix trie - the unordered sister structure of MSTs) with values that are dag-cbor encoded cryptree nodes (the encrypted metadata of the file/dir). The cryptree nodes have merkle links to the raw ciphertext of the file (raw nodes in dag-cbor as they are leaf nodes). The key pair for each writing space signs the root for that space (actually the root, prev root and a counter so the server can enforce CAS updates). To read a file you need a read capability which is (owner did, writer public key, champ label, block access token or bat, symmetric read key). So to get a file you ask the server for the encrypted metadata - server.get(writer, champ label, bat). Then decrypt the result with the read key. The champ labels, bats and read keys are all 32 random bytes. The server checks the bat (which is stored in the block itself) before returning a block or a champ lookup. So bats are basically bearer tokens for blocks. This gives you an E2EE filesystem, with fine grained access control. You can grant read or write access to individual files or entire subtrees with a single capability. Metadata is protected from the PDS, including filenames, file sizes, the directory topology, whether or how many people have access to something. These blocks obviously aren't published to any relays, but are retrieved directly from the owner's PDS. To share access you need to share a capability, which can be done using any secure channel like the proposed MLS group chats. Revoking access means rotating the keys and re-sharing a capability with those you want to keep access. Files are also chunked and padded so each chunk ends up a different champ mapping. You can choose the chunk size, but 5 MiB works well for streaming videos in the browser. To see more details of cryptree see: https://book.peergos.org/security/cryptree.html |
|
Hey all, I made the choice to use the PDS as a message store for the MLS messages, but that's likely not ideal, these messages aren't meant to be around forever, so likely a different delivery mechanism would be much preferable. Potentially bluesky could just use the existing messaging system to send and receive MLS messages. The important part is that your content remains on your PDS and in the case of an "adversarial exit" you could easily retain all of your posts and the group state would remain on your client. In this implementation most of the metadata for your posts is public in the PDS, but there is no reason it would have to be. The whole post and all it's metadata could be fully encrypted. The firehose could just use the follower graph to distribute the encrypted posts to their followers. |
Uh oh!
There was an error while loading. Please reload this page.
I have a use-case for keeping private data in a repo, i.e. data that does not leave the repo via the standard sharing mechanisms, and before I leap into modifying the code to support it, I'd like to get some feedback (or at least reasons why this would not be a "good idea.") While I know I can run a side-car service to support this, I'd very much like to leverage existing atproto tools/tech.
My strategy is that, for data with any NSID in the form
local.*(per RFC6762) or perhapslocalhost.*(per RFC2606), disable update event generation and contribution to CBOR packaging.A possible enhancement would be to enable storage of such "private" data to other data-stores via a startup feature flag and adding support for CRUD operations via custom interfaces to external storage.
Ok all, rip me to shreds, please. ;)
Thanks.
All reactions