How intersectmbo/cardano-ledger works
Major Modules and Components
• At the highest level, the repository is organized by blockchain eras. Create separate major blocks for each era:
– Byron (with its ledger, chain components, and separate CDDL for binary encoding)
– Shelley (with its design, formal specification, implementation, tests, and CDDL files)
– Allegra (and Mary – note that the README explains that these eras share similar structures as they both implement multi-currency or timelocks)
– Alonzo (with formal spec, implementation, tests and integration of Plutus Smart Contracts)
– Babbage (focusing on batch-verification and new CIP proposals)
– Conway (governance-focused, with work in-progress formal spec and tests)
• Support “Libraries” component – this deals with cardano-data, ledger API, ledger binary, ledger core, and other auxiliary libraries (such as constrained-generators, small-steps, set-algebra, etc.) that provide common functionality.
Within each Era Block
• Break each era module into three (or more) sub-components:
– Formal Specification: Documents and LaTeX builds (referenced in the README as PDFs).
– Executable/Implementation Layer: The Haskell source (often inside “impl” directories) that embodies the ledger rules, state transitions, and other behaviors.
– Tests: Test suites and executable specifications that validate the implementation against the formal model.
– CDDL Files: Representing the schema for binary serialization for that era.
• For Byron in particular, note the further breakdown into the “ledger”, “chain”, and “cddl” directories – so you might want to show a slightly different substructure for Byron versus later eras.
Integration and Dependencies
• Strong interaction with the common libraries. For example:
– The “cardano-data” and “cardano-ledger-api” libraries provide data types and APIs that are used across eras.
– “cardano-ledger-core”, “cardano-ledger-binary” and similar libraries support the core types (states, transactions, cryptographic components) and serialization.
– Other libraries (like “small-steps” and “set-algebra”) provide analysis and testing frameworks for ledger rules.
• External tools and build infrastructure:
– Nix is used for development and build reproducibility.
– Cabal (within the nix shell) is used to build the Haskell files.
– The CI workflows in the “.github/workflows” directory are responsible for running tests and building documents.