All notable changes to this project can be found here and in each release's git tag and can be viewed with git tag -ln100 "v*"
. See also DEVELOPMENT_CYCLE.md for more details.
Contributors do not need to change this file but do need to add changelog details in their PR descriptions. The person making the next release will collect changelog details from included PRs and edit this file prior to each release.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Fixes RUSTSEC-2022-0090, this issue is only applicable if you are using the optional sqlite database feature.
- Update optional sqlite dependency from 0.27.0 to 0.28.0. #867
A maintenance release with a bump in project MSRV to 1.57.0, updated dependence and a few developer oriented improvements. Improvements include better error formatting, don't default to async/await for wasm32 and adding derived PartialEq and Eq on SyncTime.
- Improve display error formatting #814
- Don't default to use async/await on wasm32 #831
- Project MSRV changed from 1.56.1 to 1.57.0 #842
- Update rust-miniscript dependency to latest bug fix release 9.0 #844
- Derive PartialEq, Eq on SyncTime #837
This release improves Fulcrum electrum server compatibility and fixes public descriptor template key origin paths. We also snuck in small enhancements to configure the electrum client to validate the domain using SSL and sort TransactionDetails by block height and timestamp.
- Make electrum blockchain client
save_tx
function order independent to work with Fulcrum servers. #808 - Fix wrong testnet key origin path in public descriptor templates. #818
- Make README.md code examples compile without errors. #820
- Bump
hwi
dependency to0.4.0
. #825 - Bump
esplora-client
dependency to0.3
#830
- For electrum blockchain client, allow user to configure whether to validate the domain using SSL. #805
- Implement ordering for
TransactionDetails
. #812
This release fixes slow sync time and big script_pubkeys table with SQLite, the wallet rescan height for the FullyNodedExport and setting the network for keys in the KeyMap when using descriptor templates. Also added are new blockchain and mnemonic examples.
- Slow sync time and big script_pubkeys table with SQLite.
- Wallet rescan height for the FullyNodedExport.
- Setting the network for keys in the KeyMap when using descriptor templates.
- Examples for connecting to Esplora, Electrum Server, Neutrino and Bitcoin Core.
- Example for using a mnemonic in a descriptors.
This release contains important dependency updates for rust-bitcoin
to 0.29
and rust-miniscript
to 8.0
, plus related crates that also depend on the latest version of rust-bitcoin
. The release also includes a breaking change to the BDK signer which now produces low-R signatures by default, saving one byte. A bug was found in the get_checksum
and get_checksum_bytes
functions, which are now deprecated in favor of fixed versions called calc_checksum
and calc_checksum_bytes
. And finally a new hardware-signer
features was added that re-exports the hwi
crate, along with a new hardware_signers.rs
example file.
- Updated dependency versions for
rust-bitcoin
to0.29
andrust-miniscript
to8.0
, plus all related crates. @afilini #770 - BDK Signer now produces low-R signatures by default, saving one byte. If you want to preserve the original behavior, set allow_grinding in the SignOptions to false. @vladimirfomene #779
- Deprecated
get_checksum
andget_checksum_bytes
due to bug where they calculates the checksum of a descriptor that already has a checksum. Usecalc_checksum
andcalc_checksum_bytes
instead. @evanlinjin #765 - Remove deprecated "address validators". @afilini #770
- New
calc_checksum
andcalc_checksum_bytes
, replace deprecatedget_checksum
andget_checksum_bytes
. @evanlinjin #765 - Re-export the hwi crate when the feature hardware-signer is on. @danielabrozzoni #758
- New examples/hardware_signer.rs. @danielabrozzoni #758
- Make psbt module public to expose PsbtUtils trait to downstream projects. @notmandatory #782
This release brings new utilities functions on PSBTs like fee_amount()
and fee_rate()
and migrates BDK to use our new external esplora client library.
As always many bug fixes, docs and tests improvement are also included.
- Update electrum-client to 0.11.0 by @afilini in bitcoindevkit#737
- Change configs for source-base code coverage by @wszdexdrf in bitcoindevkit#708
- Improve docs regarding PSBT finalization by @tnull in bitcoindevkit#753
- Update compiler example to a Policy example by @rajarshimaitra in bitcoindevkit#730
- Fix the release process by @afilini in bitcoindevkit#754
- Remove redundant duplicated keys check by @afilini in bitcoindevkit#761
- Remove genesis_block lazy initialization by @shobitb in bitcoindevkit#756
- Fix
Wallet::descriptor_checksum
to actually return the checksum by @evanlinjin in bitcoindevkit#763 - Use the esplora client crate by @afilini in bitcoindevkit#764
- Run code coverage on every PR by @danielabrozzoni in bitcoindevkit#747
- Add psbt_signer.rs example by @notmandatory in bitcoindevkit#744
- Add fee_amount() and fee_rate() functions to PsbtUtils trait by @notmandatory in bitcoindevkit#728
- Add tests to improve coverage by @vladimirfomene in bitcoindevkit#745
- Enable signing taproot transactions with only
non_witness_utxos
by @afilini in bitcoindevkit#757 - Add datatype for is_spent sqlite column by @vladimirfomene in bitcoindevkit#713
- Add vscode filter to gitignore by @evanlinjin in bitcoindevkit#762
This release brings support for hardware signers on desktop through the HWI library. It also includes fixes and improvements which are part of our ongoing effort of integrating BDK and LDK together.
- FeeRate function name as_sat_vb to as_sat_per_vb. #678
- Verify signatures after signing. #718
- Dependency electrum-client to 0.11.0. #737
- Functions to create FeeRate from sats/kvbytes and sats/kwu. #678
- Custom hardware wallet signer HwiSigner in wallet::hardwaresigner module. #682
- Function allow_dust on TxBuilder. #689
- Implementation of Deref<Target=UrlClient> for EsploraBlockchain. #722
- Implementation of Deref<Target=Client> for ElectrumBlockchain #705
- Implementation of Deref<Target=Client> for RpcBlockchain. #731
- Add
descriptor::checksum::get_checksum_bytes
method. - Add
Excess
enum to handle remaining amount after coin selection. - Move change creation from
Wallet::create_tx
toCoinSelectionAlgorithm::coin_select
. - Change the interface of
SqliteDatabase::new
to accept any type that implement AsRef - Add the ability to specify which leaves to sign in a taproot transaction through
TapLeavesOptions
inSignOptions
- Add the ability to specify whether a taproot transaction should be signed using the internal key or not, using
sign_with_tap_internal_key
inSignOptions
- Consolidate params
fee_amount
andamount_needed
intarget_amount
inCoinSelectionAlgorithm::coin_select
signature. - Change the meaning of the
fee_amount
field insideCoinSelectionResult
: from now on thefee_amount
will represent only the fees asociated with the utxos in theselected
field ofCoinSelectionResult
. - New
RpcBlockchain
implementation with various fixes. - Return balance in separate categories, namely
confirmed
,trusted_pending
,untrusted_pending
&immature
.
- New MSRV set to
1.56.1
- Fee sniping discouraging through nLockTime - if the user specifies a
current_height
, we use that as a nlocktime, otherwise we use the last sync height (or 0 if we never synced) - Fix hang when
ElectrumBlockchainConfig::stop_gap
is zero. - Set coin type in BIP44, BIP49, and BIP84 templates
- Get block hash given a block height - A
get_block_hash
method is now defined on theGetBlockHash
trait and implemented on every blockchain backend. This method expects a block height and returns the corresponding block hash. - Add
remove_partial_sigs
andtry_finalize
toSignOptions
- Deprecate
AddressValidator
- Fix Electrum wallet sync potentially causing address index decrement - compare proposed index and current index before applying batch operations during sync.
- added
OldestFirstCoinSelection
impl toCoinSelectionAlgorithm
- New MSRV set to
1.56
- Unpinned tokio to
1
- Add traits to reuse
Blockchain
s across multiple wallets (BlockchainFactory
andStatelessBlockchain
). - Upgrade to rust-bitcoin
0.28
- If using the
sqlite-db
feature all cached wallet data is deleted due to a possible UTXO inconsistency, a wallet.sync will recreate it - Update
PkOrF
in the policy module to become an enum - Add experimental support for Taproot, including:
- Support for
tr()
descriptors with complex tapscript trees - Creation of Taproot PSBTs (BIP-371)
- Signing Taproot PSBTs (key spend and script spend)
- Support for
tr()
descriptors in thedescriptor!()
macro
- Support for
- Add support for Bitcoin Core 23.0 when using the
rpc
blockchain
- Add
sqlite-bundled
feature for deployments that need a bundled version of sqlite, i.e. for mobile platforms. - Added
Wallet::get_signers()
,Wallet::descriptor_checksum()
andWallet::get_address_validators()
, exposed theAsDerived
trait. - Deprecate
database::Database::flush()
, the function is only needed for the sled database on mobile, instead for mobile use the sqlite database. - Add
keychain: KeychainKind
towallet::AddressInfo
. - Improve key generation traits
- Rename
WalletExport
toFullyNodedExport
, deprecate the former. - Bump
miniscript
dependency version to^6.1
.
- Removed default verification from
wallet::sync
. sync-time verification is added inscript_sync
and is activated byverify
feature flag. verify
flag removed fromTransactionDetails
.- Add
get_internal_address
to allow you to get internal addresses just as you get external addresses. - added
ensure_addresses_cached
toWallet
to let offline wallets load and cache addresses in their database - Add
is_spent
field toLocalUtxo
; when we notice that a utxo has been spent we setis_spent
field to true instead of deleting it from the db.
To decouple the Wallet
from the Blockchain
we've made major changes:
- Removed
Blockchain
from Wallet. - Removed
Wallet::broadcast
(just useBlockchain::broadcast
) - Deprecated
Wallet::new_offline
(all wallets are offline now) - Changed
Wallet::sync
to take aBlockchain
. - Stop making a request for the block height when calling
Wallet:new
. - Added
SyncOptions
to capture extra (future) arguments toWallet::sync
. - Removed
max_addresses
sync parameter which determined how many addresses to cache before syncing since this can just be done withensure_addresses_cached
. - remove
flush
method from theDatabase
trait.
- Pin tokio dependency version to ~1.14 to prevent errors due to their new MSRV 1.49.0
- Disable
reqwest
default features. - Added
reqwest-default-tls
feature: Use this to restore the TLS defaults of reqwest if you don't want to add a dependency to it in your own manifest. - Use dust_value from rust-bitcoin
- Fixed generating WIF in the correct network format.
- Overhauled sync logic for electrum and esplora.
- Unify ureq and reqwest esplora backends to have the same configuration parameters. This means reqwest now has a timeout parameter and ureq has a concurrency parameter.
- Fixed esplora fee estimation.
- BIP39 implementation dependency, in
keys::bip39
changed from tiny-bip39 to rust-bip39. - Add new method on the
TxBuilder
to embed data in the transaction viaOP_RETURN
. To allow that a fix to check the dust only on spendable output has been introduced. - Update the
Database
trait to store the last sync timestamp and block height - Rename
ConfirmationTime
toBlockTime
- Exposed
get_tx()
method fromDatabase
toWallet
.
- Activate
miniscript/use-serde
feature to allow consumers of the library to access it via the re-exportedminiscript
crate. - Add support for proxies in
EsploraBlockchain
- Added
SqliteDatabase
that implementsDatabase
backed by a sqlite database usingrusqlite
crate.
- Added
flush
method to theDatabase
trait to explicitly flush to disk latest changes on the db.
- Added
RpcBlockchain
in theAnyBlockchain
struct to allow using Rpc backend whereAnyBlockchain
is used (egbdk-cli
) - Removed hard dependency on
tokio
.
- Removed and replaced
set_single_recipient
with more generaldrain_to
and replacedmaintain_single_recipient
withallow_shrinking
.
- Removed
stop_gap
fromBlockchain
trait and added it to onlyElectrumBlockchain
andEsploraBlockchain
structs. - Added a
ureq
backend for use when not using featureasync-interface
or target WASM.ureq
is a blocking HTTP client.
- Added Bitcoin core RPC added as blockchain backend
- Added a
verify
feature that can be enable to verify the unconfirmed txs we download against the consensus rules
- Added an option that must be explicitly enabled to allow signing using non-
SIGHASH_ALL
sighashes (#350)
get_address
now returns an AddressInfo
struct that includes the index and derefs to Address
.
Removed fill_satisfaction
method in favor of enum parameter in extract_policy
method
Timelocks are considered (optionally) in building the satisfaction
field
- Changed
Wallet::{sign, finalize_psbt}
now take a&mut psbt
rather than consuming it. - Require and validate
non_witness_utxo
for SegWit signatures by default, can be adjusted withSignOptions
- Replace the opt-in builder option
force_non_witness_utxo
with the oppositeonly_witness_utxo
. From now on we will provide thenon_witness_utxo
, unless explicitly asked not to.
- New minimum supported rust version is 1.46.0
- Changed
AnyBlockchainConfig
to use serde tagged representation.
- Added ability to analyze a
PSBT
to check which and how many signatures are already available
get_new_address()
refactored toget_address(AddressIndex::New)
to support differentget_address()
index selection strategies
- Added
get_address(AddressIndex::LastUnused)
which returns the last derived address if it has not been used or if used in a received transaction returns a new address - Added
get_address(AddressIndex::Peek(u32))
which returns a derived address for a specified descriptor index but does not change the current index - Added
get_address(AddressIndex::Reset(u32))
which returns a derived address for a specified descriptor index and resets current index to the given value - Added
get_psbt_input
to create the corresponding psbt input for a local utxo.
- Fixed
coin_select
calculation for UTXOs wherevalue < fee
that caused over-/underflow errors.
- Pin
hyper
to=0.14.4
to make it compile on Rust 1.45
- Updated
electrum-client
to version0.7
FeeRate
constructorsfrom_sat_per_vb
anddefault_min_relay_fee
are nowconst
functions
- Renamed
DerivableKey::add_metadata()
toDerivableKey::into_descriptor_key()
- Renamed
ToDescriptorKey::to_descriptor_key()
toIntoDescriptorKey::into_descriptor_key()
- Added an
ExtendedKey
type that is an enum ofbip32::ExtendedPubKey
andbip32::ExtendedPrivKey
- Added
DerivableKey::into_extended_key()
as the only method that needs to be implemented
- Removed the
parse_descriptor
example, since it wasn't demonstrating any bdk-specific API anymore.
- Updated
bitcoin
to0.26
,miniscript
to5.1
andelectrum-client
to0.6
- Added support for the
signet
network (issue #62) - Added a function to get the version of BDK at runtime
- Removed the explicit
id
argument fromWallet::add_signer()
since that's now part ofSigner
itself - Renamed
ToWalletDescriptor::to_wallet_descriptor()
toIntoWalletDescriptor::into_wallet_descriptor()
- Removed unneeded
Result<(), PolicyError>
return type forSatisfaction::finalize()
- Removed the
TooManyItemsSelected
policy error (see commit message for more details)
- Added an alias
DescriptorError
fordescriptor::error::Error
- Changed the error returned by
descriptor!()
andfragment!()
toDescriptorError
- Changed the error type in
ToWalletDescriptor
toDescriptorError
- Improved checks on descriptors built using the macros
- Remove
BlockchainMarker
,OfflineClient
andOfflineWallet
in favor of just using the unit type to mark for a missing client. - Upgrade
tokio
to1.0
.
The TxBuilder
is now created from the build_tx
or build_fee_bump
functions on wallet and the
final transaction is created by calling finish
on the builder.
- Removed
TxBuilder::utxos
in favor ofTxBuilder::add_utxos
- Added
Wallet::build_tx
to replaceWallet::create_tx
- Added
Wallet::build_fee_bump
to replaceWallet::bump_fee
- Added
Wallet::get_utxo
- Added
Wallet::get_descriptor_for_keychain
- Renamed
UTXO
toLocalUtxo
- Added
WeightedUtxo
to replace floating(UTXO, usize)
. - Added
Utxo
enum to incorporate both local utxos and foreign utxos - Added
TxBuilder::add_foreign_utxo
which allows adding a utxo external to the wallet.
- Remove
cli.rs
module,cli-utils
feature andrepl.rs
example; moved to newbdk-cli
repository
- Add CONTRIBUTING.md
- Add a Discord badge to the README
- Add code coverage github actions workflow
- Add scheduled audit check in CI
- Add CHANGELOG.md
- Rename the library to
bdk
- Rename
ScriptType
toKeychainKind
- Prettify README examples on github
- Change CI to github actions
- Bump rust-bitcoin to 0.25, fix Cargo dependencies
- Enable clippy for stable and tests by default
- Switch to "mainline" rust-miniscript
- Generate a different cache key for every CI job
- Fix to at least bitcoin ^0.25.2
- Fix or ignore clippy warnings for all optional features except compact_filters
- Pin cc version because last breaks rocksdb build
- Add a trait to create
Blockchain
s from a configuration - Add an
AnyBlockchain
enum to allow switching at runtime - Document
AnyBlockchain
andConfigurableBlockchain
- Use our Instant struct to be compatible with wasm
- Make esplora call in parallel
- Allow to set concurrency in Esplora config and optionally pass it in repl
- Fix receiving a coinbase using Electrum/Esplora
- Use proper type for EsploraHeader, make conversion to BlockHeader infallible
- Eagerly unwrap height option, save one collect
- Simplify the architecture of blockchain traits
- Improve sync
- Remove unused varaint HeaderParseFail
- Conditionally remove cli args according to enabled feature
- Add max_addresses param in sync
- Split the internal and external policy paths
- Add
AnyDatabase
andConfigurableDatabase
traits
- Add a macro to write descriptors from code
- Add descriptor templates, add
DerivableKey
- Add ToWalletDescriptor trait tests
- Add support for
sortedmulti
indescriptor!
- Add ExtractPolicy trait tests
- Add get_checksum tests, cleanup tests
- Add descriptor macro tests
- Improve the descriptor macro, add traits for key and descriptor types
- Fix the recovery of a descriptor given a PSBT
- Add BIP39 support
- Take
ScriptContext
into account when converting keys - Add a way to restrict the networks in which keys are valid
- Add a trait for keys that can be generated
- Fix entropy generation
- Less convoluted entropy generation
- Re-export tiny-bip39
- Implement
GeneratableKey
trait forbitcoin::PrivateKey
- Implement
ToDescriptorKey
trait forGeneratedKey
- Add a shortcut to generate keys with the default options
- Fix all-keys and cli-utils tests
- Allow to define static fees for transactions Fixes #137
- Merging two match expressions for fee calculation
- Incorporate RBF rules into utxo selection function
- Add Branch and Bound coin selection
- Add tests for BranchAndBoundCoinSelection::coin_select
- Add tests for BranchAndBoundCoinSelection::bnb
- Add tests for BranchAndBoundCoinSelection::single_random_draw
- Add test that shwpkh populates witness_utxo
- Add witness and redeem scripts to PSBT outputs
- Add an option to include
PSBT_GLOBAL_XPUB
s in PSBTs - Eagerly finalize inputs
- Use collect to avoid iter unwrapping Options
- Make coin_select take may/must use utxo lists
- Improve
CoinSelectionAlgorithm
- Refactor
Wallet::bump_fee()
- Default to SIGHASH_ALL if not specified
- Replace ChangeSpendPolicy::filter_utxos with a predicate
- Make 'unspendable' into a HashSet
- Stop implicitly enforcing manaul selection by .add_utxo
- Rename DumbCS to LargestFirstCoinSelection
- Rename must_use_utxos to required_utxos
- Rename may_use_utxos to optional_uxtos
- Rename get_must_may_use_utxos to preselect_utxos
- Remove redundant Box around address validators
- Remove redundant Box around signers
- Make Signer and AddressValidator Send and Sync
- Split
send_all
intoset_single_recipient
anddrain_wallet
- Use TXIN_DEFAULT_WEIGHT constant in coin selection
- Replace
must_use
withrequired
in coin selection - Take both spending policies into account in create_tx
- Check last derivation in cache to avoid recomputation
- Use the branch-and-bound cs by default
- Make coin_select return UTXOs instead of TxIns
- Build output lookup inside complete transaction
- Don't wrap SignersContainer arguments in Arc
- More consistent references with 'signers' variables
- Fix signing for
ShWpkh
inputs - Fix the recovery of a descriptor given a PSBT
- Support esplora blockchain source in repl
- Revert back the REPL example to use Electrum
- Remove the
magic
alias forrepl
- Require esplora feature for repl example
- Use dirs-next instead of dirs since the latter is unmantained
0.1.0-beta.1 - 2020-09-08
- Lightweight Electrum client with SSL/SOCKS5 support
- Add a generalized "Blockchain" interface
- Add Error::OfflineClient
- Add the Esplora backend
- Use async I/O in the various blockchain impls
- Compact Filters blockchain implementation
- Add support for Tor
- Impl OnlineBlockchain for types wrapped in Arc
- Add a generalized database trait and a Sled-based implementation
- Add an in-memory database
- Wrap Miniscript descriptors to support xpubs
- Policy and contribution
- Transform a descriptor into its "public" version
- Use
miniscript::DescriptorPublicKey
- Add a feature to enable the async interface on non-wasm32 platforms
- Wallet logic
- Add
assume_height_reached
in PSBTSatisfier - Add an option to change the assumed current height
- Specify the policy branch with a map
- Add a few commands to handle psbts
- Add hd_keypaths to outputs
- Add a
TxBuilder
struct to simplifycreate_tx()
's interface - Abstract coin selection in a separate trait
- Refill the address pool whenever necessary
- Implement the wallet import/export format from FullyNoded
- Add a type convert fee units, add
Wallet::estimate_fee()
- TxOrdering, shuffle/bip69 support
- Add RBF and custom versions in TxBuilder
- Allow limiting the use of internal utxos in TxBuilder
- Add
force_non_witness_utxo()
to TxBuilder - RBF and add a few tests
- Add AddressValidators
- Add explicit ordering for the signers
- Support signing the whole tx instead of individual inputs
- Create a PSBT signer from an ExtendedDescriptor
- Add REPL broadcast command
- Add a miniscript compiler CLI
- Expose list_transactions() in the REPL
- Use
MemoryDatabase
in the compiler example - Make the REPL return JSON