Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

`signrawtransactionwithwallet` produces invalid Schnorr signatures

Open
#1,238 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
28/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
cpp, python

Research direction

Start with test/functional/wallet_taproot.py and run the shown createrawtransaction, fundrawtransaction, signrawtransactionwithwallet, and sendrawtransaction sequence. Inspect the reported complete transaction and witness values; the issue is resolved when the signed transaction is accepted instead of failing with Invalid Schnorr signature.

Written by the indexing model from the issue text.

Description

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.

Dominant language
C++
Stars
1.2k
Forks
418
Avg merge
1d 12h
Merged PRs (30d)
13

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ElementsProject/elements

All issues in ElementsProject/elements

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.