I created a musig descriptor with Bitcoin Core:
My addresses:
tpubDCWbaTx1wFG3JHpT5sK7HD2yBDLdoonfz7SN5Jnk3UGXf3EAMNECcDrGQQXP6jccdgcczRnSDTBAXauK19EAbf3KvnHmRCsKk2gGdWP3Xke
tpubDCis6zc7jL21KnV9Rz7zRz2AsFartHsdQx9uVdnd2kVuNpCNX5mhHaMwYrR7YvdT3GKqKVKNDRSz966Z9DjXqUvyz7gHkfh751GBJ68CYab
The keys were master keys from other wallets.
Here was my descriptor:
tr(musig(tpubDCWbaTx1wFG3JHpT5sK7HD2yBDLdoonfz7SN5Jnk3UGXf3EAMNECcDrGQQXP6jccdgcczRnSDTBAXauK19EAbf3KvnHmRCsKk2gGdWP3Xke,tpubDCis6zc7jL21KnV9Rz7zRz2AsFartHsdQx9uVdnd2kVuNpCNX5mhHaMwYrR7YvdT3GKqKVKNDRSz966Z9DjXqUvyz7gHkfh751GBJ68CYab)/<0;1>/*)
No problem with importing or deriving addresses:
$ bitcoin-cli -rpcwallet=musig importdescriptors '''[{ "desc": "'$DESC_WITH_CS'", "timestamp": "now" }]'''
[
{
"success": true,
"warnings": [
"Range not given, using default keypool range"
]
}
]
$ bitcoin-cli deriveaddresses $DESC_WITH_CS 0
[
[
"tb1p8ec2pt8z0djun9q93ld6zex5ep4surrqhqa5za455mw53qdruw6srfsshm"
],
[
"tb1p3k5h98dr8a7qnzt94sc0mxrkpkdmzuzfp6vgavk62mz63x8nhxyq3ns6ue"
]
]
But after I sent funds to address I haven’t had any success spending it.
When I tried to create a PSBT, I could walletprocesspsbt with results from my watch-only wallet with the descriptor, but the wallets with the master private keys did nothing.
When I tried to create a raw transaction and tried to sign with the keys, I got "signrawtransactionwithkey". When I instead tried to sign with the wallet, I got "error": "Witness program was passed an empty witness".
$ echo $rawtxhex
0200000001b08b225fa135d9a8826339ac2fa37ef51a61acbbf9b8933ebc98a4b4e15753230000000000fdffffff015099070000000000225120aac35fe91f20d48816b3c83011d117efa35acd2414d36c1e02b0f29fc3106d9000000000
$ bitcoin-cli signrawtransactionwithkey $rawtxhex "[\"tprv8ZgxMBicQKsPeSdLpZFD8rq5tsayj5PbX4Uo9Lm5PkebmzNXnR5aYTixCSJ4AYgPAPrvDHx7K6B3WdoxigCWKnBeR6DSxXzqpCPHQx2EZx9/0/0\", \"tprv8ZgxMBicQKsPdeCH2GoLphFYHXxr1YzG7Fxpc83SAhJukmLD7V73qqRUEN3b4gCrhc4ZaQJjQMXFtpQvc2r7W38FNxLfswiWK3xco12aMPK/0/0\"]"
error code: -5
error message:
Invalid private key
$ bitcoin-cli -rpcwallet=mainwallet signrawtransactionwithwallet $rawtxhex
{
"hex": "0200000001b08b225fa135d9a8826339ac2fa37ef51a61acbbf9b8933ebc98a4b4e15753230000000000fdffffff015099070000000000225120aac35fe91f20d48816b3c83011d117efa35acd2414d36c1e02b0f29fc3106d9000000000",
"complete": false,
"errors": [
{
"txid": "235357e1b4a498bc3e93b8f9bbac611af57ea32fac396382a8d935a15f228bb0",
"vout": 0,
"witness": [
],
"scriptSig": "",
"sequence": 4294967293,
"error": "Witness program was passed an empty witness"
}
]
}
What’s the best practice for doing this? (PSBT or raw transaction?)
And what am I doing wrong?
Thanks!











