Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

signrawtransactionwithwallet produces invalid Schnorr signatures #1238

Open
apoelstra opened this issue May 4, 2023 · 0 comments
Open

signrawtransactionwithwallet produces invalid Schnorr signatures #1238

apoelstra opened this issue May 4, 2023 · 0 comments

Comments

@apoelstra
Copy link
Member

If you try modifying the wallet_taproot.py functional test like so:

diff --git a/test/functional/wallet_taproot.py b/test/functional/wallet_taproot.py
index 123a6a40893..f37fc906549 100755
--- a/test/functional/wallet_taproot.py
+++ b/test/functional/wallet_taproot.py
@@ -275,6 +275,12 @@ class WalletTaprootTest(BitcoinTestFramework):
             self.nodes[0].generatetoaddress(1, self.boring.getnewaddress())
             test_balance = int(self.rpc_online.getbalance()['bitcoin'] * 100000000)
             ret_amnt = random.randrange(100000, test_balance)
+            # Start...
+            rawret = self.rpc_online.createrawtransaction([], [{self.boring.getnewaddress(): Decimal(ret_amnt) / 100000000}])
+            rawret = self.rpc_online.fundrawtransaction(rawret, {"changePosition":1, "subtractFeeFromOutputs":[0]})
+            rawret = self.rpc_online.signrawtransactionwithwallet(rawret['hex'])
+            self.rpc_online.sendrawtransaction(rawret['hex'])
+            # ...end
             res = self.rpc_online.sendtoaddress(address=self.boring.getnewaddress(), amount=Decimal(ret_amnt) / 100000000, subtractfeefromamount=True)
             self.nodes[0].generatetoaddress(1, self.boring.getnewaddress())
             assert(self.rpc_online.gettransaction(res)["confirmations"] > 0)

You will get a failure of the form

test_framework.authproxy.JSONRPCException: non-mandatory-script-verify-flag (Invalid Schnorr signature) (-26)

on the sendrawtransaction line. You can verify by printing intermediate values that the output of signrawtransactionwithwallet shows complete: true and that the transaction indeed has something Schnorr-signature-shaped in its witness.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant