Fixes #34273.
Miniscript duplicate key checking resolves keys while checking descriptor sanity. For musig() expressions with hardened participant derivation, doing that with an empty signing provider can make distinct keys both fail to resolve and get treated as duplicates.
Use the signing data collected during parsing for duplicate key comparison, and fall back to the key string when pubkey resolution is still unavailable.
Also fix OriginPubkeyProvider::GetPubKey() so repeated expansions of the same origin-wrapped musig participant key do not prefix the same origin path more than once. This was producing incorrect taproot BIP32 derivation paths in PSBTs.
Add descriptor tests for the duplicate check and origin/cache cases, and a wallet functional test for the PSBT derivation-path regression.
Tested:
./bin/test_bitcoin --run_test=descriptor_tests --catch_system_errors=no./bin/test_bitcoin --run_test=miniscript_tests --catch_system_errors=no./bin/test_bitcoin --run_test=bip328_tests --catch_system_errors=no./bin/test_bitcoin --run_test=psbt_wallet_tests --catch_system_errors=nopython3 test/functional/test_runner.py wallet_musig.pypython3 test/functional/test_runner.py wallet_listdescriptors.pypython3 test/functional/test_runner.py rpc_psbt.pypython3 test/functional/test_runner.py wallet_taproot.py