This PR adds a stripbip32derivs option to both the walletprocesspsbt and
descriptorprocesspsbt RPCs.
Motivation
Currently, setting bip32derivs=false only prevents the addition of new
key-origin metadata. It does not remove BIP32 derivation metadata that is
already present in the input PSBT. For collaborative PSBT workflows, users may
want to strip this existing metadata before sharing the PSBT with counterparties.
Behavior
Setting stripbip32derivs=true removes standard key-origin fields from the
returned PSBT, including global xpubs and BIP32 derivation paths.
If stripbip32derivs=true is used without explicitly setting bip32derivs,
the RPC suppresses adding new key-origin metadata and strips existing standard
key-origin fields.
Explicitly setting both stripbip32derivs=true and bip32derivs=true is
rejected. This avoids asking the RPC to add and remove the same class of
metadata in a single call.
Implementation Notes
The same option is applied to descriptorprocesspsbt because it shares the same
bip32derivs behavior and can return the same class of key-origin metadata.
Following prior review feedback in #30341, the stripping functionality is
implemented in the PSBT processing RPCs rather than combinepsbt.
Tests
git diff --check origin/master..HEADpython -m py_compile .\test\functional\rpc_psbt.pypython3 test/functional/rpc_psbt.py --configfile=build/test/config.iniin Docker/Ubuntu
Closes #30294.