{"id":13596954,"url":"https://github.com/LtbLightning/bdk-rn","last_synced_at":"2025-04-10T00:31:30.420Z","repository":{"id":38211196,"uuid":"474376607","full_name":"LtbLightning/bdk-rn","owner":"LtbLightning","description":"Bitcoin Development Kit - React Native Module","archived":false,"fork":false,"pushed_at":"2025-03-20T01:01:02.000Z","size":133328,"stargazers_count":52,"open_issues_count":28,"forks_count":16,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-20T01:27:01.545Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","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/LtbLightning.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2022-03-26T14:46:55.000Z","updated_at":"2025-03-20T00:21:45.000Z","dependencies_parsed_at":"2023-11-22T01:08:16.051Z","dependency_job_id":"ac8597a4-cbbb-41a5-8e6d-4b408bed8d81","html_url":"https://github.com/LtbLightning/bdk-rn","commit_stats":{"total_commits":66,"total_committers":5,"mean_commits":13.2,"dds":0.0757575757575758,"last_synced_commit":"6ae7448822d6213420f2f1de230a080af5bd11cf"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LtbLightning%2Fbdk-rn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LtbLightning%2Fbdk-rn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LtbLightning%2Fbdk-rn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LtbLightning%2Fbdk-rn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LtbLightning","download_url":"https://codeload.github.com/LtbLightning/bdk-rn/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248135206,"owners_count":21053638,"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":[],"created_at":"2024-08-01T17:00:15.715Z","updated_at":"2025-04-10T00:31:30.410Z","avatar_url":"https://github.com/LtbLightning.png","language":"Swift","funding_links":[],"categories":["Libraries"],"sub_categories":[],"readme":"## bdk-rn\n\n\u003cp\u003e\n  \u003ca href=\"https://github.com/LtbLightning/bdk-rn/blob/HEAD/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/license-MIT-blue.svg\" alt=\"BDK RN is released under the MIT license.\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/LtbLightning/bdk-rn/blob/main/README.md\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/docs-red.svg\" alt=\"Docs\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/bdk-rn\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/bdk-rn\" alt=\"Current npm package version.\" /\u003e\n  \u003c/a\u003e\n    \u003ca href=\"https://github.com/LtbLightning/bdk-rn/issues\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/issues/LtbLightning/bdk-rn.svg\" alt=\"Issues\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/LtbLightning/bdk-rn/stargazers\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/stars/LtbLightning/bdk-rn.svg\" alt=\"Stars\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/LtbLightning/bdk-rn/forks\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/forks/LtbLightning/bdk-rn.svg?color=brightgreen\" alt=\"Forks\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/LtbLightning/bdk-rn-app\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Demo App-orange\" alt=\"Demo App\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nA React Native version of the Bitcoin Development Kit (https://bitcoindevkit.org/)\n`bdk` aims to be the core building block for Bitcoin Applications of any kind.\n\n## Installation\n\nUsing npm:\n\n```bash\nnpm i --save bdk-rn\n```\n\nUsing yarn:\n\n```bash\nyarn add bdk-rn\n```\n\n[IOS Only] Install pods:\n\n```bash\nnpx pod-install\nor\ncd ios \u0026\u0026 pod install\n```\n\n### Examples\n\n### Create a Wallet \u0026 sync the balance of a descriptor\n\n```ts\nimport { DescriptorSecretKey, Mnemonic, Blockchain, Wallet, DatabaseConfig, Descriptor } from 'bdk-rn';\nimport { WordCount, Network, KeychainKind } from 'bdk-rn/lib/lib/enums';\n\n// ....\n\nconst mnemonic = await new Mnemonic().create(WordCount.WORDS12);\nconst descriptorSecretKey = await new DescriptorSecretKey().create(Network.Testnet, mnemonic);\nconst externalDescriptor = await new Descriptor().newBip84(descriptorSecretKey, KeychainKind.External, Network.Testnet);\nconst internalDescriptor = await new Descriptor().newBip84(descriptorSecretKey, KeychainKind.Internal, Network.Testnet);\n\nconst config: BlockchainElectrumConfig = {\n  url: 'ssl://electrum.blockstream.info:60002',\n  sock5: null,\n  retry: 5,\n  timeout: 5,\n  stopGap: 500,\n  validateDomain: false,\n};\n\nconst blockchain = await new Blockchain().create(config);\nconst dbConfig = await new DatabaseConfig().memory();\n\nconst wallet = await new Wallet().create(externalDescriptor, internalDescriptor, Network.Testnet, dbConfig);\nawait wallet.sync(blockchain);\n```\n\n### Create a `public` wallet descriptor\n\n```ts\nimport { DescriptorSecretKey, Mnemonic, Descriptor } from 'bdk-rn';\nimport { WordCount, Network, KeychainKind } from 'bdk-rn/lib/lib/enums';\n\n// ....\n\nconst mnemonic = await new Mnemonic().create(WordCount.WORDS12);\nconst descriptorSecretKey = await new DescriptorSecretKey().create(Network.Testnet, mnemonic);\nconst descriptorPublicKey = await descriptorSecretKey.asPublic();\nconst fingerprint = 'd1d04177';\nconst externalPublicDescriptor = await new Descriptor().newBip84Public(\n  descriptorPublicKey,\n  fingerprint,\n  KeychainKind.External,\n  Network.Testnet\n);\n```\n\n### Store wallet data persistently\n```ts\nimport RNFS from 'react-native-fs'\nimport { DatabaseConfig, ... } from 'bdk-rn';\n\n// create sqlite database config with rn document directory path\nconst dbConfig = await new DatabaseConfig().sqlite(`${RNFS.DocumentDirectoryPath}/bdk-wallet`)\n\n```\n\n### References:\n\n- Setting up a local Esplora instance for testing:\n  https://bitcoin.stackexchange.com/questions/116937/how-do-i-setup-an-esplora-instance-for-local-testing/116938#116938\n\n---\n\n_Note: Caution this is an Alpha at this stage\nPlease consider reviewing, experimenting and contributing ⚡️_\n\nThanks for taking a look!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLtbLightning%2Fbdk-rn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLtbLightning%2Fbdk-rn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLtbLightning%2Fbdk-rn/lists"}