From 61c6d1a8440db09c44d7fd367a6f2c641ea93d40 Mon Sep 17 00:00:00 2001 From: Antoine Poinsot Date: Wed, 1 Dec 2021 23:45:33 +0100 Subject: [PATCH] script/sign: basic signing support for Miniscript descriptors Try to solve a script using the Miniscript satisfier if the legacy solver fails under P2WSH context. Only solve public key and public key hash challenges for now. We don't entirely replace the raw solver and especially rule out trying to solve CHECKMULTISIG-based multisigs with the Miniscript satisfier since some features, such as the transaction input combiner, rely on the specific behaviour of the former. --- src/script/descriptor.cpp | 2 +- src/script/sign.cpp | 87 +++++++++++++++++++++++++++- src/test/descriptor_tests.cpp | 9 ++- test/functional/wallet_miniscript.py | 2 +- 4 files changed, 92 insertions(+), 8 deletions(-) diff --git a/src/script/descriptor.cpp b/src/script/descriptor.cpp index 864eb8864fd..110006b6b6d 100644 --- a/src/script/descriptor.cpp +++ b/src/script/descriptor.cpp @@ -1012,7 +1012,7 @@ public: return false; } - bool IsSolvable() const override { return false; } // For now, mark these descriptors as non-solvable (as we don't have signing logic for them). + bool IsSolvable() const override { return true; } bool IsSingleType() const final { return true; } }; diff --git a/src/script/sign.cpp b/src/script/sign.cpp index 0d74a661a59..15da4667e0c 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -10,6 +10,7 @@ #include #include #include