{"id":13499165,"url":"https://github.com/lightningdevkit/rust-lightning","last_synced_at":"2025-12-15T13:12:23.993Z","repository":{"id":37010607,"uuid":"121809370","full_name":"lightningdevkit/rust-lightning","owner":"lightningdevkit","description":"A highly modular Bitcoin Lightning library written in Rust. It's rust-lightning, not Rusty's Lightning!","archived":false,"fork":false,"pushed_at":"2025-04-17T20:50:42.000Z","size":34788,"stargazers_count":1259,"open_issues_count":406,"forks_count":402,"subscribers_count":53,"default_branch":"main","last_synced_at":"2025-04-23T17:17:01.828Z","etag":null,"topics":["bitcoin","lightning-network"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lightningdevkit.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-16T22:50:53.000Z","updated_at":"2025-04-21T17:42:52.000Z","dependencies_parsed_at":"2023-12-05T18:24:56.012Z","dependency_job_id":"576ea228-c494-4ca6-b056-b876b3f25792","html_url":"https://github.com/lightningdevkit/rust-lightning","commit_stats":{"total_commits":3847,"total_committers":108,"mean_commits":"35.620370370370374","dds":0.4439823238887445,"last_synced_commit":"c1825672ed27839e95bb42bf8e75c9068da585d8"},"previous_names":["rust-bitcoin/rust-lightning"],"tags_count":46,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightningdevkit%2Frust-lightning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightningdevkit%2Frust-lightning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightningdevkit%2Frust-lightning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightningdevkit%2Frust-lightning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lightningdevkit","download_url":"https://codeload.github.com/lightningdevkit/rust-lightning/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250477820,"owners_count":21437049,"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":["bitcoin","lightning-network"],"created_at":"2024-07-31T22:00:30.344Z","updated_at":"2025-12-15T13:12:23.206Z","avatar_url":"https://github.com/lightningdevkit.png","language":"Rust","readme":"Rust-Lightning\n==============\n\n[![Crate](https://img.shields.io/crates/v/lightning.svg?logo=rust)](https://crates.io/crates/lightning)\n[![Documentation](https://img.shields.io/static/v1?logo=read-the-docs\u0026label=docs.rs\u0026message=lightning\u0026color=informational)](https://docs.rs/lightning/)\n[![Safety Dance](https://img.shields.io/badge/unsafe-forbidden-success.svg)](https://github.com/rust-secure-code/safety-dance/)\n[![Security Audit](https://github.com/lightningdevkit/rust-lightning/actions/workflows/audit.yml/badge.svg)](https://github.com/lightningdevkit/rust-lightning/actions/workflows/audit.yml)\n\n[LDK](https://lightningdevkit.org)/`rust-lightning` is a highly performant and flexible\nimplementation of the Lightning Network protocol.\n\nThe primary crate, `lightning`, is runtime-agnostic. Data persistence, chain interactions,\nand networking can be provided by LDK's [sample modules](#crates), or you may provide your\nown custom implementations.\nMore information is available in the [`About`](#about) section.\n\nStatus\n------\nThe project implements all of the [BOLT specifications](https://github.com/lightning/bolts),\nand has been in production use since 2021. As with any Lightning implementation, care and attention\nto detail is important for safe deployment.\n\nCommunications for `rust-lightning` and Lightning Development Kit happen through\nour LDK [Discord](https://discord.gg/5AcknnMfBw) channels.\n\nCrates\n-----------\n1. [lightning](./lightning)\n  The core of the LDK library, implements the Lightning protocol, channel state machine,\n  and on-chain logic. Supports `no_std` and exposes only relatively low-level interfaces.\n2. [lightning-background-processor](./lightning-background-processor)\n  Utilities to perform required background tasks for Rust Lightning.\n3. [lightning-block-sync](./lightning-block-sync)\n  Utilities to fetch the chain data from a block source and feed them into Rust Lightning.\n4. [lightning-invoice](./lightning-invoice)\n  Data structures to parse and serialize\n  [BOLT #11](https://github.com/lightning/bolts/blob/master/11-payment-encoding.md)\n  Lightning invoices.\n5. [lightning-net-tokio](./lightning-net-tokio)\n  Implementation of the `rust-lightning` network stack using the\n  [Tokio](https://github.com/tokio-rs/tokio) `async` runtime. For `rust-lightning`\n  clients which wish to make direct connections to Lightning P2P nodes, this is\n  a simple alternative to implementing the required network stack, especially\n  for those already using Tokio.\n6. [lightning-persister](./lightning-persister)\n  Implements utilities to manage `rust-lightning` channel data persistence and retrieval.\n  Persisting channel data is crucial to avoiding loss of channel funds.\n7. [lightning-rapid-gossip-sync](./lightning-rapid-gossip-sync)\n  Client for rapid gossip graph syncing, aimed primarily at mobile clients.\n\nAbout\n-----------\nLDK/`rust-lightning` is a generic library that allows you to build a Lightning\nnode without needing to worry about getting all of the Lightning state machine,\nrouting, and on-chain punishment code (and other chain interactions) exactly\ncorrect. Note that LDK isn't, in itself, a node. For an out-of-the-box Lightning\nnode based on LDK, see [LDK-sample](https://github.com/lightningdevkit/ldk-sample). However, if you\nwant to integrate Lightning with custom features such as your own chain sync,\nkey management, data storage/backup logic, etc., LDK is likely your best option.\nSome `rust-lightning` utilities such as those in\n[`chan_utils`](./lightning/src/ln/chan_utils.rs) are also suitable for use in\nnon-LN Bitcoin applications such as Discreet Log Contracts (DLCs) and bulletin boards.\n\nAlso check out [LDK-node](https://github.com/lightningdevkit/ldk-node) library\nif you want to easily integrate lightning in your application without taking care of\nall the boiler plate code.\n\nIn general, `rust-lightning` does not provide (but LDK has implementations of):\n* on-disk storage - you can store the channel state any way you want - whether\n  Google Drive/iCloud, a local disk, any key-value store/database/a remote\n  server, or any combination of them - we provide a clean API that provides\n  objects which can be serialized into simple binary blobs, and stored in any\n  way you wish.\n* blockchain data - we provide a simple `block_connected`/`block_disconnected`\n  API which you provide block headers and transaction information to. We also\n  provide an API for getting information about transactions we wish to be\n  informed of, which is compatible with Electrum server requests/neutrino\n  filtering/etc.\n* UTXO management - RL/LDK owns on-chain funds as long as they are claimable as\n  part of a Lightning output which can be contested - once a channel is closed\n  and all on-chain outputs are spendable only by the user, we provide users\n  notifications that a UTXO is \"theirs\" again and it is up to them to spend it\n  as they wish. Additionally, channel funding is accomplished with a generic API\n  which notifies users of the output which needs to appear on-chain, which they\n  can then create a transaction for. Once a transaction is created, we handle\n  the rest. This is a large part of our API's goals - making it easier to\n  integrate Lightning into existing on-chain wallets which have their own\n  on-chain logic - without needing to move funds in and out of a separate\n  Lightning wallet with on-chain transactions and a separate private key system.\n* networking - to enable a user to run a full Lightning node on an embedded\n  machine, we don't specify exactly how to connect to another node at all! We\n  provide a default implementation which uses TCP sockets, but, e.g., if you\n  wanted to run your full Lightning node on a hardware wallet, you could, by\n  piping the Lightning network messages over USB/serial and then sending them in\n  a TCP socket from another machine.\n* private keys - again we have \"default implementations\", but users can choose to\n  provide private keys to RL/LDK in any way they wish following a simple API. We\n  even support a generic API for signing transactions, allowing users to run\n  RL/LDK without any private keys in memory/putting private keys only on\n  hardware wallets.\n\nLDK's customizability was presented about at Advancing Bitcoin in February 2020:\nhttps://vimeo.com/showcase/8372504/video/412818125\n\nDesign Goal\n-----------\nThe goal is to provide a fully-featured and incredibly flexible Lightning\nimplementation, allowing users to decide how they wish to use it. With that\nin mind, everything should be exposed via simple, composable APIs. More\ninformation about `rust-lightning`'s flexibility is provided in the `About`\nsection above.\n\nFor security reasons, do not add new dependencies. Really do not add new\nnon-optional/non-test/non-library dependencies. Really really do not add\ndependencies with dependencies. Do convince Andrew to cut down dependency usage\nin `rust-bitcoin`.\n\nRust-Lightning vs. LDK (Lightning Development Kit)\n-------------\n`rust-lightning` refers to the core `lightning` crate within this repo, whereas\nLDK encompasses `rust-lightning` and all of its sample modules and crates (e.g.\nthe `lightning-persister` crate), language bindings, sample node\nimplementation(s), and other tools built around using `rust-lightning` for\nLightning integration or building a Lightning node.\n\nTagline\n-------\n\n*\"Rust-Lightning, not Rusty's Lightning!\"*\n\nContributing\n------------\n\nContributors are warmly welcome, see [CONTRIBUTING.md](CONTRIBUTING.md).\n\nProject Architecture\n---------------------\n\nFor a `rust-lightning` high-level API introduction, see [ARCH.md](ARCH.md).\n\nLicense is either Apache-2.0 or MIT, at the option of the user (ie dual-license\nApache-2.0 and MIT).\n","funding_links":[],"categories":["Lightning Network Protocol","Awesome Rust Bitcoin","Applications","Ecosystem","Rust","应用程序 Applications"],"sub_categories":["Implementations","Rust Bitcoin Cookbook","Blockchain","Lightning Implementations","Cryptocurrencies","加密货币 Cryptocurrencies"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightningdevkit%2Frust-lightning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flightningdevkit%2Frust-lightning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightningdevkit%2Frust-lightning/lists"}