Just trying to understand the main benefits of including PSBT_IN_BIP32_DERIVATION and
PSBT_OUT_BIP32_DERIVATION in a PSBT.
Are they primarily useful for two reasons:
- Allowing the signer to detect change outputs quickly.
- Allowing the signer to find the correct private key to sign with more easily.
Am I right in thinking that a signer can do both of these things without either of these keys, but adding them makes it easier?
For example, when detecting change, you could look at the addresses on the outputs and scan for that address in the wallet’s HD tree. But by using the PSBT_IN_BIP32_DERIVATION and
PSBT_OUT_BIP32_DERIVATION data you could just check if the master fingerprint on an output is the same as the master fingerprint on an input (and also check the derivation path on the output to see if it’s the “change” branch of the tree)?
Similarly, when signing, you could use the input’s ScriptPubKey to work out the address, then manually search through the tree to find its corresponding private key. But by using PSBT_IN_BIP32_DERIVATION you can use the derivation path given in an input map to quickly derive the private key to sign the input with?
Sorry for all the questions. I’m basically just wondering what the main practical benefits are, and if they’re mostly there to help make signing and change detection easier for the wallet (but could still be done without them).












