IntersectMBO /cardano-ledger
The ledger implementation and specifications of the Cardano blockchain.
★ 298⑂ 184👁 47⑃ 4,121● 2,129▤ 2
+0
日增长
298
stars
184
forks
47
watchers
4,121
prs
2,129
issues
2
releases
README
Cardano Ledger
This repository contains the formal specifications, executable models,
and implementations of the Cardano Ledger.
The documents can be accessed using the following links:
Era | Design Documents | Formal Specification | CDDL
----|------------------|----------------------|-----
Byron | | Chain Spec, Ledger Spec | CDDL, PDF
Shelley | Design | Spec | CDDL
Allegra | Same as Mary era below | Same as Mary era below | CDDL
Mary | Multi-Currency, UTXOma | Spec | CDDL
Alonzo | eUTXO| Spec | CDDL
Babbage | batch-verification, CIP-31, CIP-32, CIP-33 | Spec | CDDL
Conway | CIP-1694 | Spec | CDDL
Note that the formal specification documents present the specification in a
diff-style manner. That is, each document shows specification changes with
respect to documents of previous eras.
There is an ongoing effort to provide a full machine-verified formal
specification of the Cardano
Ledger that
will subsume the (formal specification) documents listed above. This effort is
complete for Conway but partially complete for previous eras.
Other Documents:
- Non-integer calculations specification: details on the parts of the Shelley specification that use real numbers.
- Stake pool ranking specification: details for a robust stake pool ranking mechanism.
- Explanation of the small-step-semantics framework: a guide to the notation and style used by our ledger rules.
In addition, there is a formalization of the Ledger Specification in Isabelle/HOL which can be found here.
Some user documentation is published on Read the Docs
Haddock code documentation of the latest master branch is available here.
Repository structure
The directory structure of this repository is as follows:
- Byron
- ledger
- formal-spec
- executable-spec
- implementation
- cddl
- chain
- formal-spec
- executable-spec
- Shelley
- design-spec
- formal-spec
- implementation
- tests
- cddl
- Allegra - Timelocks
- formal-spec
- implementation
- tests
- Mary - Multi-Assets
- formal-spec
- implementation
- tests
- Alonzo - Smart Contracts
- formal-spec
- implementation
- cddl
- tests
- Babbage
- formal-spec
- implementation
- cddl
- tests
- Conway - Governance
- formal-spec
- implementation
- cddl
- tests
- Libraries
Building
It is recommended to use nix for building everything in this repository. Make sure you have a recent version of nix by following this guide.
Haskell files can be built with cabal inside of a nix shell, which can be entered by invoking nix develop from the root directory.
Nix Cache
When using nix it is recommended that you setup the cache, so that it can
reuse built artifacts, reducing the compilation times dramatically:
If you are using NixOS add the snippet below to your
/etc/nixos/configuration.nix:
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
substituters = [
"https://cache.nixos.org"
"https://cache.iog.io"
];
trusted-public-Top issues
#768Consider adding "batch" transactions27 comments · 2019-08-15#4892Implementation-Independent Ledger Conformance Test Suite23 comments · 2025-02-16#2941Better communication/clarity on phase-1 validation and serialization criteria 20 comments · 2022-07-28#6242BLS keys in pool re-registration certs are expensive to decode at vote-time19 comments · 2026-11-02#2745remove ranking code17 comments · 2022-04-21#2811Alonzo test failure12 comments · 2022-05-23#2653Individual pool provenance missing since 1.33.011 comments · 2022-02-10#4594Potential unintended consequences for ref script fees9 comments · 2024-09-03