mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-26 15:36:19 +01:00
Merge bitcoin/bitcoin#24149: Signing support for Miniscript Descriptors
6c7a17a8e0psbt: support externally provided preimages for Miniscript satisfaction (Antoine Poinsot)840a396029qa: add a "smart" Miniscript fuzz target (Antoine Poinsot)17e3547241qa: add a fuzz target generating random nodes from a binary encoding (Antoine Poinsot)611e12502aqa: functional test Miniscript signing with key and timelocks (Antoine Poinsot)d57b7f2021refactor: make descriptors in Miniscript functional test more readable (Antoine Poinsot)0a8fc9e200wallet: check solvability using descriptor in AvailableCoins (Antoine Poinsot)560e62b1e2script/sign: signing support for Miniscripts with hash preimage challenges (Antoine Poinsot)a2f81b6a8fscript/sign: signing support for Miniscript with timelocks (Antoine Poinsot)61c6d1a844script/sign: basic signing support for Miniscript descriptors (Antoine Poinsot)4242c1c521Align 'e' property of or_d and andor with website spec (Pieter Wuille)f5deb41780Various additional explanations of the satisfaction logic from Pieter (Pieter Wuille)22c5b00345miniscript: satisfaction support (Antoine Poinsot) Pull request description: This makes the Miniscript descriptors solvable. Note this introduces signing support for much more complex scripts than the wallet was previously able to solve, and the whole tooling isn't provided for a complete Miniscript integration in the wallet. Particularly, the PSBT<->Miniscript integration isn't entirely covered in this PR. ACKs for top commit: achow101: ACK6c7a17a8e0sipa: utACK6c7a17a8e0(to the extent that it's not my own code). Tree-SHA512: a71ec002aaf66bd429012caa338fc58384067bcd2f453a46e21d381ed1bacc8e57afb9db57c0fb4bf40de43b30808815e9ebc0ae1fbd9e61df0e7b91a17771cc
This commit is contained in:
@@ -102,7 +102,8 @@ BOOST_AUTO_TEST_CASE(sign)
|
||||
}
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
BOOST_CHECK_MESSAGE(SignSignature(keystore, CTransaction(txFrom), txTo[i], 0, SIGHASH_ALL), strprintf("SignSignature %d", i));
|
||||
SignatureData empty;
|
||||
BOOST_CHECK_MESSAGE(SignSignature(keystore, CTransaction(txFrom), txTo[i], 0, SIGHASH_ALL, empty), strprintf("SignSignature %d", i));
|
||||
}
|
||||
// All of the above should be OK, and the txTos have valid signatures
|
||||
// Check to make sure signature verification fails if we use the wrong ScriptSig:
|
||||
@@ -197,7 +198,8 @@ BOOST_AUTO_TEST_CASE(set)
|
||||
}
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
BOOST_CHECK_MESSAGE(SignSignature(keystore, CTransaction(txFrom), txTo[i], 0, SIGHASH_ALL), strprintf("SignSignature %d", i));
|
||||
SignatureData empty;
|
||||
BOOST_CHECK_MESSAGE(SignSignature(keystore, CTransaction(txFrom), txTo[i], 0, SIGHASH_ALL, empty), strprintf("SignSignature %d", i));
|
||||
BOOST_CHECK_MESSAGE(IsStandardTx(CTransaction(txTo[i]), reason), strprintf("txTo[%d].IsStandard", i));
|
||||
}
|
||||
}
|
||||
@@ -334,9 +336,12 @@ BOOST_AUTO_TEST_CASE(AreInputsStandard)
|
||||
txTo.vin[i].prevout.n = i;
|
||||
txTo.vin[i].prevout.hash = txFrom.GetHash();
|
||||
}
|
||||
BOOST_CHECK(SignSignature(keystore, CTransaction(txFrom), txTo, 0, SIGHASH_ALL));
|
||||
BOOST_CHECK(SignSignature(keystore, CTransaction(txFrom), txTo, 1, SIGHASH_ALL));
|
||||
BOOST_CHECK(SignSignature(keystore, CTransaction(txFrom), txTo, 2, SIGHASH_ALL));
|
||||
SignatureData empty;
|
||||
BOOST_CHECK(SignSignature(keystore, CTransaction(txFrom), txTo, 0, SIGHASH_ALL, empty));
|
||||
SignatureData empty_b;
|
||||
BOOST_CHECK(SignSignature(keystore, CTransaction(txFrom), txTo, 1, SIGHASH_ALL, empty_b));
|
||||
SignatureData empty_c;
|
||||
BOOST_CHECK(SignSignature(keystore, CTransaction(txFrom), txTo, 2, SIGHASH_ALL, empty_c));
|
||||
// SignSignature doesn't know how to sign these. We're
|
||||
// not testing validating signatures, so just create
|
||||
// dummy signatures that DO include the correct P2SH scripts:
|
||||
|
||||
Reference in New Issue
Block a user