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
signrawtransactionwithkey command shouldn't output the "Witness program was passed an empty witness" error for a TapRoot transaction #27017
Comments
The output of 3. prevtxs (json array, optional) The previous dependent transaction outputs
[
{ (json object)
"txid": "hex", (string, required) The transaction id
"vout": n, (numeric, required) The output number
"scriptPubKey": "hex", (string, required) script key
"redeemScript": "hex", (string) (required for P2SH) redeem script
"witnessScript": "hex", (string) (required for P2WSH or P2SH-P2WSH) witness script
"amount": amount, (numeric or string) (required for Segwit inputs) the amount spent
},
...
] You pass as the [
{
"txid": "3152ecd0e7acc80b6f47a32276cb6137a2de7cee428c9388e6a4a1817b665711",
"vout": 0,
"scriptPubKey": "5120c38859777bc9c3294d3587035fc3823a146dabaab1fa250bc04e92f16887a065",
"amount": 0.00004242
}
]
And the error message states that: "error": "Witness program was passed an empty witness" Assuming that If using the key path to spend theoutput can be spent with the secret key corresponding to the What error message would you consider to be more appropriate here? I could not replicate your success behaviour after importing the descriptor:will@ubuntu in …/src/bitcoin/src on master [$?⇕] via C v12.2.0-gcc
₿ bitcoin-cli -regtest importdescriptors '[{"desc": "tr(cUTFbLPUaBAPmTKwjcDs4rWHUSEUbUBfkPMogrbTmQFnJA3vgrLE)#tdkpah70", "timestamp": "now"}]'
[
{
"success": true
}
]
will@ubuntu in …/src/bitcoin/src on master [$?⇕] via C v12.2.0-gcc
₿ bitcoin-cli -regtest signrawtransactionwithkey "02000000011157667b81a1a4e688938c42ee7cdea23761cb7622a3476f0bc8ace7d0ec523100000000000000000001e8030000000000002251203b82b2b2a9185315da6f80da5f06d0440d8a5e1457fa93387c2d919c86ec878600000000" '["cUTFbLPUaBAPmTKwjcDs4rWHUSEUbUBfkPMogrbTmQFnJA3vgrLE"]' '[{"txid": "3152ecd0e7acc80b6f47a32276cb6137a2de7cee428c9388e6a4a1817b665711", "vout": 0, "scriptPubKey": "5120c38859777bc9c3294d3587035fc3823a146dabaab1fa250bc04e92f16887a065", "amount": 0.00004242}]' "DEFAULT"
{
"hex": "02000000011157667b81a1a4e688938c42ee7cdea23761cb7622a3476f0bc8ace7d0ec523100000000000000000001e8030000000000002251203b82b2b2a9185315da6f80da5f06d0440d8a5e1457fa93387c2d919c86ec878600000000",
"complete": false,
"errors": [
{
"txid": "3152ecd0e7acc80b6f47a32276cb6137a2de7cee428c9388e6a4a1817b665711",
"vout": 0,
"witness": [
],
"scriptSig": "",
"sequence": 0,
"error": "Witness program was passed an empty witness"
}
]
} |
The success behaviour is different from the not-replicated one:
|
The raw transaction workflow is basically deprecated in favor of using PSBTs. Signing with just keys is also basically deprecated in favor of using descriptors. |
This issue is unlikely to be fixed in Bitcoin Core. We'll close for now, but feel free to open another issue or pull request with a fix. |
Seems to be fixed in 26.0. Thanks. Example:
|
There is the irrelevant error message output by the signrawtransactionwithkey command.
Expected behavior
Hex string of the raw transaction with signature OR meaningful message about an alternative way to achieve one.
Actual behavior
To reproduce
System information
Console in Bitcoin Core 24.0.1 portable, Windows 11. (Occurs in both cases of a descriptor wallet loaded and not loaded).
Hint: signrawtransactionwithwallet works fine if preceded with the importdescriptors '[{"desc": "tr(cUTFbLPUaBAPmTKwjcDs4rWHUSEUbUBfkPMogrbTmQFnJA3vgrLE)#tdkpah70", "timestamp": "now"}]'
The text was updated successfully, but these errors were encountered: