Is there an existing issue for this?
- I have searched the existing issues
Current behaviour
I want to create signature by calling walletprocesspsbt endpoint to spend from multisig output. It is worth stating that this is taproot output with one leaf.
Wallet contains one of the key from multisig. Key was created by first calling getnewaddress and then calling getaddressinfo and retrieving public key.
Now the issue is that if multisig script is in format:
<key1> OP_CHECKSIG <key2> OP_CHECKSIGADD <key3> OP_CHECKSIGADD 2 OP_NUMEQUAL
where one of the keys is in wallet everything works as expected.
Psbt to sign:
{
"tx": {
"txid": "626f61fa0b711187cd29a82c7ec0ae56447a8c8b4955bf99c9c8a6459522cf40",
"hash": "626f61fa0b711187cd29a82c7ec0ae56447a8c8b4955bf99c9c8a6459522cf40",
"version": 2,
"size": 82,
"vsize": 82,
"weight": 328,
"locktime": 0,
"vin": [
{
"txid": "32f9c12fe803fa2c26c168850b424e260bca7191b39e775ddf946d51cb0c929b",
"vout": 0,
"scriptSig": {
"asm": "",
"hex": ""
},
"sequence": 0
}
],
"vout": [
{
"value": 0.00098000,
"n": 0,
"scriptPubKey": {
"asm": "0 a2ec9907bfd06d26e41e8af835c8b2b39400bb56",
"desc": "addr(bcrt1q5tkfjpal6pkjdeq73turtj9jkw2qpw6kfnjp63)#3rygmz90",
"hex": "0014a2ec9907bfd06d26e41e8af835c8b2b39400bb56",
"address": "bcrt1q5tkfjpal6pkjdeq73turtj9jkw2qpw6kfnjp63",
"type": "witness_v0_keyhash"
}
}
]
},
"global_xpubs": [
],
"psbt_version": 0,
"proprietary": [
],
"unknown": {
},
"inputs": [
{
"witness_utxo": {
"amount": 0.00100000,
"scriptPubKey": {
"asm": "1 c3e8e2c9fc6033f3ebcd9d5b39212f52873e8b6e356a64bd364d76e59011f33a",
"desc": "rawtr(c3e8e2c9fc6033f3ebcd9d5b39212f52873e8b6e356a64bd364d76e59011f33a)#kgt72cne",
"hex": "5120c3e8e2c9fc6033f3ebcd9d5b39212f52873e8b6e356a64bd364d76e59011f33a",
"address": "bcrt1pc05w9j0uvqel867dn4dnjgf022rnazmwx44xf0fkf4mwtyq37vaqrecrxw",
"type": "witness_v1_taproot"
}
},
"witness_script": {
"asm": "51af6bd7bdaa1e3d2dc777c27bdf76b7ad1161ee48197cd8cf0ea4523b3dfa53 OP_CHECKSIG 65a70371debcdafa542f1570282395054c082efada30e03d93c1b98cc1963403 OP_CHECKSIGADD 71a79e74ad98f51b2c299de2c10f298130e2c3be2c3a266767a2c55d420749a9 OP_CHECKSIGADD 2 OP_NUMEQUAL",
"hex": "2051af6bd7bdaa1e3d2dc777c27bdf76b7ad1161ee48197cd8cf0ea4523b3dfa53ac2065a70371debcdafa542f1570282395054c082efada30e03d93c1b98cc1963403ba2071a79e74ad98f51b2c299de2c10f298130e2c3be2c3a266767a2c55d420749a9ba529c",
"type": "nonstandard"
},
"taproot_scripts": [
{
"script": "2051af6bd7bdaa1e3d2dc777c27bdf76b7ad1161ee48197cd8cf0ea4523b3dfa53ac2065a70371debcdafa542f1570282395054c082efada30e03d93c1b98cc1963403ba2071a79e74ad98f51b2c299de2c10f298130e2c3be2c3a266767a2c55d420749a9ba529c",
"leaf_ver": 192,
"control_blocks": [
"c150929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0"
]
}
],
"taproot_bip32_derivs": [
{
"pubkey": "65a70371debcdafa542f1570282395054c082efada30e03d93c1b98cc1963403",
"master_fingerprint": "00000000",
"path": "m",
"leaf_hashes": [
]
}
],
"taproot_internal_key": "50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0",
"taproot_merkle_root": "a0739e00a984d9cdfb5f08740d3c6b405af4d98baa7dfcc823cab15c8c465661"
}
],
"outputs": [
{
}
],
"fee": 0.00002000
}
Psbt signed:
{
"tx": {
"txid": "626f61fa0b711187cd29a82c7ec0ae56447a8c8b4955bf99c9c8a6459522cf40",
"hash": "626f61fa0b711187cd29a82c7ec0ae56447a8c8b4955bf99c9c8a6459522cf40",
"version": 2,
"size": 82,
"vsize": 82,
"weight": 328,
"locktime": 0,
"vin": [
{
"txid": "32f9c12fe803fa2c26c168850b424e260bca7191b39e775ddf946d51cb0c929b",
"vout": 0,
"scriptSig": {
"asm": "",
"hex": ""
},
"sequence": 0
}
],
"vout": [
{
"value": 0.00098000,
"n": 0,
"scriptPubKey": {
"asm": "0 a2ec9907bfd06d26e41e8af835c8b2b39400bb56",
"desc": "addr(bcrt1q5tkfjpal6pkjdeq73turtj9jkw2qpw6kfnjp63)#3rygmz90",
"hex": "0014a2ec9907bfd06d26e41e8af835c8b2b39400bb56",
"address": "bcrt1q5tkfjpal6pkjdeq73turtj9jkw2qpw6kfnjp63",
"type": "witness_v0_keyhash"
}
}
]
},
"global_xpubs": [
],
"psbt_version": 0,
"proprietary": [
],
"unknown": {
},
"inputs": [
{
"witness_utxo": {
"amount": 0.00100000,
"scriptPubKey": {
"asm": "1 c3e8e2c9fc6033f3ebcd9d5b39212f52873e8b6e356a64bd364d76e59011f33a",
"desc": "rawtr(c3e8e2c9fc6033f3ebcd9d5b39212f52873e8b6e356a64bd364d76e59011f33a)#kgt72cne",
"hex": "5120c3e8e2c9fc6033f3ebcd9d5b39212f52873e8b6e356a64bd364d76e59011f33a",
"address": "bcrt1pc05w9j0uvqel867dn4dnjgf022rnazmwx44xf0fkf4mwtyq37vaqrecrxw",
"type": "witness_v1_taproot"
}
},
"witness_script": {
"asm": "51af6bd7bdaa1e3d2dc777c27bdf76b7ad1161ee48197cd8cf0ea4523b3dfa53 OP_CHECKSIG 65a70371debcdafa542f1570282395054c082efada30e03d93c1b98cc1963403 OP_CHECKSIGADD 71a79e74ad98f51b2c299de2c10f298130e2c3be2c3a266767a2c55d420749a9 OP_CHECKSIGADD 2 OP_NUMEQUAL",
"hex": "2051af6bd7bdaa1e3d2dc777c27bdf76b7ad1161ee48197cd8cf0ea4523b3dfa53ac2065a70371debcdafa542f1570282395054c082efada30e03d93c1b98cc1963403ba2071a79e74ad98f51b2c299de2c10f298130e2c3be2c3a266767a2c55d420749a9ba529c",
"type": "nonstandard"
},
"taproot_script_path_sigs": [
{
"pubkey": "65a70371debcdafa542f1570282395054c082efada30e03d93c1b98cc1963403",
"leaf_hash": "a0739e00a984d9cdfb5f08740d3c6b405af4d98baa7dfcc823cab15c8c465661",
"sig": "34ac8762e23d1521611f67ce608bf36a46ed5036b2cbc4fa3d6b8bde8d85449eea31e52422589199e63c0d0fd62fd6e03d840e00bf03d52c6e5e7987e1901a1a"
}
],
"taproot_scripts": [
{
"script": "2051af6bd7bdaa1e3d2dc777c27bdf76b7ad1161ee48197cd8cf0ea4523b3dfa53ac2065a70371debcdafa542f1570282395054c082efada30e03d93c1b98cc1963403ba2071a79e74ad98f51b2c299de2c10f298130e2c3be2c3a266767a2c55d420749a9ba529c",
"leaf_ver": 192,
"control_blocks": [
"c150929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0"
]
}
],
"taproot_bip32_derivs": [
{
"pubkey": "65a70371debcdafa542f1570282395054c082efada30e03d93c1b98cc1963403",
"master_fingerprint": "00000000",
"path": "m",
"leaf_hashes": [
]
}
],
"taproot_internal_key": "50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0",
"taproot_merkle_root": "a0739e00a984d9cdfb5f08740d3c6b405af4d98baa7dfcc823cab15c8c465661"
}
],
"outputs": [
{
}
],
"fee": 0.00002000
}
Issue arises when script is changed to similar, but different form:
<key1> OP_CHECKSIG <key2> OP_CHECKSIGADD <key3> OP_CHECKSIGADD 2 OP_GREATERTHANOREQUAL
With such script psbt becomes:
{
"tx": {
"txid": "c0ee6554b98748d4bddb2f1fefae3e3470f70ba4901fceb56caf1df502cca29c",
"hash": "c0ee6554b98748d4bddb2f1fefae3e3470f70ba4901fceb56caf1df502cca29c",
"version": 2,
"size": 82,
"vsize": 82,
"weight": 328,
"locktime": 0,
"vin": [
{
"txid": "c660a8f365c54bf78f5a7f7d59d7b02d81d76434117433e0719f50b19d793c3f",
"vout": 0,
"scriptSig": {
"asm": "",
"hex": ""
},
"sequence": 0
}
],
"vout": [
{
"value": 0.00098000,
"n": 0,
"scriptPubKey": {
"asm": "0 885d64578216908d6e0a745295149a648deb89cb",
"desc": "addr(bcrt1q3pwkg4uzz6gg6ms2w3ff29y6vjx7hzwt6dg29t)#2kplfgfu",
"hex": "0014885d64578216908d6e0a745295149a648deb89cb",
"address": "bcrt1q3pwkg4uzz6gg6ms2w3ff29y6vjx7hzwt6dg29t",
"type": "witness_v0_keyhash"
}
}
]
},
"global_xpubs": [
],
"psbt_version": 0,
"proprietary": [
],
"unknown": {
},
"inputs": [
{
"witness_utxo": {
"amount": 0.00100000,
"scriptPubKey": {
"asm": "1 acd1d2a6e6b8a5366046fc8c4b0beb0f1f731416ddfc2b6ce5e8a6ec05494d22",
"desc": "rawtr(acd1d2a6e6b8a5366046fc8c4b0beb0f1f731416ddfc2b6ce5e8a6ec05494d22)#l0v0wqh8",
"hex": "5120acd1d2a6e6b8a5366046fc8c4b0beb0f1f731416ddfc2b6ce5e8a6ec05494d22",
"address": "bcrt1p4nga9fhxhzjnvczxljxykzltpu0hx9qkmh7zkm89aznwcp2ff53qlumd30",
"type": "witness_v1_taproot"
}
},
"witness_script": {
"asm": "1ab6538f0041c05f205f04b8f98f671ab30059ebabba92abfc0b717b663ff6e8 OP_CHECKSIG 6b198710ea0801dd2bd0fa492745ade0287a56ad3de5db3b16cb2da00d67dd0d OP_CHECKSIGADD dcd39254d982fc1e65e71b765e278115a53d25351ccebf64c213d70f69804957 OP_CHECKSIGADD 2 OP_GREATERTHANOREQUAL",
"hex": "201ab6538f0041c05f205f04b8f98f671ab30059ebabba92abfc0b717b663ff6e8ac206b198710ea0801dd2bd0fa492745ade0287a56ad3de5db3b16cb2da00d67dd0dba20dcd39254d982fc1e65e71b765e278115a53d25351ccebf64c213d70f69804957ba52a2",
"type": "nonstandard"
},
"taproot_scripts": [
{
"script": "201ab6538f0041c05f205f04b8f98f671ab30059ebabba92abfc0b717b663ff6e8ac206b198710ea0801dd2bd0fa492745ade0287a56ad3de5db3b16cb2da00d67dd0dba20dcd39254d982fc1e65e71b765e278115a53d25351ccebf64c213d70f69804957ba52a2",
"leaf_ver": 192,
"control_blocks": [
"c150929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0"
]
}
],
"taproot_bip32_derivs": [
{
"pubkey": "dcd39254d982fc1e65e71b765e278115a53d25351ccebf64c213d70f69804957",
"master_fingerprint": "00000000",
"path": "m",
"leaf_hashes": [
]
}
],
"taproot_internal_key": "50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0",
"taproot_merkle_root": "8dcf9fd2a9bff82480b8113d97bdd1f1b0324c58cb7f767421bf4764e6e40536"
}
],
"outputs": [
{
}
],
"fee": 0.00002000
}
In this case bitcoind, returns the same psbt, without taproot_script_path_sigs field or any error.
I actually created question on bitcoin stack exchange - https://bitcoin.stackexchange.com/questions/122759/how-can-i-sign-custom-tapscript-leaf-using-bitcoind-walletprocesspsbt-rpc-endp, but looked into this a bit deeper and isolated
OP_GREATERTHANOREQUAL as op code which made all difference.
Expected behaviour
In this case I would expect:
- either return signatures also for script containing
OP_GREATERTHANOREQUAL - or return error saying that this op_code is not supported for
walletprocesspsbtcall
Steps to reproduce
- Create wallet with the
keywhich should later become part of the multisig. - Create taproot output with one script spending path. The script should be the taproot multi sig (
OP_CHECKSIGADD) withOP_GREATERTHANOREQUALopcode and containkeycreated in step 1 - Create
psbtand callwalletprocesspsbtendpoint on wallet created in step 1 - Response should be an error or psbt with signature made by
key
Relevant log output
No response
How did you obtain Bitcoin Core
Pre-built binaries
What version of Bitcoin Core are you using?
v26.0
Operating system and version
"MacOs Sonoma 14.3"
Machine specifications
No response