MatrixAI / Polykey

Polykey Core Library
https://polykey.com
GNU General Public License v3.0
29 stars 4 forks source link

Follow permission and social links during discovery #702

Open tegefaulkes opened 4 months ago

tegefaulkes commented 4 months ago

Specification

(copied from https://github.com/MatrixAI/Polykey/issues/692#issuecomment-2050944955)

Here is a general diagram of what a social network would look like.

Untitled-2024-01-23-1145 excalidraw

This is the kind of network we need to preform discovery on. The network is esentially made up of a graph, containing verticies made up of identities and polykey nodes, and edges forming links between them.

There are 3 tiers of edges.

  1. Cryptolinks, These are the most concrete form of a link. You can think of a gestalt as a fully formed distinct sub-graph made up of JUST cryptolinks. Cryptolinks are depicted as black arrow edges above. The circles grouping them are the gestalts.
  2. Trust and permission links, depicted as the blue arrows above. These are the main relationships between nodes. There are gestalt level permissions such as trusting that gestalt. And node-node level permissions such as sharing a vault. These edges form a relationship between gestalts such that we want to know more about them since we're directly interacting with them.
  3. There are weak relationships between identities. Depending on the kind of identity they could be friends, followers, part of the same group, whatever. It just implies a social relation between two identities. These exist outside of the Polykey ecosystem and don't really affect the interaction within Polykey. But it's useful to know about for inviting friends into the polykey ecosystem, for finding friends already using polykey.

Currently Polykey discovery only operates on the first tier of edges. So only whole gestalts are discovered and the user needs to manually trigger discovery on each gestalt to discover them.

To address task 4 in the above issue description, Quality of life and streamline features such as automatic friend discovery for identities we need to make some upgrades to the discovery system. We need the ability to do the following

  1. Follow permission links between gestalts to discover them in the background. We only really need to follow our own permissions.
  2. Allow the ability to trust or set permissions between gestalts or nodes without having to discover them first.
  3. Trusting or sharing should trigger background discovery.
  4. Starting up Polykey should trigger initial discovery on our own node moving outwards.
  5. We should check social level (tier 3) edges to enable the following.
    1. Compile a list of friends/followers to invite to use Polykey.
    2. Find friend/followers that already use Polykey.
  6. We'd need to have a priority system for processing tier 2-3 edges. Social edges alone could crowd out all other forms of discovery and grind useful discovery to a halt.

The first 2 tiers of links can be fully explored. But to limit the exploration space during discovery we only want to explore first order social links. That is, only the people we follow and their tier 1 links. That makes the full exploration space to be our gestalt, gestalts of anyone with permissions and the full gestalts of people we follow.

Additional context

Related: https://github.com/MatrixAI/Polykey/issues/692#issuecomment-2050944955

Tasks

  1. Identities have an optional implementation for listing all friends or social links. THis would be an generator that yields each link with associated metadata such as PK claims, usernames, possible emails etc etc.
  2. Need an generator for listing out all trust links and an generator for all permission links
  3. Implement the ability to trust and share without discovering a node or identity first.
  4. Discovery should be seeded by known claims, social links, trust and permissions. It should be seeded when an agent starts.
  5. We need to categorise each type of link into a priority level and preferentially process them. The tasks domain allows priority but this is a global level.
linear[bot] commented 4 months ago

ENG-298 Follow permission and social links during discovery

CMCDragonkai commented 2 weeks ago

736 although is closed, I don't think our focus has entirely shifted from this. This is still a necessary, but I'll expand more on this on review of R&D 2023 - 2024.