ssbc / ssb2-discussion-forum

not quite tiny, also not quite large
17 stars 1 forks source link

Partial replication and verification without private messages #15

Closed KyleMaas closed 1 year ago

KyleMaas commented 1 year ago

Just want to start with saying I am loving what this is meant to accomplish. It eases a lot of the onboarding friction with the SSBv1 system and is an enormous improvement for ease of use.

My question is this: would this make it possible to do partial replication of only public posts and still be able to verify them? My use case is connecting Minibutt-compatible SSB clients together over ham radio, where encryption is not allowed but cryptographic signatures are generally considered to be okay. This is something I've wanted to try doing for a long time, but with SSBv1, the first time a feed has a private message it messes up verification for the entirety of the rest of the feed without significant hacks, so it's never been something I've been comfortable with publishing code for since it's so far outside of the spec.

From the way this looks, this one could work but only if previous contained a record of a previous unencrypted message. Or if you did a partial replication from another node which could receive encrypted messages and had already verified the chain. Does that sound about right?

staltz commented 1 year ago

Just want to start with saying I am loving what this is meant to accomplish. It eases a lot of the onboarding friction with the SSBv1 system and is an enormous improvement for ease of use.

Thanks <3

would this make it possible to do partial replication of only public posts [...] ?

Basic answer is yes. Complex answer is that it depends on how each peer publishes messages. We can't forbid that a peer will publish an encrypted message on a feed (that is "supposed" to not have encrypted message), so there is no guarantee. But the basic design is that each peer will have multiple feeds, one for each message type, for instance:

Etc. However all these feeds will have the same cryptographic keypair, so they're all going to have the same "hash" ID, they're just going to include the message type in the feed ID to differentiate.

KyleMaas commented 1 year ago

Excellent. How does verification work for each of these feeds? Is the intent that each new message of a particular type (say, public posts) must reference a previous message of the same type (public post) within its previous?

arj03 commented 1 year ago

@KyleMaas exactly :)

KyleMaas commented 1 year ago

Awesome. Excited to see this implemented. Thanks!