feat: Introduce Hybrid Logical Clocks in protobuf, update architecture documentation, and add HLC test cases.

This commit is contained in:
2025-12-20 14:29:03 +01:00
commit e1405bb910
20 changed files with 522 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
//! Node identity and cryptographic keys
use ed25519_dalek::{SigningKey, VerifyingKey};
use rand::rngs::OsRng;
/// A node in the Lattice mesh.
///
/// Each node has an Ed25519 keypair used for signing sigchain entries
/// and establishing trust within the network.
pub struct Node {
signing_key: SigningKey,
}
impl Node {
/// Generate a new node with a random keypair.
pub fn generate() -> Self {
let signing_key = SigningKey::generate(&mut OsRng);
Self { signing_key }
}
/// Get the node's public key (identity).
pub fn public_key(&self) -> VerifyingKey {
self.signing_key.verifying_key()
}
/// Get the signing key for creating signatures.
pub fn signing_key(&self) -> &SigningKey {
&self.signing_key
}
}