Module commit_verify::commit_encode[][src]

Expand description

Encoding and data preparation for commitment procedures in client-side-validation as defined by LNPBP-9 standard.

Client-side-validation commitment process requires special encoding of the data. While strict_encoding is the main standard for atomic data types in client-side-validation world and should be used during internal protocol-specific data validation, commitments may require processes of merklization arrays of data items, or hiding confidential parts of the data via hashing, pedersen commitments and so on. Thus, additinally to strict encoding, a set of different encodings and data convolution and hiding procedures are defined in this commit_encode module of the commit_verify library. This includes:

  • merklization procedures operating special types of tagged hashes and committing to the depth of each node
  • commit conceal procedures, making data confidential (transforming types into confidential versions)
  • commit encoding, which should conceal all the data and merklize arrays, and only them performing their strict encoding
  • consensus commitment, which wraps all of the above as a final API, producing of a single commitment to the client-validated data.

Modules

strategies

Strategies simplifying implementation of CommitEncode trait.

Traits

CommitConceal

Trait that should perform conversion of a given client-side-validated data type into its confidential version concealing all of its data.

CommitEncode

Prepares the data to the consensus commit procedure by first running necessary conceal and merklization procedures, and them performing strict encoding for the resulted data.

ConsensusCommit

High-level API used in client-side validation for producing a single commitment to the data, which includes running all necessary procedures like concealment with CommitConceal, merklization, strict encoding, wrapped into CommitEncode, followed by the actual commitment to its output.

Strategy

Marker trait defining specific encoding strategy which should be used for automatic implementation of CommitEncode.