Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Benjamin-Loison/Internet-Computer-Bitcoin-Library
https://github.com/Benjamin-Loison/Internet-Computer-Bitcoin-Library
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/Benjamin-Loison/Internet-Computer-Bitcoin-Library
- Owner: Benjamin-Loison
- License: mit
- Created: 2022-10-13T08:43:54.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-17T14:03:12.000Z (about 2 years ago)
- Last Synced: 2024-08-02T06:17:41.259Z (3 months ago)
- Language: Rust
- Size: 72.3 KB
- Stars: 10
- Watchers: 2
- Forks: 1
- Open Issues: 16
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
Awesome Lists containing this project
- awesome-internet-computer - Internet Computer Bitcoin Library - Utility libraries for Motoko/Rust to simplify building on the Bitcoin Integration. (Chain Fusion / Bitcoin)
README
:hardbreaks-option:
= Internet Computer Bitcoin Library
The library provides Bitcoin functionality built on top of the low-level Bitcoin integration API.
The library provides the following functionality:* It can generate and manage Bitcoin addresses, supporting various address types.
* Given a valid Bitcoin address, it can get the unspent transaction outputs (UTXOs) and the balance of it.
* It can send bitcoins using UTXOs collected from managed addresses with various options to set the transaction fee.
// * It can update unconfirmed Bitcoins transactions.
* It can get current Bitcoin transaction fees.The library supports local deployments in Bitcoin regtest mode and in Bitcoin testnet mode when running on the Internet Computer.
//* Motoko documentation is available xref:motoko/README.adoc[here].
* Rust documentation is available https://docs.rs/ic-btc-library[here].== Disclaimer
While the library is reasonably well tested, it is still under development, therefore use it *at your own risk*.
This library is *work in progress* and is *not production-grade* yet. At least the following aspects of the library need further consideration before using it in production use cases:
* Canister upgradability and management of state related to the library requires further consideration before the library can be used in production. If upgradeability of a canister w.r.t. the replicated state managed by the library is flawed, we risk canisters to break on an upgrade in production, in the worst case in a non-recoverable or hard-to-recover fashion.
* More test coverage would be important for some parts of the code.
* We have not gained much experience yet in using the library in real-world use cases.== Networks
During your canister development, you might be interested in testing your canister with fake bitcoins. In order to do this, you can run a local Bitcoin blockchain in https://developer.bitcoin.org/examples/testing.html#regtest-mode[Regtest mode].
For more details, see here://* xref:motoko/docs/testing-locally.adoc[Motoko documentation].
* https://docs.rs/ic-btc-library#4-testing-locally[Rust documentation].If you are more confident with your canister code, you can deploy it on the Internet Computer but continue to use fake Bitcoin by making use of the https://developer.bitcoin.org/examples/testing.html#testnet[Bitcoin testnet].
If you want to put your canister into production using real bitcoins, you can then switch over to Bitcoin mainnet.== Release notes
=== Features to come
This first version only supports Rust, however support for Motoko will be added soon.
*Update unconfirmed transactions using replace-by-fee.*
Canisters will be able to update unconfirmed transactions using https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki[replace-by-fee] by issuing a new transaction with a higher transaction fee.
*Furthermore two simple examples using the `ic-btc-library` will be provided.*
1. The https://github.com/dfinity/bitcoin-developer-preview[bitcoin-developer-preview] which showcases how developers can use the library.
2. The https://github.com/dfinity/examples/tree/bitcoin_wallet/rust/bitcoin_wallet[sample dApp] which is a Bitcoin wallet running fully on the Internet Computer.