{"id":20955128,"url":"https://github.com/bluewallet/rn-ldk","last_synced_at":"2025-04-09T21:19:59.891Z","repository":{"id":40574560,"uuid":"343115166","full_name":"BlueWallet/rn-ldk","owner":"BlueWallet","description":"Lightweight lightning node for React Native","archived":false,"fork":false,"pushed_at":"2024-03-23T18:17:16.000Z","size":652839,"stargazers_count":136,"open_issues_count":21,"forks_count":25,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-07T17:53:32.434Z","etag":null,"topics":["bitcoin","lightning-network","react-native","typescript"],"latest_commit_sha":null,"homepage":"","language":"C++","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/BlueWallet.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2021-02-28T13:42:58.000Z","updated_at":"2025-03-03T17:23:10.000Z","dependencies_parsed_at":"2024-03-23T19:37:25.165Z","dependency_job_id":null,"html_url":"https://github.com/BlueWallet/rn-ldk","commit_stats":null,"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueWallet%2Frn-ldk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueWallet%2Frn-ldk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueWallet%2Frn-ldk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueWallet%2Frn-ldk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BlueWallet","download_url":"https://codeload.github.com/BlueWallet/rn-ldk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248112152,"owners_count":21049608,"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","react-native","typescript"],"created_at":"2024-11-19T01:18:08.727Z","updated_at":"2025-04-09T21:19:59.868Z","avatar_url":"https://github.com/BlueWallet.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rn-ldk\n\nLightweight lightning node for React Native\n\n### Introducing brand-new Lightning implementation running on mobile, both iOS and Android!\n\nPowered by **Lightning Dev Kit**, a flexible lightning implementation written in Rust.\n\nSome of the features include:\n\n* Fund your channels straight from your hardware wallet, or wallets (in case of multisig)\n* Encrypted channel backups are stored in cloud. Mnemonic backup phrase is all you need to restore your lightning wallet and all channels on another device and start using it in seconds! Use same channels on several devices, if you wish\n* Synced to blockchain via Electrum, sync takes seconds, even on low-bandwidth connections\n* Routing is provided via API, no graph sync (optional)\n* Create a channel with any node on the Lightning network, no limitations (to keep the network decentralized)\n\n### Technicalities\n\nBinaries come from:\n\n* android https://github.com/lightningdevkit/ldk-garbagecollected\n* ios https://github.com/lightningdevkit/ldk-swift\n\nA thin wrapper layer is implemented in Kotlin \u0026 Swift to provide convenient better-abstracted methods to Javascript.\nJavascript part itself has *zero dependencies*, as a drawback some functions have to be provided externally (optional,\nas rn-ldk is shipped with API-based fallback)\n\nData is stored on the side of RN, for this purpose we provide AsyncStorage to RnLdk, but anything conforming\nto AsyncStorage interface will work.\n\nMainnet only.\n\nExample React Native project is bundled with this repo (as a playground for testing).\n\n## Installation\n\n```sh\nnpm install \"https://github.com/BlueWallet/rn-ldk\" --save\n```\n\n## Usage\n\n```js\nimport RnLdk from \"rn-ldk\";\nimport AsyncStorage from '@react-native-async-storage/async-storage';\n\n// start the node!\nconst entropy = 'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'; // change that\nRnLdk.setStorage(AsyncStorage);\nRnLdk.setRefundAddressScript('76a91419129d53e6319baf19dba059bead166df90ab8f588ac'); // 13HaCAB4jf7FYSZexJxoczyDDnutzZigjS\nawait RnLdk.start(entropy).then(console.warn);\n\n// lets create a channel\n\n// connect to a peer first:\nRnLdk.connectPeer('02e89ca9e8da72b33d896bae51d20e7e6675aa971f7557500b6591b15429e717f1', '165.227.95.104', 9735).then(console.warn); // lnd1.bluewallet.io\n// initiate channel opening:\nconst address = await RnLdk.openChannelStep1('02e89ca9e8da72b33d896bae51d20e7e6675aa971f7557500b6591b15429e717f1', 100000);\n// create a PSBT funding this address\n// ...\n// provide txhex to finalizing method:\nRnLdk.openChannelStep2(text).then(console.warn);\n\n// if all goes well, txhex is broadcasted and after tx gets enough confirmations channel will be usable!\n\n// make sure your peer is connected:\nRnLdk.listPeers().then(console.warn);\n// observe your channel:\nRnLdk.listUsableChannels().then(console.warn);\n\n// pay some invoice:\nconst resultPayment = await RnLdk.sendPayment(text);\n\n// you're awesome!\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluewallet%2Frn-ldk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbluewallet%2Frn-ldk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluewallet%2Frn-ldk/lists"}