pub struct SignedCheckpoint {
pub ledger_id: Did,
pub seq: u64,
pub head_hash: [u8; 32],
pub balances_root: [u8; 32],
pub pending_root: [u8; 32],
pub ts: u64,
pub prev_checkpoint_hash: [u8; 32],
pub sig: Vec<u8>,
}Expand description
A periodic, PQC-hybrid-signed commitment to ledger state (plan §2d). It is the anchorable object and the settlement reference. Per-commit chaining is cheap and unsigned; only checkpoints carry a signature.
Fields§
§ledger_id: DidThe cell ledger’s service identity.
seq: u64Journal head at checkpoint time.
head_hash: [u8; 32]Hash of journal entry seq.
balances_root: [u8; 32]Merkle-style root over all accounts sorted by id (plan §2d).
pending_root: [u8; 32]Root over open reservations sorted by id.
ts: u64Logical commit time of the checkpoint.
prev_checkpoint_hash: [u8; 32]Hash of the previous checkpoint (checkpoints chain too).
sig: Vec<u8>COSE composite signature over checkpoint_signing_input.
Implementations§
Source§impl SignedCheckpoint
impl SignedCheckpoint
Sourcepub fn digest(&self) -> Result<[u8; 32], LedgerError>
pub fn digest(&self) -> Result<[u8; 32], LedgerError>
A digest over the whole (signed) checkpoint — the value the next
checkpoint chains to via prev_checkpoint_hash, and the object an OTS
anchor attests (plan §2h).
Sourcepub fn signing_input(&self) -> Result<Vec<u8>, LedgerError>
pub fn signing_input(&self) -> Result<Vec<u8>, LedgerError>
The bytes the signature covers (everything except sig).
Trait Implementations§
Source§impl Clone for SignedCheckpoint
impl Clone for SignedCheckpoint
Source§fn clone(&self) -> SignedCheckpoint
fn clone(&self) -> SignedCheckpoint
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SignedCheckpoint
impl Debug for SignedCheckpoint
Source§impl<'de> Deserialize<'de> for SignedCheckpoint
impl<'de> Deserialize<'de> for SignedCheckpoint
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for SignedCheckpoint
impl PartialEq for SignedCheckpoint
Source§fn eq(&self, other: &SignedCheckpoint) -> bool
fn eq(&self, other: &SignedCheckpoint) -> bool
self and other values to be equal, and is used by ==.