Code Monkey home page Code Monkey logo

descriptor-wallet's Introduction

Descriptor wallet library

Build Tests Lints codecov

crates.io Docs unsafe forbidden Apache2 licensed

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 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 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

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):

$ 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.

Install with Docker

Build

Clone the repository and checkout to the desired version (here v0.8.0):

$ git clone https://github.com/BP-WG/descriptor-wallet
$ cd descriptor-wallet
$ git checkout v0.8.0

Build and tag the Docker image:

$ docker build -t descriptor-wallet:v0.8.0 .

Usage

$ docker run descriptor-wallet:v0.8.0 btc-hot --help
$ docker run descriptor-wallet:v0.8.0 btc-cold --help

Examples with files

$ 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

descriptor-wallet's People

Contributors

dr-orlovsky avatar kaiwolfram avatar cryptoquick avatar crisdut avatar louneskmt avatar nicbus avatar btcparadigm avatar zoedberg avatar claudiosdc avatar shesek avatar ukolovaolga avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.