I've got a long highlighter post coming about this reworked for the Nostr context, but this is a similar system I had designed and worked on for a different context: the urbit peer-to-peer-peer network: https://gist.github.com/vcavallo/e008ed60968e9b5c08a9650c712f63bd