Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
3deb321
fix(signer): match BIP32 origin via `matches`, not string prefix
evanlinjin Jun 15, 2026
7459be2
test(selection): Refactor tests to reuse key strings
evanlinjin May 28, 2026
3047b87
feat(selection): always declare psbt input sighash type
evanlinjin May 28, 2026
2211b74
fix(finalizer): Retain unknown input fields when finalizing
evanlinjin Jun 2, 2026
7f91b83
fix(finalizer)!: validate sighash types and signature sizes
evanlinjin Jun 13, 2026
b9966cc
test(finalizer): cover sighash-type finalization errors
evanlinjin Jun 13, 2026
a64acf3
fix(finalizer): clarify SighashNotAllowed error message
evanlinjin Jun 24, 2026
e97ef02
test(finalizer): clear declared sighash type for SighashNotAllowed case
evanlinjin Jun 27, 2026
651785a
refactor!: rename Selection to TxTemplate
evanlinjin May 20, 2026
351b086
feat(tx-template)!: route tx-shape decisions through TxTemplate
evanlinjin May 20, 2026
790c935
refactor!: drop rand dependency from the library
evanlinjin May 19, 2026
a411d8d
refactor: rename create_psbt to build_psbt and extract its types
evanlinjin Jun 16, 2026
79bdf78
feat(tx-template)!: seal TxTemplate into SealedTxTemplate after anti-…
evanlinjin Jun 16, 2026
0903844
feat: Add single_random_draw selection algorithm
evanlinjin Jun 15, 2026
56c1d11
feat: Add InputCandidates::push_must_select / push_can_select
evanlinjin Jun 16, 2026
c9a1591
refactor(tx_template): Rename `TxTemplate::from_parts` to `new`
evanlinjin Jun 25, 2026
ac4776f
feat(input_candidates): upsert in push_must_select / push_can_select
evanlinjin Jun 25, 2026
df09bd3
test: reconcile #74/#79 tests with TxTemplate/build_psbt API
evanlinjin Jun 27, 2026
4c0262d
refactor!: Replace `Selector` with a single `into_selection` pass
evanlinjin Jun 26, 2026
2de1dce
refactor!: Split setup errors into `ChangePolicyError` + `LockTypeMis…
evanlinjin Jun 26, 2026
3d49606
refactor: Rename selector.rs to selection_params.rs
evanlinjin Jun 26, 2026
b5eca4e
style: rustfmt import after Selector/into_selection merge
evanlinjin Jun 27, 2026
0010fe4
refactor: convert repo into a Cargo workspace
evanlinjin Jun 27, 2026
30c0a44
feat: add bdk_wallet_tx bridge crate
evanlinjin Jun 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
- version: stable
- version: 1.85.0
features:
- --no-default-features --features miniscript/no-std
- --all-features
- -p bdk_tx --no-default-features --features miniscript/no-std
- --workspace --all-features
steps:
- uses: actions/checkout@v6
- name: Install Rust
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
toolchain: stable
cache: true
- name: Check no-std
run: cargo check --no-default-features --features miniscript/no-std
run: cargo check -p bdk_tx --no-default-features --features miniscript/no-std

fmt-clippy:
runs-on: ubuntu-latest
Expand All @@ -61,4 +61,4 @@ jobs:
- name: Rust fmt
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --all-targets --all-features -- -Dwarnings
run: cargo clippy --workspace --all-targets --all-features -- -Dwarnings
46 changes: 3 additions & 43 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,43 +1,3 @@
[package]
name = "bdk_tx"
version = "0.2.0"
edition = "2021"
rust-version = "1.85.0"
homepage = "https://bitcoindevkit.org"
repository = "https://github.com/bitcoindevkit/bdk-tx"
documentation = "https://docs.rs/bdk_tx"
description = "Bitcoin transaction building library."
license = "MIT OR Apache-2.0"
readme = "README.md"

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }

[dependencies]
# TODO: coin-select dependency should set no default features
bdk_coin_select = { version = "0.4.1" }
miniscript = { version = "12.3.7", default-features = false }
rand_core = { version = "0.6.4", default-features = false }
rand = { version = "0.8", optional = true }

[dev-dependencies]
anyhow = "1"
bdk_tx = { path = "." }
bitcoin = { version = "0.32.10", default-features = false, features = ["rand-std"] }
bdk_testenv = "0.13.0"
bdk_bitcoind_rpc = "0.22.0"
bdk_chain = { version = "0.23.3" }

[features]
default = ["std"]
std = ["miniscript/std", "rand/std", "bdk_coin_select/std"]

[[example]]
name = "synopsis"

[[example]]
name = "common"
crate-type = ["lib"]

[[example]]
name = "anti_fee_sniping"
[workspace]
members = ["tx", "wallet_tx"]
resolver = "2"
33 changes: 18 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
# `bdk_tx`
# bdk-tx workspace

This is a transaction building library based on `rust-miniscript` that lets you build, update, and finalize PSBTs with minimal dependencies.
A Cargo workspace with two crates:

<!-- links to relevant literature -->
Because the project builds upon [miniscript] we support [descriptors] natively.
- [`tx/`](tx) -- **`bdk_tx`**, a low-level Bitcoin transaction-building library (coin selection,
tx-template shaping, PSBT emission and finalization). See [`tx/README.md`](tx/README.md).
- [`wallet_tx/`](wallet_tx) -- **`bdk_wallet_tx`**, a bridge crate that drives `bdk_tx`'s multi-stage
transaction building from a `bdk_wallet::Wallet` via the `WalletTxExt` extension trait. See
[`wallet_tx/README.md`](wallet_tx/README.md).

Refer to [BIP174], [BIP370], and [BIP371] to learn more about partially signed bitcoin transactions (PSBT).
`wallet_tx` depends on both `bdk_wallet` and `bdk_tx`, so neither base crate depends on the other:
`bdk_wallet` stays stable, `bdk_tx` stays free to move, and the bridge absorbs the coupling.

**Note:**
The library is unstable and API changes should be expected. Check the [examples] directory for detailed usage examples.
## Building

```sh
cargo build --workspace
cargo test --workspace
```

## Contributing
Found a bug, have an issue or a feature request? Feel free to open an issue on GitHub. This library is open source licensed under MIT.
`bdk_tx` additionally supports `no_std`:

[miniscript]: https://github.com/bitcoin/bips/blob/master/bip-0379.md
[descriptors]: https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md
[BIP174]: https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki
[BIP370]: https://github.com/bitcoin/bips/blob/master/bip-0370.mediawiki
[BIP371]: https://github.com/bitcoin/bips/blob/master/bip-0371.mediawiki
[examples]: ./examples
```sh
cargo check -p bdk_tx --no-default-features --features miniscript/no-std
```
284 changes: 0 additions & 284 deletions src/input_candidates.rs

This file was deleted.

Loading