{"id":13428314,"url":"https://github.com/IntersectMBO/cardano-ledger","last_synced_at":"2025-03-16T01:32:29.720Z","repository":{"id":37266283,"uuid":"150113380","full_name":"IntersectMBO/cardano-ledger","owner":"IntersectMBO","description":"The ledger implementation and specifications of the Cardano blockchain.","archived":false,"fork":false,"pushed_at":"2024-12-23T19:51:50.000Z","size":110215,"stargazers_count":264,"open_issues_count":204,"forks_count":155,"subscribers_count":57,"default_branch":"master","last_synced_at":"2024-12-29T14:00:46.353Z","etag":null,"topics":["ada","blockchain","cardano","cryptocurrency"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IntersectMBO.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE-OF-CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-24T14:14:10.000Z","updated_at":"2024-12-20T22:55:44.000Z","dependencies_parsed_at":"2024-05-20T11:39:38.968Z","dependency_job_id":"4a0f9c7b-a947-4552-8bf6-6eefbe5f7a43","html_url":"https://github.com/IntersectMBO/cardano-ledger","commit_stats":null,"previous_names":["intersectmbo/cardano-ledger","input-output-hk/cardano-ledger","input-output-hk/cardano-ledger-specs"],"tags_count":398,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntersectMBO%2Fcardano-ledger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntersectMBO%2Fcardano-ledger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntersectMBO%2Fcardano-ledger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntersectMBO%2Fcardano-ledger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IntersectMBO","download_url":"https://codeload.github.com/IntersectMBO/cardano-ledger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243814900,"owners_count":20352037,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ada","blockchain","cardano","cryptocurrency"],"created_at":"2024-07-31T01:00:52.045Z","updated_at":"2025-03-16T01:32:29.714Z","avatar_url":"https://github.com/IntersectMBO.png","language":"Haskell","funding_links":[],"categories":["Uncategorized","Haskell","Smart Contract Platforms"],"sub_categories":["Uncategorized"],"readme":"\u003ch1 align=\"center\"\u003eCardano Ledger\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://input-output-hk.github.io/cardano-engineering-handbook\"\u003e\n    \u003cimg alt=\"CEH\" src=\"https://img.shields.io/badge/policy-Cardano%20Engineering%20Handbook-informational?style=for-the-badge\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/intersectmbo/cardano-ledger/actions/workflows/haskell.yml\"\u003e\n    \u003cimg alt=\"GitHub Workflow Status (master)\" src=\"https://img.shields.io/github/actions/workflow/status/intersectmbo/cardano-ledger/haskell.yml?branch=master\u0026style=for-the-badge\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://cardano-ledger.cardano.intersectmbo.org/\"\u003e\n    \u003cimg alt=\"Haddock (master)\" src=\"https://img.shields.io/badge/documentation-Haddock-yellow?style=for-the-badge\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nThis repository contains the formal specifications, executable models,\nand implementations of the Cardano Ledger.\n\nThe documents are built in our CI and can be readily accessed using the\nfollowing links:\n\nEra | Design Documents | Formal Specification | CDDL\n----|------------------|----------------------|-----\nByron | | [Chain Spec](https://github.com/intersectmbo/cardano-ledger/releases/latest/download/byron-blockchain.pdf \"Specification of the Blockchain Layer\"), [Ledger Spec](https://github.com/intersectmbo/cardano-ledger/releases/latest/download/byron-ledger.pdf \"A Formal Specification of the Cardano Ledger\") | [CDDL](https://github.com/intersectmbo/cardano-ledger/tree/master/eras/byron/cddl-spec/byron.cddl), [PDF](https://github.com/intersectmbo/cardano-ledger/releases/latest/download/byron-binary.pdf)\nShelley | [Design](https://github.com/intersectmbo/cardano-ledger/releases/latest/download/shelley-delegation.pdf \"Design Specification for Delegation and Incentives in Cardano\") | [Spec](https://github.com/intersectmbo/cardano-ledger/releases/latest/download/shelley-ledger.pdf \"A Formal Specification of the Cardano Ledger\") | [CDDL](https://github.com/intersectmbo/cardano-ledger/tree/master/eras/shelley/impl/cddl-files)\nAllegra | Same as Mary era below | Same as Mary era below | [CDDL](https://github.com/intersectmbo/cardano-ledger/tree/master/eras/allegra/impl/cddl-files)\nMary | [Multi-Currency](https://eprint.iacr.org/2020/895 \"Multi-Currency Ledgers\"), [UTXOma](https://iohk.io/en/research/library/papers/utxoma-utxo-with-multi-asset-support/ \"UTXOma:UTXO with Multi-Asset Support\") | [Spec](https://github.com/intersectmbo/cardano-ledger/releases/latest/download/mary-ledger.pdf \"A Formal Specification of the Cardano Ledger with a Native Multi-Asset Implementation\") | [CDDL](https://github.com/intersectmbo/cardano-ledger/tree/master/eras/mary/impl/cddl-files)\nAlonzo | [eUTXO](https://iohk.io/en/research/library/papers/the-extended-utxo-model/ \"The Extended UTXO Model\")| [Spec](https://github.com/intersectmbo/cardano-ledger/releases/latest/download/alonzo-ledger.pdf \"A Formal Specification of the Cardano Ledger integrating Plutus Core\") | [CDDL](https://github.com/intersectmbo/cardano-ledger/tree/master/eras/alonzo/impl/cddl-files)\nBabbage | [batch-verification](https://iohk.io/en/research/library/papers/on-uc-secure-range-extension-and-batch-verification-for-ecvrf/ \"On UC-Secure Range Extension and Batch Verification for ECVRF\"), [CIP-31](https://github.com/cardano-foundation/CIPs/pull/159 \"Reference inputs\"), [CIP-32](https://github.com/cardano-foundation/CIPs/pull/160 \"Inline datums\"), [CIP-33](https://github.com/cardano-foundation/CIPs/pull/161 \"Reference scripts\") | [Spec](https://github.com/intersectmbo/cardano-ledger/releases/latest/download/babbage-ledger.pdf \"Formal Specification of the Cardano Ledger for the Babbage era\") | [CDDL](https://github.com/intersectmbo/cardano-ledger/tree/master/eras/babbage/impl/cddl-files)\nConway | [CIP-1694](https://github.com/cardano-foundation/CIPs/tree/master/CIP-1694) | [Spec (WIP)](https://github.com/intersectmbo/formal-ledger-specifications) | [CDDL](https://github.com/intersectmbo/cardano-ledger/tree/master/eras/conway/impl/cddl-files)\n\n\nOther Documents:\n- [Non-integer calculations specification](https://github.com/intersectmbo/cardano-ledger/releases/latest/download/non-integer-calculations.pdf): details on the parts of the Shelley specification that use real numbers.\n- [Stake pool ranking specification](https://github.com/intersectmbo/cardano-ledger/releases/latest/download/pool-ranking.pdf): details for a robust stake pool ranking mechanism.\n- [Explanation of the small-step-semantics framework](https://github.com/intersectmbo/cardano-ledger/releases/latest/download/small-step-semantics.pdf): a guide to the notation and style used by our ledger rules.\n\nIn addition, there is a formalization of the Ledger Specification in Isabelle/HOL which can be found [here](https://github.com/input-output-hk/fm-ledger-formalization).\n\nSome user documentation is published on [Read the Docs](https://cardano-ledger.readthedocs.io/en/latest)\n\nHaddock code documentation of the latest master branch is available [here](https://cardano-ledger.cardano.intersectmbo.org/).\n\n# Repository structure\n\nThe directory structure of this repository is as follows:\n\n- [Byron](./eras/byron)\n  - [ledger](./eras/byron/ledger)\n    - [formal-spec](./eras/byron/ledger/formal-spec)\n    - [executable-spec](./eras/byron/ledger/executable-spec)\n    - [implementation](./eras/byron/ledger/impl)\n  - [chain](./eras/byron/chain)\n    - [formal-spec](./eras/byron/chain/formal-spec)\n    - [executable-spec](./eras/byron/chain/executable-spec)\n  - [cddl](./eras/byron/cddl-spec)\n- [Shelley](./eras/shelley)\n  - [design-spec](./eras/shelley/design-spec)\n  - [formal-spec](./eras/shelley/formal-spec)\n  - [implementation](./eras/shelley/impl)\n  - [tests](./eras/shelley/test-suite)\n  - [cddl](./eras/shelley/impl/cddl-files)\n- [Allegra - Timelocks](./eras/allegra)\n  - [formal-spec](./eras/shelley-ma/formal-spec)\n  - [implementation](./eras/allegra/impl)\n  - [tests](./eras/shelley-ma/test-suite)\n- [Mary - Multi-Assets](./eras/allegra)\n  - [formal-spec](./eras/shelley-ma/formal-spec)\n  - [implementation](./eras/allegra/impl)\n  - [tests](./eras/shelley-ma/test-suite)\n- [Alonzo - Smart Contracts](./eras/alonzo)\n  - [formal-spec](./eras/alonzo/formal-spec)\n  - [implementation](./eras/alonzo/impl)\n  - [cddl](./eras/alonzo/impl/cddl-files)\n  - [tests](./eras/alonzo/test-suite)\n- [Babbage](./eras/babbage)\n  - [formal-spec](./eras/babbage/formal-spec)\n  - [implementation](./eras/babbage/impl)\n  - [cddl](./eras/babbage/impl/cddl-files)\n  - [tests](./eras/babbage/test-suite)\n- [Conway - Governance](./eras/conway)\n  - [formal-spec](./eras/conway/formal-spec)\n  - [implementation](./eras/conway/impl)\n  - [cddl](./eras/conway/impl/cddl-files)\n  - [tests](./eras/conway/impl/test)\n- [Libraries](./libs)\n\n# Building\n\nIt is recommended to use [`nix`](https://nixos.org/nix/download.html) for building everything in this repository. Make sure you have a recent version of `nix` by following this [guide](https://nixos.org/manual/nix/stable/installation/upgrading.html).\n\nHaskell files can be built with [`cabal`](https://www.haskell.org/cabal/) inside of a nix shell, which can be entered by invoking `nix develop` from the root directory.\n\n## Nix Cache\n\nWhen using `nix` it is recommended that you setup the cache, so that it can\nreuse built artifacts, reducing the compilation times dramatically:\n\nIf you are using [NixOS](https://nixos.org/) add the snippet below to your\n`/etc/nixos/configuration.nix`:\n\n```\nnix.settings = {\n  experimental-features = [ \"nix-command\" \"flakes\" ];\n  substituters = [\n    \"https://cache.nixos.org\"\n    \"https://cache.iog.io\"\n  ];\n  trusted-public-keys = [\n    \"hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=\"\n  ];\n};\n```\n\nIf you are using the `nix` package manager next to another operating system put\nthe following in `/etc/nix/nix.conf`:\n\n```\nexperimental-features = nix-command flakes\nsubstituters        = https://cache.iog.io https://cache.nixos.org/\ntrusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=\n```\n\n## Building the LaTeX documents and executable specifications\n\nWhen using `nix` the documents and Haskell code can be readily\nbuilt by running:\n\n```shell\nnix build .#specs\n```\n\nThe LaTeX documents will be placed inside a directory named `result`, e.g.:\n\n```shell\nresult/byron-ledger.pdf\nresult/shelley-delegation.pdf\nresult/non-integer-calculations.pdf\nresult/small-step-semantics.pdf\nresult/shelley-ledger.pdf\nresult/byron-blockchain.pdf\n```\n\n\n## Building individual LaTeX documents\n\n\nChange to the latex directory where the latex document is (e.g. `eras/shelley/formal-spec`\nfor the ledger specification corresponding to the Shelley release, or\n`eras/byron/ledger/formal-spec` for the ledger specification corresponding to\nthe Byron release). Then, build the latex document by running:\n\n```shell\ncd \u003cmyLaTexDir\u003e\nnix develop --command make\n```\n\nFor a continuous compilation of the `LaTeX` file run:\n\n```shell\ncd \u003cmyLaTexDir\u003e\nnix develop --command make watch\n```\n\n# Testing\n\nFrom the root directory invoke `nix develop` to enter a nix shell, then run `cabal test all` to run all tests or `cabal test \u003cpackage\u003e` to run the tests for a specific package.\n\nNote: The `CARDANO_MAINNET_MIRROR` environment variable can be overridden in `flake.nix` if one desires to run\nthe Byron tests with a different version of the [mainnet epochs](https://github.com/input-output-hk/cardano-mainnet-mirror/tree/master/epochs).\n\n# Submitting an issue\n\nIssues can be filed in the [GitHub Issue tracker](https://github.com/intersectmbo/cardano-ledger/issues).\n\nHowever, note that this is pre-release software, so we will not usually be providing support.\n\n# Contributing\n\nSee [CONTRIBUTING](https://github.com/intersectmbo/cardano-ledger/blob/master/CONTRIBUTING.md).\n\n# Using `git fsck`\n\nThere's some ancient history in the repo that causes `git fsck` version `2.44.0` or later to report errors when running semantic checks on an old version of the `.gitmodules` file.\n\nThis can be overcome by running `git config fsck.skipList .git-fsck-skiplist` once, sometime after cloning.\n\nHowever, the problem prevents cloning if you have `transfer.fsckObjects` enabled in your global git configuration. You can overcome this by downloading the skiplist file before you clone and then specifying it in a config option to the `clone` command:\n\n```shell\n$ curl -sSLO https://raw.githubusercontent.com/IntersectMBO/cardano-ledger/refs/heads/master/.git-fsck-skiplist\n$ git clone -c fetch.fsck.skipList=.git-fsck-skiplist ...\n...\n$ rm .git-fsck-skiplist\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIntersectMBO%2Fcardano-ledger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FIntersectMBO%2Fcardano-ledger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIntersectMBO%2Fcardano-ledger/lists"}