Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bp-wg/descriptor-wallet
Library for building descriptor-based bitcoin wallets using rust-bitcoin
https://github.com/bp-wg/descriptor-wallet
Last synced: about 4 hours ago
JSON representation
Library for building descriptor-based bitcoin wallets using rust-bitcoin
- Host: GitHub
- URL: https://github.com/bp-wg/descriptor-wallet
- Owner: BP-WG
- License: apache-2.0
- Created: 2021-01-18T19:42:36.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-06-28T10:06:38.000Z (7 months ago)
- Last Synced: 2024-11-24T19:44:23.197Z (about 2 months ago)
- Language: Rust
- Homepage:
- Size: 1.42 MB
- Stars: 58
- Watchers: 11
- Forks: 26
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Descriptor wallet library
![Build](https://github.com/BP-WG/descriptor-wallet/workflows/Build/badge.svg)
![Tests](https://github.com/BP-WG/descriptor-wallet/workflows/Tests/badge.svg)
![Lints](https://github.com/BP-WG/descriptor-wallet/workflows/Lints/badge.svg)
[![codecov](https://codecov.io/gh/BP-WG/descriptor-wallet/branch/master/graph/badge.svg)](https://codecov.io/gh/BP-WG/descriptor-wallet)[![crates.io](https://img.shields.io/crates/v/descriptor-wallet)](https://crates.io/crates/descriptor-wallet)
[![Docs](https://docs.rs/descriptor-wallet/badge.svg)](https://docs.rs/descriptor-wallet)
[![unsafe forbidden](https://img.shields.io/badge/unsafe-forbidden-success.svg)](https://github.com/rust-secure-code/safety-dance/)
[![Apache2 licensed](https://img.shields.io/badge/license-Apache%202-blue)](./LICENSE)Library for building descriptor-based bitcoin wallets. Everything a modern
cold and hot bitcoin wallet needs, but which is not (yet) a part of
[rust-bitcoin](https://crates.io/bitcoin) library.The library clearly separates parts requiring access to private keys from
those which should operate never touching them. It is advised that wallets
should be designed in a way assuming zero private key access for all of their
operations aside from transaction signing; this part must be separated into
other repository/library and be strictly controlled. One may look after
command-line `btc-hot` and `btc-cold` wallets in [`bin`](bin) directory for an
example of how this can be done.Library provides
- efficient manipulations with BIP-32 derivation paths, separating derivations
requiring private key access from those, which will always operate without;
- miniscript & classical bitcoin descriptors;
- PSBT constructor using input descriptors, which allow to specify custom
information about RBFs, previous public key P2C tweaks and custom hash types
on a per-input basis;
- PSBT signer, supporting RBFs, relative and absolute timelocks, all sighash
types, complex scripts, including witness- and taproot-based;
- script templates allowing embedding extended pubkeys into bitcoin script
assembly;
- lexicographic ordering of transaction & PSBT inputs & oututs;
- script type system;
- helper types for working with hash-lock contracts;
- PSBT utility functions (retrieving previous output, computing fee);
- transaction resolver API on top of Electrum Server API for convenience
computation of already-mined transaction fees etc;
- support for SLIP-32/132 extended pubkey types (`ypub`, `zprv` etc).![Wallet comparison diagram](./doc/assets/comparison.png)
## Command-line wallets
One may install command-line wallets with the following command (requires
rust compiler and `rustup` tools to be already installed on a system):```console
$ rustup default stable
$ rustup update
$ git clone https://github.com/BP-WG/descriptor-wallet
$ cd descriptor-wallet
$ cargo install --path . --locked --all-features
```This will add `btc-hot` and `btc-cold` commands to the system.
[bin]: https://github.com/BP-WG/descriptor-wallet/tree/master/src/bin
### Install with Docker
#### Build
Clone the repository and checkout to the desired version (here `v0.8.0`):
```console
$ git clone https://github.com/BP-WG/descriptor-wallet
$ cd descriptor-wallet
$ git checkout v0.8.0
```Build and tag the Docker image:
```console
$ docker build -t descriptor-wallet:v0.8.0 .
```#### Usage
```console
$ docker run descriptor-wallet:v0.8.0 btc-hot --help
$ docker run descriptor-wallet:v0.8.0 btc-cold --help
```#### Examples with files
```console
$ docker run -v $PWD/data:/data descriptor-wallet:v0.8.0 btc-hot seed /data/testnet.seed
$ docker run -v $PWD/data:/data descriptor-wallet:v0.8.0 btc-hot derive --testnet /data/testnet.seed /data/testnet
```