mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Merge #13723: PSBT key path cleanups
917353c8b0Make SignPSBTInput operate on a private SignatureData object (Pieter Wuille)cad5dd2368Pass HD path data through SignatureData (Pieter Wuille)03a99586a3Implement key origin lookup in CWallet (Pieter Wuille)3b01efa0d1[MOVEONLY] Move ParseHDKeypath to utilstrencodings (Pieter Wuille)81e1dd5ce1Generalize PublicOnlySigningProvider into HidingSigningProvider (Pieter Wuille)84f1f1bfdfMake SigningProvider expose key origin information (Pieter Wuille)611ab307fbIntroduce KeyOriginInfo for fingerprint + path (Pieter Wuille) Pull request description: This PR adds "key origin" (master fingeprint + key path) information to what is exposed from `SigningProvider`s, allowing this information to be used by the generic PSBT code instead of having the RPC pull it directly from the wallet. This is also a preparation to having PSBT interact with output descriptors, which can then directly expose key origin information for the scripts they generate. Tree-SHA512: c718382ba8ba2d6fc9a32c062bd4cff08b6f39b133838aa03115c39aeca0f654c7cc3ec72d87005bf8306e550824cd8eb9d60f0bd41784a3e22e17b2afcfe833
This commit is contained in:
@@ -1458,11 +1458,8 @@ UniValue decodepsbt(const JSONRPCRequest& request)
|
||||
UniValue keypath(UniValue::VOBJ);
|
||||
keypath.pushKV("pubkey", HexStr(entry.first));
|
||||
|
||||
uint32_t fingerprint = entry.second.at(0);
|
||||
keypath.pushKV("master_fingerprint", strprintf("%08x", bswap_32(fingerprint)));
|
||||
|
||||
entry.second.erase(entry.second.begin());
|
||||
keypath.pushKV("path", WriteHDKeypath(entry.second));
|
||||
keypath.pushKV("master_fingerprint", strprintf("%08x", ReadBE32(entry.second.fingerprint)));
|
||||
keypath.pushKV("path", WriteHDKeypath(entry.second.path));
|
||||
keypaths.push_back(keypath);
|
||||
}
|
||||
in.pushKV("bip32_derivs", keypaths);
|
||||
@@ -1520,12 +1517,8 @@ UniValue decodepsbt(const JSONRPCRequest& request)
|
||||
for (auto entry : output.hd_keypaths) {
|
||||
UniValue keypath(UniValue::VOBJ);
|
||||
keypath.pushKV("pubkey", HexStr(entry.first));
|
||||
|
||||
uint32_t fingerprint = entry.second.at(0);
|
||||
keypath.pushKV("master_fingerprint", strprintf("%08x", bswap_32(fingerprint)));
|
||||
|
||||
entry.second.erase(entry.second.begin());
|
||||
keypath.pushKV("path", WriteHDKeypath(entry.second));
|
||||
keypath.pushKV("master_fingerprint", strprintf("%08x", ReadBE32(entry.second.fingerprint)));
|
||||
keypath.pushKV("path", WriteHDKeypath(entry.second.path));
|
||||
keypaths.push_back(keypath);
|
||||
}
|
||||
out.pushKV("bip32_derivs", keypaths);
|
||||
@@ -1646,8 +1639,7 @@ UniValue finalizepsbt(const JSONRPCRequest& request)
|
||||
for (unsigned int i = 0; i < psbtx.tx->vin.size(); ++i) {
|
||||
PSBTInput& input = psbtx.inputs.at(i);
|
||||
|
||||
SignatureData sigdata;
|
||||
complete &= SignPSBTInput(DUMMY_SIGNING_PROVIDER, *psbtx.tx, input, sigdata, i, 1);
|
||||
complete &= SignPSBTInput(DUMMY_SIGNING_PROVIDER, *psbtx.tx, input, i, 1);
|
||||
}
|
||||
|
||||
UniValue result(UniValue::VOBJ);
|
||||
|
||||
Reference in New Issue
Block a user