bluelinklabs / ctzn

[DEPRECATED] An open social network built on the Hypercore Protocol data mesh.
https://ctzn.network
MIT License
286 stars 25 forks source link

Pubkey rotation mechanisms, threats, and use cases #49

Open ethanjli opened 3 years ago

ethanjli commented 3 years ago

This is such a cool project, and I'm really excited to see how this develops! The planned design for identity and re-homing is especially interesting to me.

As I understand it, the design document's mechanism for pubkey rotation is that a new database (I'll call it V2) appears and declares itself to be the successor of the previous database (I'll call it V1), and the DNS-ID authority corroborates this declaration, presumably at the request of the entity which had write access to V1. After the declaration and the corroboration, followers can trust V2.

We could also generalize this mechanism: instead of (or in addition to) using DNS records as corroboration, followers could require corroboration from other hypercores (which would be writable by other users or by other entities which can act as custodians). V1 could declare its trust in these other pubkeys ahead of time, and followers can trust V2 once some threshold number of V1's trusted custodians declares that V1 is succeeded by V2. Perhaps that threshold could also be specified by V1 ahead of time.

I'm really new to all of this so I've probably missed some important information, and I'd love to hear thoughts about any of this!

pfrazee commented 3 years ago

Thanks for the thoughtful writeup!

The weakness you're identifying is that the DNS-ID provider is a unilateral identity authority. The generalization is right; you need to apply some kind of "added authorities" model which confirm a change. This could be other cores that the user makes, or the cores of other users.

Users rarely take precautions so this is mostly a UX issue. Questions to explore are:

ethanjli commented 3 years ago

This framing makes a lot of sense to me!

Maybe another design parameter is how followers react to a DNS-ID change, and if adjusting that might reduce the need for advance planning and precautions. As a thought experiment, what if the policy of followers was to interpret the DNS-ID provider's announcement not as "V2 is now the successor, so I will update my records", but rather as "I now have a signal that V1's identity is in question, so I need to decide whether to perform additional verification, and how to update my records"?

For example, if a petnames system is used, immediate contacts of the person who moved to a new pubkey could confirm this out-of-band and update and publish their petnames for the old pubkey and the new pubkey. The DNS-ID and the self-proposed names for both pubkeys could also be shown as petnames under this scheme. I imagine this would make pubkey switchover be more gradual and partial, and the identity authority would be more diffuse and multilateral, and subject to individual and collective judgement. However, I haven't understood ctzn's design deeply enough to identify other implications of a petnames system, e.g. how it affects the relationships among databases, or whether it's even feasible. And probably there are other ways to provide signals for people deciding how to update their records.

ethanjli commented 3 years ago

tl;dr of incoming wall of text and rubber-ducking:

--

I thought a bit more about the properties of different schemes for specifying identity, for the use case where private keys live on third-party servers - which is probably the only really usable approach for the near future - and I think there's a centralized-to-distributed spectrum of approaches between the extremes explored in the comments above:

The Extremes

1: strong authority, one authority per database: this is the DNS-ID system currently described in design.md. The only way to respond to identity theft via a compromised server is to fork the identity and resolve the competing claims of identity socially (i.e. by talking to followers from the new account). And other servers all depend on the DNS-ID provider - so if I want to rehome from ctzn.one to ctzn.two, I'd need to make sure that anyone who posted a link to me or any post I made using https://ctznry.com/lietk12@ctzn.one, https://hikers.ctzn/lietk12@ctzn.one, etc., should update their link to use https://ctznry.com/lietk12@ctzn.two, https://hikers.ctzn/lietk12@ctzn.two, etc., and I'd need ctzn.one or ctznry.com, hikers.ctzn, etc., to prevent anyone else from re-registering as lietk12@ctzn.one and impersonating me.

2: strong authority, more authorities per database but only one authority in practice: a database self-declares the "added authorities" who confirm its identity, and followers use that list as their source of truth. But the server can always be made to change the database's list of authorities by a malicious actor. So this scheme has the same consequences if the server is compromised, at the cost of more complexity. (And even if the private key were on the client, there are the UX questions about assigning authorities)

3: very weak authorities, very many authorities shared very locally: every person is their own local identity authority - this is the petnames system. If an identity needs to be changed for whatever reason (a private key is destroyed or leaked, or a pubkey is rotated under normal circumstances), a person needs to notify the people around them who trust them, and then have those people announce this. Identities are always resolved socially, not just when there are competing claims. I think dealing with petnames would feel like a chore if we rely mainly on people to curate databases of petnames and build consensus all the time. This scheme may also have ethical concerns, e.g. if someone changes names, the petnames assigned to them could be used to deadname them, even if they create an entirely new profile.

An In-Between Approach

4: socially-determined strength & number of authorities, shared across servers (probably follows a power law-esque curve): every person chooses a set of subscriptions to indices of names (i.e. directories of people and communities) curated by various communities. This is a different take on the petnames system, with a more dynamic "interplay between [server] authority and individual authority" in naming databases than approaches 1 or 3, because it introduces the possibility of collectively moderating usernames and forking based on username registry:

I think this could be flexible and reasonably interesting and easy for users to get started with, while also formalizing a mechanism to socially resolve identity. It reminds me of Cabal's subjective moderation system, but with less granularity, and for naming rather than ignoring:

More In-Between Approaches

Comparing approaches, I think approach 1 is basically like approach 4 with the following constraints added:

  1. each server shares the same two name indices: the DNS IDs of the databases, and the index of display names. Both are just looked up from databases, rather than being stored on their own. All together, these are globally shared, singleton (distributed) indices.
  2. DNS-ID providers and servers with write access to databases together have unilateral power over the names users see.
  3. every person automatically trusts/subscribes to their server's name indices, and there's no unsubscription. So communities can't make+use their own name indices.
  4. a database can only associate itself with at most one DNS-ID name index and one display name index. No other names or name indices.

Approach 4 introduces complexity in the usability (e.g. if a user subscribes to 100 name indices, how do names get prioritized and displayed?), but it could support the village scale of interactions within better, e.g. a group of friends making a community and having their own fun nicknames just for each other. If we want to add even more flexibility/forkability/independence of name indices (e.g. users can make private name indices, or they can also make public name indices), that takes us closer to approach 3. Increasing constraints (e.g. only servers can make name indices) could streamline the user experience more vs. approach 4 but centralizes responsibility, e.g. onto servers. In any case, it looks like we can tune the dial by adding constraints or relaxing constraints on the administration of name indices.

ethanjli commented 3 years ago

During the CTZN livestream for April 21 around timestamp 05:33:40, @pfrazee shared his thoughts on identity authority in a discussion with @redsolver. Paul's apparently had this conversation many times and people keep bringing up the same things 😅. So, since there'll probably be more people in the future wanting the same discussion, here's my summary of what Paul said:

I basically agree with what Paul says, and I propose closing this issue as out of the scope of the core of CTZN, due to the plan for frontend customization. I think what I had missed in my comments above was that I thought of authority over profile names and authority over profile authenticity as the same problem (authority over "identity"), when they're actually different problems.