Crate komodo

Source
Expand description

Komodo: Cryptographically-proven Erasure Coding

Komodo provides an easy-to-use Rust library and ecosystem that is composed of two main parts:

  • support for FEC encoding and decoding with the fec submodule
  • support for proving and verifying shards of encoded data with the semi_avid, kzg* and aplonk* submodules

Note

modules marked with an *, e.g. kzg*, are hidden behind a Cargo feature with the same name

Other submodules define several fundamental building blocks to Komodo, but which are not mandatory to explore to understand the protocols.

§Example

Let’s explain with a very simple example how things operate with Komodo.

Note

the following example uses some syntax of Rust but is NOT valid Rust code and omits a lot of details for both Rust and Komodo

  1. choose an encoding matrix to encode the input data
let encoding_mat = Matrix::random(k, n, rng);
  1. encode the data and build encoded shards
let shards = fec::encode(bytes, encoding_mat);
  1. attach a cryptographic proof to all the shards and get a proven block
let blocks = prove(bytes, k);
  1. verify each block individually
for block in blocks {
    assert!(verify(block));
}
  1. decode the original data with any subset of k blocks
assert_eq!(bytes, fec::decode(blocks[0..k]));

Modules§

algebra
Manipulate finite field elements
aplonk
aPlonK: an extension of KZG+ where commits are folded into one
error
Komodo-specific errors
fec
a module to encode, recode and decode shards of data with FEC methods.
kzg
KZG+: the multipolynomial and non-interactive extension of KZG
semi_avid
Semi-AVID: a proving scheme suited for an information dispersal context
zk
a replacement of Arkworks’ KZG10 module