Module commit_verify::lnpbp4
source · Expand description
Multi-message commitments: implementation of LNPBP-4 standard.
LNPBP-4 defines a commit-verify scheme for committing to a multiple messages under distinct protocols with ability to partially reveal set of the commitments and still be able to prove the commitment for each message without exposing the exact number of other messages and their respective protocol identifiers.
LBPBP-4 commitments are originally constructed from MultiSource data
structure in form of full LNPBP-4 merkle trees MerkleTree using
MerkleTree::try_commit method. Full trees preserve all the information
from the MultiSource, plus keep information on generated entropy and
the actual size of the created tree.
MerkleTree can than be either converted into MerkleBlock and than
a separate instances of MerkleProofs can be extracted from it for each
specific protocol using MerkleBlock::conceal_except operation.
MerkleBlock can conceal sme data and can also be constructed from
(multiple) MerkleProof and/or other MerkleBlock.
Summary of the operations with LNPBP-4 data structures:
MerkleTree::try_commit:MultiSource->MerkleTreeMerkleBlock::from:MerkleTree->SelfMerkleBlock::into_merkle_proof:Self,ProtocolId->MerkleProofMerkleBlock::with:MerkleProof,ProtocolId,Message->SelfMerkleBlock::merge_reveal:Self,MerkleProof->Self
Structs
CommitmentHash hash typeMerkleTree and MerkleBlock.Enums
MerkleTree::try_commit