ssbc / ssb-tribes2

SSB private groups with ssb-db2
8 stars 1 forks source link

Test getting added to the group after the first epoch, but still getting access to all the epochs #76

Closed Powersource closed 1 year ago

Powersource commented 1 year ago

Gonna have to add the old key to add-member or the epoch init for this i think

Powersource commented 1 year ago

Relevant discussion in https://github.com/ssbc/private-group-spec/issues/16

Powersource commented 1 year ago

should do this simpler case first https://github.com/ssbc/ssb-tribes2/issues/86

Powersource commented 1 year ago

discussing this with @mixmix tomorrow

Powersource commented 1 year ago

We came up with a pretty good solution (option 4). Here's the full meeting notes:


Adding people later than the first epoch but still giving them access to the older epochs

Problem

I add Zach to a group, and there have been multiple epochs. They need to know about them all and be able to decrypt

Requirements

  1. minimise messages
  2. minimise complexity
  3. still be able to audit "who has which keys"

Solutions

1. Add the person with 1 add-member message per epoch

  1. NO LOTS of messages
  2. YES
  3. YES

NOOOO: if we publish a group/add-member in epoch zero to add arj, then anyone who was excluded would be receiving new info about who was being added to the group

2. One add-member but the user can recursively discover everything

Only add the person to the latest epoch. But every epoch init should contain the secrets of its previous epochs. This way the new user could iterate backwards to unlock all the epochs.

  1. Yes, only 1 new. Only extra data in epoch inits
  2. Maybe more complicated to look up memberships for old epochs
  3. The new user will in theory have access to all the secrets, they're gonna have to look around for them a bit more though

Problem:

              A(mix,jacob,staltz,oscar)
                  |                | 
              mix drops Oscar     jacob drops Oscar 
                 |                |
        B(mix,jacob,staltz)     C(mix,jacob,staltz)

              A(mix,jacob,staltz,oscar,arj)
                  |                | 
              mix drops Oscar     jacob drops Oscar 
                 |                |
        B(mix,jacob,staltz)     C(mix,jacob,staltz)

3. Invite has EVERYTHING

{
  type: 'group/add-member'
  root: MsgId,
  creator: FeedId,
  secrets: [Secret, ........],
  tangles: {
    group: { root, previous },
    members: { root, previous }
  },
  recps: [GroupId, FeedId]
}
How do I find out if e.g. jacob has all the keys needed?

lookup group/add-member messages for the groupId filter the ones that have FeedId === 'jacob' in the the recps collect all the secrets, map them to epochIds... compare that with the list of all known epochs

4. Invite has EVERYTHING (for it's causal predecesors)

if there are two forks (two tips in the epoch tangle), then there would be two additions.

This means if you look at an epoch, it is enough to look in that epochs' members tangle.

If the history has forked, then merged, then there will only be one tip with one massive causal history of predecessors

This packs lots of data into parcels AND preserve the simplicity of the members tangle!

Question:

BONUS!: