BitBoxSwiss / bitbox02-firmware

Firmware code of the BitBox02 hardware wallet
https://bitbox.swiss/bitbox02
Apache License 2.0
215 stars 80 forks source link

policies: refactor script derivation #1230

Closed benma closed 2 weeks ago

benma commented 2 weeks ago

Instead of deriving the witness script at a keypath, we instead derive a descriptor instead.

The reason for this is that witness_script only makes sense for wsh(...) desciptors. When we add tr(...) Taproot descriptors, we will need the Taproot output key instead. So a witness_script() method directly on the policy does not make sense as it does not work for both variants.