{"id":19783653,"url":"https://github.com/intersectmbo/formal-ledger-specifications","last_synced_at":"2025-02-28T06:53:51.382Z","repository":{"id":43672569,"uuid":"511140824","full_name":"IntersectMBO/formal-ledger-specifications","owner":"IntersectMBO","description":"Formal specifications of the cardano ledger","archived":false,"fork":false,"pushed_at":"2025-02-20T21:58:46.000Z","size":179737,"stargazers_count":39,"open_issues_count":86,"forks_count":15,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-02-20T22:31:44.263Z","etag":null,"topics":["agda","cardano-node","formal-methods"],"latest_commit_sha":null,"homepage":"","language":"Agda","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":"2022-07-06T13:06:07.000Z","updated_at":"2025-02-20T16:29:49.000Z","dependencies_parsed_at":"2023-10-13T06:42:39.435Z","dependency_job_id":"576004dc-3763-472c-9aa9-12f74b5b94a3","html_url":"https://github.com/IntersectMBO/formal-ledger-specifications","commit_stats":null,"previous_names":["intersectmbo/formal-ledger-specifications","input-output-hk/formal-ledger-specifications"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntersectMBO%2Fformal-ledger-specifications","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntersectMBO%2Fformal-ledger-specifications/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntersectMBO%2Fformal-ledger-specifications/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntersectMBO%2Fformal-ledger-specifications/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IntersectMBO","download_url":"https://codeload.github.com/IntersectMBO/formal-ledger-specifications/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241114202,"owners_count":19912025,"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":["agda","cardano-node","formal-methods"],"created_at":"2024-11-12T06:08:55.283Z","updated_at":"2025-02-28T06:53:51.362Z","avatar_url":"https://github.com/IntersectMBO.png","language":"Agda","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Formal ledger specifications\n\nThis repository contains the formal ledger specifications that are intended to eventually replace the existing formal specifications of the Cardano ledger found [here](https://github.com/IntersectMBO/cardano-ledger). This project is currently incomplete and work in progress.\n\nThis repository currently contains two specifications---the work in progress specification for Cardano (up to and including the Conway era) and a small example that was produced for the Midnight project (but is unrelated to any actual Midnight code/features). Each specification is executable and contains some documentation in the form of a PDF document. They can be built by following the steps below.\n\nFormal Specification | HTML Version | Haskell Tests |\n----------------------|--------------|---------------|\n[Full Cardano Ledger](https://IntersectMBO.github.io/formal-ledger-specifications/pdfs/cardano-ledger.pdf) | [Ledger.PDF](https://IntersectMBO.github.io/formal-ledger-specifications/html/Ledger.PDF.html) | [UTXOW test](https://IntersectMBO.github.io/formal-ledger-specifications/haskell/Ledger/test/UtxowSpec.hs) |\n[Conway](https://IntersectMBO.github.io/formal-ledger-specifications/pdfs/conway-ledger.pdf) | [Ledger.PDF](https://IntersectMBO.github.io/formal-ledger-specifications/html/Ledger.PDF.html) | [UTXOW test](https://IntersectMBO.github.io/formal-ledger-specifications/haskell/Ledger/test/UtxowSpec.hs) |\n[Midnight Example](https://IntersectMBO.github.io/formal-ledger-specifications/pdfs/midnight-example.pdf) | [MidnightExample.PDF](https://IntersectMBO.github.io/formal-ledger-specifications/html/MidnightExample.PDF.html) | [LEDGER test](https://IntersectMBO.github.io/formal-ledger-specifications/haskell/MidnightExample/test/LedgerSpec.hs) |\n\nNote: the HTML versions of the specifications are interactive, but many modules currently contain LaTeX code which is used to generate the PDF. We intend to fix this eventually.\n\n--------------------\n\n## Build and Test the Formal Spec\n\n### Clone this repository and enter its directory\n\n```\ngit clone https://github.com/IntersectMBO/formal-ledger-specifications.git\ncd formal-ledger-specifications\n```\n\n\n### Build the spec using nix-build\n\nInvoke the following `nix-build` commands from inside the `formal-ledger-specifications` directory.\n\n```\nnix-build -A ledger.docs      # generate the PDF spec of the Cardano ledger\nnix-build -A midnight.docs    # generate the PDF spec of the Midnight example\nnix-build -A ledger.hsSrc     # extract the Haskell code of the Cardano ledger\nnix-build -A midnight.hsSrc   # extract the Haskell code of the Midnight example\n```\n\n### Test the spec using nix-shell\n\nThe `hsExe` is a `cabal` package, which can be loaded into GHCI like this:\n\n```\nnix-shell -A run --command \"cabal repl --build-depends 'cardano-ledger'\"\nλ\u003e :m Lib\nλ\u003e :i UTxOState\n```\n\nBuilding the `hsExe` derivation will also run the test suite, which you can manually do using `cabal test`.\n\n\n\n## Contributions and Feedback\n\nIf you would like more detailed information and/or you want to contribute to the Agda formalization of the spec, please see the [CONTRIBUTING.md](CONTRIBUTING.md) file.\n\nPlease [submit a new issue][] if you find problems with, and/or wish to comment on, this repository.\n\n[submit a new issue]: https://github.com/IntersectMBO/formal-ledger-specifications/issues/new/choose\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintersectmbo%2Fformal-ledger-specifications","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintersectmbo%2Fformal-ledger-specifications","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintersectmbo%2Fformal-ledger-specifications/lists"}