mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
Merge bitcoin/bitcoin#21365: Basic Taproot signing support for descriptor wallets
458a345b05Add support for SIGHASH_DEFAULT in RPCs, and make it default (Pieter Wuille)c0f0c8eccbtests: check spending of P2TR (Pieter Wuille)a2380127e9Basic Taproot signing logic in script/sign.cpp (Pieter Wuille)49487bc3b6Make GetInputUTXO safer: verify non-witness UTXO match (Pieter Wuille)fd3f6890f3Construct and use PrecomputedTransactionData in PSBT signing (Pieter Wuille)5cb6502ac5Construct and use PrecomputedTransactionData in SignTransaction (Pieter Wuille)5d2e22437bDon't nuke witness data when signing fails (Pieter Wuille)ce9353164bPermit full precomputation in PrecomputedTransactionData (Pieter Wuille)e841fb503dAdd precomputed txdata support to MutableTransactionSignatureCreator (Pieter Wuille)a91d532338Add CKey::SignSchnorr function for BIP 340/341 signing (Pieter Wuille)e77a2839b5Use HandleMissingData also in CheckSchnorrSignature (Pieter Wuille)dbb0ce9fbfAdd TaprootSpendData data structure, equivalent to script map for P2[W]SH (Pieter Wuille) Pull request description: Builds on top of #22051, adding signing support after derivation support. Nothing is changed in descriptor features. Signing works for key path and script path spending, through the normal sending functions, and PSBT-based RPCs. However, PSBT usability is rather low as no extensions have been defined to convey Taproot-specific information, so all script information must be known to the signing wallet. ACKs for top commit: achow101: re-ACK458a345b05fjahr: Code review ACK458a345b05Sjors: ACK458a345b05Tree-SHA512: 30ed212cf7754763a4a81624ebc084c51727b8322711ac0b390369213c1a891d367ed8b123882ac08c99595320c11ec57ee42304ff22a69afdc3d1a0d55cc711
This commit is contained in:
@@ -23,6 +23,8 @@ PSBTAnalysis AnalyzePSBT(PartiallySignedTransaction psbtx)
|
||||
|
||||
result.inputs.resize(psbtx.tx->vin.size());
|
||||
|
||||
const PrecomputedTransactionData txdata = PrecomputePSBTData(psbtx);
|
||||
|
||||
for (unsigned int i = 0; i < psbtx.tx->vin.size(); ++i) {
|
||||
PSBTInput& input = psbtx.inputs[i];
|
||||
PSBTInputAnalysis& input_analysis = result.inputs[i];
|
||||
@@ -61,7 +63,7 @@ PSBTAnalysis AnalyzePSBT(PartiallySignedTransaction psbtx)
|
||||
|
||||
// Figure out what is missing
|
||||
SignatureData outdata;
|
||||
bool complete = SignPSBTInput(DUMMY_SIGNING_PROVIDER, psbtx, i, 1, &outdata);
|
||||
bool complete = SignPSBTInput(DUMMY_SIGNING_PROVIDER, psbtx, i, &txdata, 1, &outdata);
|
||||
|
||||
// Things are missing
|
||||
if (!complete) {
|
||||
@@ -121,7 +123,7 @@ PSBTAnalysis AnalyzePSBT(PartiallySignedTransaction psbtx)
|
||||
PSBTInput& input = psbtx.inputs[i];
|
||||
Coin newcoin;
|
||||
|
||||
if (!SignPSBTInput(DUMMY_SIGNING_PROVIDER, psbtx, i, 1, nullptr, true) || !psbtx.GetInputUTXO(newcoin.out, i)) {
|
||||
if (!SignPSBTInput(DUMMY_SIGNING_PROVIDER, psbtx, i, nullptr, 1) || !psbtx.GetInputUTXO(newcoin.out, i)) {
|
||||
success = false;
|
||||
break;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user