ElementsProject / ElementsProject/elements

`signrawtransactionwithwallet` produces invalid Schnorr signatures

Aperta
#1,238 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
C++
Stelle
1.2k
Fork
416
Merge medio
1g 23h
PR unite (30g)
15

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia con test/functional/wallet_taproot.py ed esegui la sequenza mostrata di createrawtransaction, fundrawtransaction, signrawtransactionwithwallet e sendrawtransaction. Esamina la transazione completa e i valori di witness riportati; l’issue è risolta quando la transazione firmata viene accettata invece di fallire con Invalid Schnorr signature.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
cpp, python
Ambito
blockchain, testing
Tipo di issue
Bug
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
28/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.