Skip to main content

LogLeaf

Struct LogLeaf 

Source
pub struct LogLeaf {
    pub leaf_version: String,
    pub ctx_id: CtxId,
    pub lineage_id: LineageId,
    pub origin_registry: String,
    pub created_at: DateTime<Utc>,
    pub content_hash: ContentHash,
    pub key_fingerprint: String,
    pub receipt_hash: String,
}
Expand description

One transparency-log leaf: the closed object binding one accepted publish event (RFC-ACDP-0012 §4).

CLOSED schema (acdp-log-leaf.schema.json, additionalProperties: false): the leaf bytes are hashed into the tree, so an unknown member would change the leaf hash; extensions require a leaf_version bump. Every field other than receipt_hash deliberately duplicates receipt fields so a verifier holding the body and its verified receipt can reconstruct the leaf byte-for-byte with no additional trust in the registry (§9.1 step 1).

Fields§

§leaf_version: String

MUST be exactly LOG_LEAF_VERSION ("acdp-log-leaf/1").

§ctx_id: CtxId

The registry-assigned context identifier (RFC-ACDP-0001 §5.5). Exactly one leaf per ctx_id — bodies are immutable, so a publish event happens once.

§lineage_id: LineageId

The registry-derived lineage identifier (RFC-ACDP-0001 §5.6).

§origin_registry: String

The registry-assigned origin authority (bare DNS hostname). MUST equal the ctx_id authority and the log’s registry DID authority.

§created_at: DateTime<Utc>

The registry-assigned creation timestamp — byte-identical to body.created_at and registry_receipt.created_at; canonical millisecond-precision RFC 3339 UTC, always serialized with exactly three fractional digits.

§content_hash: ContentHash

The body’s content_hash as verified at publish time.

§key_fingerprint: String

The RFC-ACDP-0010 §6 fingerprint of the producer key resolved at publish time. MUST equal registry_receipt.key_fingerprint.

§receipt_hash: String

The RFC-ACDP-0010 §2 receipt hash of this context’s registry receipt (over the receipt preimage, i.e. minus signature) — binding the signed receipt statement while remaining stable across the sanctioned post-compromise re-mint (RFC-ACDP-0012 §4).

Implementations§

Source§

impl LogLeaf

Source

pub fn from_value(value: &Value) -> Result<Self, AcdpError>

Parse a leaf from wire JSON, enforcing the closed schema, the exact leaf_version, and the canonical millisecond byte form of the RAW created_at (checked before parsing normalization).

Source

pub fn canonical_bytes(&self) -> Result<Vec<u8>, AcdpError>

The leaf encoding — the exact bytes that are hashed: the JCS canonicalization (RFC 8785) of the leaf object, UTF-8. There is no exclusion set: every member is part of the leaf bytes (RFC-ACDP-0012 §4).

Source

pub fn leaf_hash(&self) -> Result<[u8; 32], AcdpError>

SHA-256(0x00 ‖ JCS(leaf)) — the §5.1 leaf hash, raw digest.

Source

pub fn leaf_hash_hex(&self) -> Result<String, AcdpError>

The §5.1 leaf hash in wire form ("sha256:<hex>").

Trait Implementations§

Source§

impl Clone for LogLeaf

Source§

fn clone(&self) -> LogLeaf

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LogLeaf

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for LogLeaf

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for LogLeaf

Source§

impl PartialEq for LogLeaf

Source§

fn eq(&self, other: &LogLeaf) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for LogLeaf

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for LogLeaf

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.