Skip to main content

radicle_core/
node.rs

1//! A Radicle node on the network is identified by its [`NodeId`], which in turn
2//! is a Ed25519 public key.
3//!
4//! The human-readable format is a multibase-encoded format of the underlying Ed25519 public key, i.e.
5//! ```text
6//! MULTIBASE(base58-btc, MULTICODEC(public-key-type, raw-public-key-bytes))
7//! ```
8//! which results in strings that look like:
9//! ```text
10//! z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
11//! ```
12
13use radicle_crypto::PublicKey;
14
15/// Public identifier of a node device in the network.
16///
17/// # Legacy
18///
19/// This is a type alias, providing little protection around evolving a [`NodeId`]
20/// and having it very tightly coupled with a [`PublicKey`].
21///
22/// Future iterations will change this to provide a better API for working with
23/// [`NodeId`]'s and their usage in the protocol.
24pub type NodeId = PublicKey;