-
Notifications
You must be signed in to change notification settings - Fork 5
Canonicalise node ID representation #261
Copy link
Copy link
Closed
Labels
designRequires designRequires designdevelopmentStandard developmentStandard developmentdiscussionRequires discussionRequires discussionepicBig issue with multiple subissuesBig issue with multiple subissuesr&d:polykey:core activity 3Peer to Peer Federated HierarchyPeer to Peer Federated Hierarchy
Metadata
Metadata
Assignees
Labels
designRequires designRequires designdevelopmentStandard developmentStandard developmentdiscussionRequires discussionRequires discussionepicBig issue with multiple subissuesBig issue with multiple subissuesr&d:polykey:core activity 3Peer to Peer Federated HierarchyPeer to Peer Federated Hierarchy
Specification
We'd like to canonicalise the representation of a keynode's node ID.
Recall that the node ID of a node is based on the public key of a keynode: it is a public key fingerprint. At the moment, we produce a SHA-256 hash of the public key, resulting in an array of 32 bytes. This array of bytes can be currently seen as the primitive canonicalised representation of the node ID.
The representation needs to provide:
Previously, we were using
base64as the encoding choice for a human-readable version of the node ID. This produced fixed-size node IDs of 44 characters, but used unsafe characters (e.g./,+).After that, we were then looking at
base58btc. This has the advantage of no longer producing URL-unsafe characters, as well as some quality-of-life improvements by not including visually-similar characters. However, it can produce different sized node IDs. See below:Details
As a temporary solution, we've adopted a
base32hexencoding, producing a fixed fixed 53 character node ID, such asv6n7m9vuf44pfqq133re8v91ju7a8968h4nkirjt8r7r9pbcoqqq0(with a prependedvcharacter frommultibase): https://gitlab.com/MatrixAI/Engineering/Polykey/js-polykey/-/merge_requests/205#note_711237922Additional context
NodeIdas a proxy/singleton instance #254 - will need to look at this issue concurrentlybase58andbase58btcTasks
NodeGraph(kademlia), across GRPC, etc)