bitcoindevkit / bdk

A modern, lightweight, descriptor-based wallet library written in Rust!
Other
862 stars 311 forks source link

PSBTv2 Support #845

Open Rob1Ham opened 1 year ago

Rob1Ham commented 1 year ago

Describe the enhancement

BDK Currently Supports PSBTv0, from Bip174.

BIP370 Is PSBTv2, which allows for new inputs/outputs to be added to a transaction. PSBTv2 is also more efficient in data retrieval for inputs & outputs.

Enabling support for PSBTv2s, with possibly even a conversion between v0 and v2 and vice versa would greatly extend the utility of BDK as more wallets begin requiring PSBTv2s.

Use case
Currently - I am working on creating PSBTs to be used with the Ledger, their Javascript library requires PSBTv2s to be accepted by the device, so I have been working on manually parsing PSBTv0s into PSBTv2 format.

Additional context There is some reference code in how the ledger team takes a general PSBTv0, and parses out the PSBTv2 values, found here.

notmandatory commented 1 year ago

We'll need support from rust-bitcoin for PSBTv2, tracking issue for that work is rust-bitcoin/rust-bitcoin#1115.