{"id":50940095,"url":"https://github.com/ppad-tech/bolt2","last_synced_at":"2026-06-17T13:04:08.590Z","repository":{"id":352219620,"uuid":"1214083986","full_name":"ppad-tech/bolt2","owner":"ppad-tech","description":"Lightning peer protocol, per BOLT #2.","archived":false,"fork":false,"pushed_at":"2026-04-18T13:44:27.000Z","size":94,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-18T14:35:44.341Z","etag":null,"topics":["haskell","lightning"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ppad-tech.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-04-18T05:18:10.000Z","updated_at":"2026-04-18T13:44:30.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ppad-tech/bolt2","commit_stats":null,"previous_names":["ppad-tech/bolt2"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ppad-tech/bolt2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppad-tech%2Fbolt2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppad-tech%2Fbolt2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppad-tech%2Fbolt2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppad-tech%2Fbolt2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ppad-tech","download_url":"https://codeload.github.com/ppad-tech/bolt2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppad-tech%2Fbolt2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34449283,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["haskell","lightning"],"created_at":"2026-06-17T13:04:07.655Z","updated_at":"2026-06-17T13:04:08.560Z","avatar_url":"https://github.com/ppad-tech.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ppad-bolt2\n\n[![](https://img.shields.io/hackage/v/ppad-bolt2?color=blue)](https://hackage.haskell.org/package/ppad-bolt2)\n![](https://img.shields.io/badge/license-MIT-brightgreen)\n[![](https://img.shields.io/badge/haddock-bolt2-lightblue)](https://docs.ppad.tech/bolt2)\n\nHaskell implementation of BOLT #2 (Lightning Network peer protocol),\nincluding message types and codecs for channel establishment, normal\noperation, and channel close.\n\n## Usage\n\nA sample GHCi session:\n\n```\n  \u003e :set -XOverloadedStrings\n  \u003e\n  \u003e import qualified Data.ByteString as BS\n  \u003e import qualified Lightning.Protocol.BOLT2 as BOLT2\n  \u003e import Lightning.Protocol.BOLT1 (TlvStream(..))\n  \u003e\n  \u003e -- construct an open_channel message\n  \u003e let Just cid = BOLT2.channelId (BS.replicate 32 0x00)\n  \u003e let Just ch = BOLT2.chainHash (BS.replicate 32 0x01)\n  \u003e let Just pk = BOLT2.point (BS.cons 0x02 (BS.replicate 32 0xff))\n  \u003e\n  \u003e let msg = BOLT2.OpenChannel\n  \u003e       { BOLT2.openChannelChainHash = ch\n  \u003e       , BOLT2.openChannelTempChannelId = cid\n  \u003e       , BOLT2.openChannelFundingSatoshis = BOLT2.Satoshis 1000000\n  \u003e       , BOLT2.openChannelPushMsat = BOLT2.MilliSatoshis 0\n  \u003e       , BOLT2.openChannelDustLimitSatoshis = BOLT2.Satoshis 546\n  \u003e       , BOLT2.openChannelMaxHtlcValueInFlight = BOLT2.MilliSatoshis 100000000\n  \u003e       , BOLT2.openChannelChannelReserveSat = BOLT2.Satoshis 10000\n  \u003e       , BOLT2.openChannelHtlcMinimumMsat = BOLT2.MilliSatoshis 1000\n  \u003e       , BOLT2.openChannelFeeratePerKw = 2500\n  \u003e       , BOLT2.openChannelToSelfDelay = 144\n  \u003e       , BOLT2.openChannelMaxAcceptedHtlcs = 483\n  \u003e       , BOLT2.openChannelFundingPubkey = pk\n  \u003e       , BOLT2.openChannelRevocationBasepoint = pk\n  \u003e       , BOLT2.openChannelPaymentBasepoint = pk\n  \u003e       , BOLT2.openChannelDelayedPaymentBase = pk\n  \u003e       , BOLT2.openChannelHtlcBasepoint = pk\n  \u003e       , BOLT2.openChannelFirstPerCommitPoint = pk\n  \u003e       , BOLT2.openChannelChannelFlags = 0x01\n  \u003e       , BOLT2.openChannelTlvs = TlvStream []\n  \u003e       }\n  \u003e\n  \u003e -- encode and decode\n  \u003e let encoded = BOLT2.encodeOpenChannel msg\n  \u003e BS.length encoded\n  319\n  \u003e BOLT2.decodeOpenChannel encoded\n  Right (OpenChannel {..}, \"\")\n```\n\n## Message Types\n\nSupported BOLT #2 messages:\n\n- Channel establishment v1: `open_channel`, `accept_channel`,\n  `funding_created`, `funding_signed`, `channel_ready`\n- Channel establishment v2: `open_channel2`, `accept_channel2`,\n  `tx_add_input`, `tx_add_output`, `tx_remove_input`, `tx_remove_output`,\n  `tx_complete`, `tx_signatures`, `tx_init_rbf`, `tx_ack_rbf`, `tx_abort`\n- Channel close: `stfu`, `shutdown`, `closing_signed`, `closing_complete`,\n  `closing_sig`\n- Normal operation: `update_add_htlc`, `update_fulfill_htlc`,\n  `update_fail_htlc`, `update_fail_malformed_htlc`, `commitment_signed`,\n  `revoke_and_ack`, `update_fee`\n- Reestablishment: `channel_reestablish`\n\n## Documentation\n\nHaddocks are hosted at [docs.ppad.tech/bolt2][hadoc].\n\n## Security\n\nThis is a pre-release version of the library and makes no guarantees about\nsecurity whatsoever.\n\n## Development\n\nYou'll require [Nix][nixos] with [flake][flake] support enabled. Enter a\ndevelopment shell with:\n\n```\n$ nix develop\n```\n\nThen do e.g.:\n\n```\n$ cabal build\n$ cabal test\n$ cabal bench\n```\n\n[nixos]: https://nixos.org/\n[flake]: https://nixos.org/manual/nix/unstable/command-ref/new-cli/nix3-flake.html\n[hadoc]: https://docs.ppad.tech/bolt2\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppad-tech%2Fbolt2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fppad-tech%2Fbolt2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppad-tech%2Fbolt2/lists"}