{"id":29308631,"url":"https://github.com/kristoferlund/bitcoin_wallet","last_synced_at":"2026-04-11T10:36:13.043Z","repository":{"id":302522471,"uuid":"1011831090","full_name":"kristoferlund/bitcoin_wallet","owner":"kristoferlund","description":"A multiuser Bitcoin wallet built on the Internet Computer (ICP)","archived":false,"fork":false,"pushed_at":"2025-08-15T12:22:08.000Z","size":986,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-22T07:24:30.378Z","etag":null,"topics":["bitcoin","bitcoin-wallet","internet-computer","react","rust","vite"],"latest_commit_sha":null,"homepage":"https://unenw-dyaaa-aaaac-a3e6a-cai.icp0.io/","language":"TypeScript","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/kristoferlund.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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-01T12:00:02.000Z","updated_at":"2025-09-24T22:35:23.000Z","dependencies_parsed_at":"2025-08-11T12:18:04.181Z","dependency_job_id":"6ac642a5-8f6e-4e87-9b4e-a802f7d307ac","html_url":"https://github.com/kristoferlund/bitcoin_wallet","commit_stats":null,"previous_names":["kristoferlund/bitcoin_wallet"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kristoferlund/bitcoin_wallet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristoferlund%2Fbitcoin_wallet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristoferlund%2Fbitcoin_wallet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristoferlund%2Fbitcoin_wallet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristoferlund%2Fbitcoin_wallet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kristoferlund","download_url":"https://codeload.github.com/kristoferlund/bitcoin_wallet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristoferlund%2Fbitcoin_wallet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31677819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T08:18:19.405Z","status":"ssl_error","status_checked_at":"2026-04-11T08:17:08.892Z","response_time":54,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bitcoin","bitcoin-wallet","internet-computer","react","rust","vite"],"created_at":"2025-07-07T07:14:28.213Z","updated_at":"2026-04-11T10:36:12.383Z","avatar_url":"https://github.com/kristoferlund.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A multiuser Bitcoin wallet built on the Internet Computer (ICP)\n\nThis multiuser Bitcoin wallet allows the user to generate a Bitcoin\naddress by logging in with their Internet Identity. The user can then send and receive Bitcoin to other users.\n\nThe backend canister uses the [ICP Bitcoin API](https://internetcomputer.org/docs/build-on-btc/) to interact with the Bitcoin blockchain.\n\nThe frontend is built with React and Vite.\n\n\u003e [!TIP]\n\u003e Use this repository as a starting point for building your own multiuser Bitcoin wallet on the Internet Computer.\n\n[![Contributors][contributors-shield]][contributors-url]\n[![Forks][forks-shield]][forks-url]\n[![Stargazers][stars-shield]][stars-url]\n[![Issues][issues-shield]][issues-url]\n[![MIT License][license-shield]](LICENSE)\n\n\n## Try it!\n\nICP Ninja is a browser IDE for creating Internet Computer (ICP) smart contracts. Write and deploy entire applications directly onchain from the browser. Deploy this example in less than a minute:\n\n[![](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/kristoferlund/bitcoin_wallet/tree/ninja)\n\nYou can also try two predeployed versions of the wallet:\n\nMainnet: \u003chttps://unenw-dyaaa-aaaac-a3e6a-cai.icp0.io\u003e\n\nTestnet: \u003chttps://mcejh-aqaaa-aaaan-qz4la-cai.icp0.io\u003e\n\n![](./media/screenshot.png)\n\n## Project notes\n\nAt all times when interacting with canisters on the IC you should consider the\ncosts involved, and the fact that update calls take 2-3 seconds to complete. To\ncreate a good user experience, this wallet uses a combination of local state and\ncanister calls to provide a responsive UI.\n\n- The Bitcoin address is stored in local state after the user logs in. Next\n  time the user logs in, the address is retrieved from local state.\n- The balance of the Bitcoin address is queried from the backend canister that in\n  turn queries the ICP Bitcoin API. A more efficient way to query the balance would be to call an external Bitcoin API directly from the frontend.\n\n\u003e [!IMPORTANT]\n\u003e This project is not affiliated with or endorsed by the DFINITY Foundation. It has not undergone any formal security review and is intended for educational and experimental purposes only. Do not use this code in production environments.\n\n## Setup, pre-requisites\n\nSetup your Internet Computer developer environment as well as a local Bitcoin testnet.\n\n[https://internetcomputer.org/docs/build-on-btc/btc-dev-env](https://internetcomputer.org/docs/build-on-btc/btc-dev-env)\n\n## Deploying the project\n\n### 1. Start the Internet Computer with Bitcoin support enabled\n\n```bash\ndfx start --clean --enable-bitcoin --bitcoin-node 127.0.0.1:18444\n```\n\n### 2. Install dependencies\n\n```\npnpm install\n```\n\n### 3. Deploy the canisters\n\n```\ndfx deploy\n```\n\nWhen asked to select a network, choose `regtest`.\n\n\u003e [!TIP]\n\u003e If you get a permissions error when deploying, you might need to set the execute\n\u003e bit on the build script.\n\u003e\n\u003e ```\n\u003e chmod +x build.sh\n\u003e ```\n\n## Develop\n\nDuring development, you can run the frontend with hot reloading using Vite.\n\n```bash\npnpm run dev\n```\n\n## Before you start testing\n\n\u003e [!IMPORTANT]\n\u003e The Bitcoin \"coinbase maturity rule\" states that in order to spend newly created Bitcoin, it has to be at least 100 blocks old.\n\u003e\n\u003e Before you create any transactions, mine at least 100 blocks and assign yourself the Bitcoin rewards.\n\u003e\n\u003e ```\n\u003e bitcoin-cli -conf=$(pwd)/bitcoin.conf generatetoaddress 100 \u003caddress\u003e\n\u003e```\n\u003e\n\u003e Also important, the local regtest network does not mine blocks automatically. You will need to mine blocks manually using the `bitcoin-cli` command after any transaction. Use the above command to mine blocks.\n\n## Backend canister methods\n\n### `get_address`\n\nGet the Bitcoin address for the calling principal or for the principal\nspecified in the call parameters.\n\nCall signature:\n\n```\ntype AddressResult = variant { Ok : text; Err : text };\n\nget_address : (owner: opt principal) -\u003e (AddressResult);\n```\n\nGet the Bitcoin address for the calling principal:\n\n```bash\ndfx canister call backend get_address\n```\n\nGet the Bitcoin address for a specified principal:\n\n```bash\ndfx canister call backend get_address '(opt principal \"hkroy-sm7vs-yyjs7-ekppe-qqnwx-hm4zf-n7ybs-titsi-k6e3k-ucuiu-uqe\")'\n```\n\n### `get_balance`\n\nReturns the Bitcoin balance of the address controlled by a principal.\n\nCall signature:\n\n```\ntype BalanceResult = variant { Ok : nat64; Err : text };\n\nget_balance : (owner: opt principal) -\u003e (BalanceResult);\n```\n\nGet the Bitcoin balance for the calling principal:\n\n```bash\ndfx canister call backend get_balance\n```\n\nGet the Bitcoin balance for a specified principal:\n\n```bash\ndfx canister call backend get_balance '(opt principal \"hkroy-sm7vs-yyjs7-ekppe-qqnwx-hm4zf-n7ybs-titsi-k6e3k-ucuiu-uqe\")'\n```\n\n### `send_btc`\n\nSends Bitcoin from the address controlled by the calling principal to any\nrecipient.\n\nCall signature:\n\n```\ntype SendResult = variant { Ok : text; Err : text };\n\nsend_btc : (destination_address : BitcoinAddress, amount_in_satoshi : Satoshi) -\u003e (SendResult);\n```\n\nSend Bitcoin by specifying receiver address and amount (in satoshi):\n\n```bash\ndfx canister call backend send_btc '(\"bcrt1pvd8yj03ts02lleztzf3em0glwrw7p03lumk4s6jv602ymzgc5jcqf2gsz8\", 1000)'\n```\n\n## Contributors\n\n\u003c!-- readme: collaborators,contributors -start --\u003e\n\u003ctable\u003e\n\t\u003ctbody\u003e\n\t\t\u003ctr\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://github.com/kristoferlund\"\u003e\n                    \u003cimg src=\"https://avatars.githubusercontent.com/u/9698363?v=4\" width=\"100;\" alt=\"kristoferlund\"/\u003e\n                    \u003cbr /\u003e\n                    \u003csub\u003e\u003cb\u003eKristofer\u003c/b\u003e\u003c/sub\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n\t\t\u003c/tr\u003e\n\t\u003ctbody\u003e\n\u003c/table\u003e\n\u003c!-- readme: collaborators,contributors -end --\u003e\n\n## License\n\nThis project is licensed under the MIT License. See the LICENSE file for more\ndetails.\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request if you\nhave any suggestions or improvements.\n\n[contributors-shield]: https://img.shields.io/github/contributors/kristoferlund/bitcoin_wallet.svg?style=for-the-badge\n[contributors-url]: https://github.com/kristoferlund/bitcoin_wallet/graphs/contributors\n[forks-shield]: https://img.shields.io/github/forks/kristoferlund/bitcoin_wallet.svg?style=for-the-badge\n[forks-url]: https://github.com/kristoferlund/bitcoin_wallet/network/members\n[stars-shield]: https://img.shields.io/github/stars/kristoferlund/bitcoin_wallet?style=for-the-badge\n[stars-url]: https://github.com/kristoferlund/bitcoin_wallet/stargazers\n[issues-shield]: https://img.shields.io/github/issues/kristoferlund/bitcoin_wallet.svg?style=for-the-badge\n[issues-url]: https://github.com/kristoferlund/bitcoin_wallet/issues\n[license-shield]: https://img.shields.io/github/license/kristoferlund/bitcoin_wallet.svg?style=for-the-badge\n[license-url]: https://github.com/kristoferlund/bitcoin_wallet/blob/master/LICENSE.txt\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkristoferlund%2Fbitcoin_wallet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkristoferlund%2Fbitcoin_wallet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkristoferlund%2Fbitcoin_wallet/lists"}