Giter Site home page Giter Site logo

bdk_core_staging's Introduction

BDK core staging

โš  THIS REPO IS ARCHIVED -- ALL THE CONTRIBUTIONS HERE HAVE BEEN MERGED INTO BDK's repo. Please re-submit PRs over there as appropriate. Thanks!

This is a repo for building out bdk_core before it can be integrated into bdk.

Components

The bdk_core project has three main components in order of importance:

1. bdk_chain

The goal of this component is give wallets the mechanisms needed to:

  1. Figure out what data they need to fetch.
  2. Process that data in a way that never leads to inconsistent states.
  3. Fully index that data and expose it so that it can be consumed without friction.

Our design goals for these mechanisms are:

  1. Data source agnostic -- nothing in bdk_chain cares about where you get data from or whether you do it synchronously or asynchronously. If you know a fact about the blockchain you can just tell bdk_chain's APIs about it and that information will be integrated if it can be done consistently.
  2. Error free APIs.
  3. Data persistence agnostic -- bdk_chain does not care where you cache on-chain data, what you cache or how you fetch it.

TODO:

  • Chain and data indexing
  • Persistant storage (see bdk_file_store)
  • Working esplora example (see bdk_esplora_example)
  • Working electrum example (see bdk_electrum_example)
  • Working bitcoin core rpc block-by-block example (see #157)
  • Working bitcoin core rpc wallet sync example (see #170)
  • Working compact block filters example using nakamoto (see #153)
  • Improve API for block-by-block syncing -- i.e. CBF and RPC Chain
  • Feerate calculation for CPFP

2. Miniscript planning module

This component is about properly using miniscript's potential to know exactly which outputs you can spend and the most efficient way to spend them before trying to spend them. This allows you to know precisely how much weight spending an output will add for coin selection. This is an important feature in a taproot world since different spending paths can have vastly different weight.

The PR to miniscript has already been made: rust-bitcoin/rust-miniscript#481

3. Coin selection, transaction building and signing

With the planning module, we'll be able to re-engineer coin selection and transaction building as well.

Coin selection

We've designed and implemented a robust coin selection API which allows users to choose what metric they want to optimise for during a branch and bound search.

Coin selection PR: #46

Transaction building

Transaction building issue: #30

Development and Release plan

The release dates for the first release we will try to make for the first releases are:

  • 10-02-2023: Release bdk_chain v0.1.0 -- working with esplora/electrum data
  • 24-02-2023: Release bdk v1.0.0-alpha.0
  • 10-03-2023: Release bdk_chain v.2.0 -- working with blocks form CBF and bitcoin RPC
  • 24-03-2023: Release bdk v1.0.0-alpha.1

From there we will continue to develop bdk_chain and the other components and as they are integrated into bdk we will continue to make new alpha/beta releases of bdk until we have something suitable for a release candidate. Before making a release candidate we'll need the planning module to be merged into miniscript and released.

Try it out

We have examples in their own crates like bdk_esplora_example and bdk_electrum_example with more coming soon.

To use them move into the directory and try running some commands. First you'll need to set some descriptors.

export DESCRIPTOR="tr([73c5da0a/86'/0'/0']xprv9xgqHN7yz9MwCkxsBPN5qetuNdQSUttZNKw1dcYTV4mkaAFiBVGQziHs3NRSWMkCzvgjEe3n9xV8oYywvM8at9yRqyaZVz6TYYhX98VjsUk/0/*)" CHANGE_DESCRIPTOR="tr([73c5da0a/86'/0'/0']xprv9xgqHN7yz9MwCkxsBPN5qetuNdQSUttZNKw1dcYTV4mkaAFiBVGQziHs3NRSWMkCzvgjEe3n9xV8oYywvM8at9yRqyaZVz6TYYhX98VjsUk/1/*)"

Initialize the data from the chain

cargo run -- scan # for electrum and esplora
cargo run -- balance

A plain BIP86 TR wallet

cargo run -- address list
cargo run -- address next
cargo run -- send 10000 <the new address>

Script path spending works too

export DESCRIPTOR="tr(xpub6BgBgsespWvERF3LHQu6CnqdvfEvtMcQjYrcRzx53QJjSxarj2afYWcLteoGVky7D3UKDP9QyrLprQ3VCECoY49yfdDEHGCtMMj92pReUsQ/0/*,pk(xprv9s21ZrQH143K3ngkqk9y72BYSJTZ1ngfTFGFtxCwfP9pKqcMzn6aCP3mZoY8qMEqUjkxC2BkDUVLw77qbyGt66BbE7g3nt8JAGGkcTe4kWZ/0/*))"

Contribute

  • open issues with respect to any aspect of the project
  • make PRs

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.