https://github.com/commonwarexyz/monorepo/tree/main/coding/src

This document explains the current ZODA implementation in coding/src/zoda.rs in the Commonware monorepo. It’s meant to bridge the original paper-style description and the actual Rust code so we can later adapt it to the Nomos DA v2.

High-Level Idea

The implementation does four things:

  1. Encode a byte buffer into RS-extended rows, commit to those rows with a Merkle tree, and derive deterministic randomness from that commitment.
  2. Generate a checking matrix from that randomness and precompute a “checksum matrix” = (original data) × (checking matrix).
  3. Shard the encoded rows by shuffling their indices and giving each shard:
  4. Verify / re-shard / decode later, using only the commitment and the shipped checksum.

The key property: a single shard can be locally checked against the commitment without reconstructing the whole dataset. That’s the “ZODA-style” guarantee.

Core Types

1. Topology

struct Topology { ... }

https://github.com/commonwarexyz/monorepo/blob/main/coding/src/zoda.rs#L229

This is the “shape calculator.” Given:

it figures out: