@@ -1154,7 +1154,23 @@ static RPCHelpMan decodepsbt()
1154
1154
{
1155
1155
{RPCResult::Type::STR_HEX, " " , " hex-encoded witness data (if any)" },
1156
1156
}},
1157
- {RPCResult::Type::OBJ_DYN, " unknown" , /* optional=*/ true , " The unknown global fields" ,
1157
+ {RPCResult::Type::OBJ_DYN, " ripemd160_preimages" , /* optional=*/ true , " " ,
1158
+ {
1159
+ {RPCResult::Type::STR, " hash" , " The hash and preimage that corresponds to it." },
1160
+ }},
1161
+ {RPCResult::Type::OBJ_DYN, " sha256_preimages" , /* optional=*/ true , " " ,
1162
+ {
1163
+ {RPCResult::Type::STR, " hash" , " The hash and preimage that corresponds to it." },
1164
+ }},
1165
+ {RPCResult::Type::OBJ_DYN, " hash160_preimages" , /* optional=*/ true , " " ,
1166
+ {
1167
+ {RPCResult::Type::STR, " hash" , " The hash and preimage that corresponds to it." },
1168
+ }},
1169
+ {RPCResult::Type::OBJ_DYN, " hash256_preimages" , /* optional=*/ true , " " ,
1170
+ {
1171
+ {RPCResult::Type::STR, " hash" , " The hash and preimage that corresponds to it." },
1172
+ }},
1173
+ {RPCResult::Type::OBJ_DYN, " unknown" , /* optional=*/ true , " The unknown input fields" ,
1158
1174
{
1159
1175
{RPCResult::Type::STR_HEX, " key" , " (key-value pair) An unknown key-value pair" },
1160
1176
}},
@@ -1373,6 +1389,42 @@ static RPCHelpMan decodepsbt()
1373
1389
in.pushKV (" final_scriptwitness" , txinwitness);
1374
1390
}
1375
1391
1392
+ // Ripemd160 hash preimages
1393
+ if (!input.ripemd160_preimages .empty ()) {
1394
+ UniValue ripemd160_preimages (UniValue::VOBJ);
1395
+ for (const auto & [hash, preimage] : input.ripemd160_preimages ) {
1396
+ ripemd160_preimages.pushKV (HexStr (hash), HexStr (preimage));
1397
+ }
1398
+ in.pushKV (" ripemd160_preimages" , ripemd160_preimages);
1399
+ }
1400
+
1401
+ // Sha256 hash preimages
1402
+ if (!input.sha256_preimages .empty ()) {
1403
+ UniValue sha256_preimages (UniValue::VOBJ);
1404
+ for (const auto & [hash, preimage] : input.sha256_preimages ) {
1405
+ sha256_preimages.pushKV (HexStr (hash), HexStr (preimage));
1406
+ }
1407
+ in.pushKV (" sha256_preimages" , sha256_preimages);
1408
+ }
1409
+
1410
+ // Hash160 hash preimages
1411
+ if (!input.hash160_preimages .empty ()) {
1412
+ UniValue hash160_preimages (UniValue::VOBJ);
1413
+ for (const auto & [hash, preimage] : input.hash160_preimages ) {
1414
+ hash160_preimages.pushKV (HexStr (hash), HexStr (preimage));
1415
+ }
1416
+ in.pushKV (" hash160_preimages" , hash160_preimages);
1417
+ }
1418
+
1419
+ // Hash256 hash preimages
1420
+ if (!input.hash256_preimages .empty ()) {
1421
+ UniValue hash256_preimages (UniValue::VOBJ);
1422
+ for (const auto & [hash, preimage] : input.hash256_preimages ) {
1423
+ hash256_preimages.pushKV (HexStr (hash), HexStr (preimage));
1424
+ }
1425
+ in.pushKV (" hash256_preimages" , hash256_preimages);
1426
+ }
1427
+
1376
1428
// Proprietary
1377
1429
if (!input.m_proprietary .empty ()) {
1378
1430
UniValue proprietary (UniValue::VARR);
0 commit comments