pub struct Entry {
pub hash: Hash,
pub payload: GraphOp,
pub next: Vec<Hash>,
pub refs: Vec<Hash>,
pub clock: LamportClock,
pub author: String,
pub signature: Option<Vec<u8>>,
}Expand description
A single entry in the Merkle-DAG operation log.
Each entry is content-addressed: hash = BLAKE3(msgpack(signable_content)).
The hash covers the payload, causal links, and clock — NOT the hash itself.
Fields§
§hash: HashBLAKE3 hash of the signable content (payload + next + refs + clock + author)
payload: GraphOpThe graph mutation (or genesis ontology definition)
next: Vec<Hash>Causal predecessors — hashes of the DAG heads at time of write
refs: Vec<Hash>Reserved. Currently unused (always empty). Part of the hash computation for wire format stability. May be used for skip-list traversal in future versions.
clock: LamportClockLamport clock at time of creation
Author instance identifier
signature: Option<Vec<u8>>D-027: ed25519 signature over the hash bytes (64 bytes). None for unsigned (pre-v0.3) entries.
Implementations§
Source§impl Entry
impl Entry
Sourcepub fn new(
payload: GraphOp,
next: Vec<Hash>,
refs: Vec<Hash>,
clock: LamportClock,
author: impl Into<String>,
) -> Self
pub fn new( payload: GraphOp, next: Vec<Hash>, refs: Vec<Hash>, clock: LamportClock, author: impl Into<String>, ) -> Self
Create a new unsigned entry with computed BLAKE3 hash.
Sourcepub fn verify_hash(&self) -> bool
pub fn verify_hash(&self) -> bool
Verify that the stored hash matches the content.
Sourcepub fn to_bytes(&self) -> Vec<u8> ⓘ
pub fn to_bytes(&self) -> Vec<u8> ⓘ
Serialize the entry to MessagePack bytes.
Uses expect() because msgpack serialization of #[derive(Serialize)] structs
with known types cannot fail in practice. Converting to Result would add API
complexity for a failure mode that doesn’t exist.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
Deserialize an entry from MessagePack bytes.