Crate ubl_ledger

Crate ubl_ledger 

Source
Expand description

UBL — Universal Business Ledger (NDJSON)

This crate provides:

  • Canonical bytes: all intents serialized via json_atomic::canonize
  • Stable CID: Cid32 = BLAKE3(canonical_bytes)
  • Optional signing: domain UBL:LEDGER:v1 + CID, via atomic-crypto
  • Append-only NDJSON: writers and readers with verification

§Modules

  • ledger: Simplified API with LedgerEntry, SimpleLedgerWriter, SimpleLedgerReader
  • writer, reader: Full-featured writer/reader with rotation and WAL
  • event: Event model
  • verify: Verification helpers

Re-exports§

pub use ledger::AppendResult;
pub use ledger::FsyncPolicy;
pub use ledger::LedgerEntry;
pub use ledger::LedgerError;
pub use ledger::LedgerWriter;
pub use ledger::RotatePolicy;
pub use ledger::SimpleLedgerIter;
pub use ledger::SimpleLedgerReader;
pub use ledger::SimpleLedgerWriter;
pub use reader::tail_file;
pub use reader::UblIter;
pub use reader::UblReader;
pub use writer::Rotation;
pub use writer::UblWriter;

Modules§

event
UBL event model. UBL NDJSON event schema with signatures and linkage.
ledger
Simplified ledger API with canonical bytes and optional signing. Minimal NDJSON ledger with canonical bytes, CID verification, and optional signing.
paths
Path helpers for UBL layout. Path helpers for UBL layout and timestamp formatting.
reader
File reader utilities. NDJSON reader and tail helpers for UBL event streams.
verify
Verification helpers. Verification helpers for UBL files and chains (signature, CID, prev-link).
writer
Synchronous writer. Synchronous UBL writer with rotation, WAL, and Ed25519 signing.

Constants§

UBL_DOMAIN_SIGN
Signing domain for UBL ledger entries.