Bitcoin Forum
April 28, 2024, 12:53:13 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: Bitcoin Taproot transaction STEP BY STEP on bitcoin-cli...  (Read 470 times)
cfbtcman (OP)
Member
**
Offline Offline

Activity: 264
Merit: 16


View Profile
October 02, 2023, 05:30:38 PM
Last edit: October 02, 2023, 06:56:26 PM by cfbtcman
 #1

Hi guys,

I'm starting this topic after googling a lot about this and don't find nothing.

So, I'm offering a prize of €50 in Lightning Satoshis to the first guy that presents the solution, a step by step guide to move some part of the sats from one taproot address to another taproot address with the change coming back for the first one on mainnet.

This need to be done with node bitcoin-cli commands and explained step-by-step  for any newbie in the world that uses a bitcoin node could do it.

Until now I just met guys with nodes that can't do it, I think is time for everyone knows how to use it.

More questions you can send me PM.

PS: "Let's lead the way and show the light of day."
Each block is stacked on top of the previous one. Adding another block to the top makes all lower blocks more difficult to remove: there is more "weight" above each block. A transaction in a block 6 blocks deep (6 confirmations) will be very difficult to remove.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714308793
Hero Member
*
Offline Offline

Posts: 1714308793

View Profile Personal Message (Offline)

Ignore
1714308793
Reply with quote  #2

1714308793
Report to moderator
1714308793
Hero Member
*
Offline Offline

Posts: 1714308793

View Profile Personal Message (Offline)

Ignore
1714308793
Reply with quote  #2

1714308793
Report to moderator
btclightning
Newbie
*
Offline Offline

Activity: 3
Merit: 2


View Profile
October 02, 2023, 06:57:12 PM
Merited by albert0bsd (1)
 #2

Google it,    https://bitcoin.stackexchange.com/questions/107452/how-can-i-spend-from-a-p2tr-address-on-signet-with-the-bitcoin-core-wallet-in-22?rq=1

NotATether
Legendary
*
Offline Offline

Activity: 1582
Merit: 6697


bitcoincleanup.com / bitmixlist.org


View Profile WWW
October 03, 2023, 12:57:23 PM
 #3

The process of sending money from a Taproot wallet in Bitcoin Core to another taproot address is exactly the same as sending from any other kind of wallet.

This guy has already created step by step instructions of commands that you need to run to make it work: https://stackoverflow.com/questions/38493893/heres-how-to-send-raw-transaction-btc-using-bitcoin-cli-command

Transactions inputs are specified with UTXOs, so there's no need to specify the addresses themselves directly in the inputs.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
cfbtcman (OP)
Member
**
Offline Offline

Activity: 264
Merit: 16


View Profile
October 03, 2023, 06:05:02 PM
 #4

The process of sending money from a Taproot wallet in Bitcoin Core to another taproot address is exactly the same as sending from any other kind of wallet.

This guy has already created step by step instructions of commands that you need to run to make it work: https://stackoverflow.com/questions/38493893/heres-how-to-send-raw-transaction-btc-using-bitcoin-cli-command

Transactions inputs are specified with UTXOs, so there's no need to specify the addresses themselves directly in the inputs.

Maybe in testnet, have you tried yourself in mainnet to see if it works?
I think you will be surprised.
Greg Tonoski
Member
**
Offline Offline

Activity: 115
Merit: 68


View Profile
October 04, 2023, 06:49:28 AM
Last edit: October 23, 2023, 08:13:18 AM by Greg Tonoski
Merited by albert0bsd (1)
 #5

I did both testnet and mainnet. There are the instructions (the step-by-step example of spending from the tb1p8wpt9v4frpf3tkn0srd97pksgsxc5hs52lafxwru9kgeephvs7rqlqt9zj Taproot address to the other Taproot one: tb1p90h6z3p36n9hrzy7580h5l429uwchyg8uc9sz4jwzhdtuhqdl5eqmpwq6n; you can add the change and the corresponding address by modifying the createrawtransaction RPC in the example; remove "-testnet" option if you want mainnet):

Code:
$ ./bitcoin-cli.exe -testnet createrawtransaction '[{"txid":"8cdf19ed3ade4af038314ef58b116a523f99aa1c585ca3c157ce5386f9df6421","vout":0}]' '[{"tb1p90h6z3p36n9hrzy7580h5l429uwchyg8uc9sz4jwzhdtuhqdl5eqmpwq6n":0.00001000}]'
$ ./bitcoin-cli.exe -testnet importdescriptors '[ { "desc" : "tr(cV628xvqToz45dwdPmTcJ9RgEVnWMwP8dpZBGzb9LfTk3sBHFNwc)#8skcj28y", "timestamp" : "now" } ]'
$ ./bitcoin-cli.exe -testnet signrawtransactionwithwallet "02000000012164dff98653ce57c1a35c581caa993f526a118bf54e3138f04ade3aed19df8c0000000000fdffffff01e8030000000000002251202befa14431d4cb71889ea1df7a7eaa2f1d8b9107e60b01564e15dabe5c0dfd3200000000" '[{"txid": "8cdf19ed3ade4af038314ef58b116a523f99aa1c585ca3c157ce5386f9df6421", "vout": 0, "scriptPubKey": "5120c38859777bc9c3294d3587035fc3823a146dabaab1fa250bc04e92f16887a065", "amount": 0.00000000}]' "DEFAULT"
$ ./bitcoin-cli.exe -testnet sendrawtransaction 020000000001012164dff98653ce57c1a35c581caa993f526a118bf54e3138f04ade3aed19df8c0000000000fdffffff01e8030000000000002251202befa14431d4cb71889ea1df7a7eaa2f1d8b9107e60b01564e15dabe5c0dfd320140f10fc6bb1d414d4c888838fb6b1699c3e538331d32b64b5baf85c1cc34e2c43eb7bdd7a14fd4a4a07341d1b0390ad977be711bc49df786982243c6564a33f6b400000000
Source: "https://bitcoin.stackexchange.com/a/117013/135945".

Is that what you are looking for?
cfbtcman (OP)
Member
**
Offline Offline

Activity: 264
Merit: 16


View Profile
October 04, 2023, 03:42:11 PM
 #6

I did both testnet and mainnet. There are the instructions (the step-by-step example of spending from the tb1p8wpt9v4frpf3tkn0srd97pksgsxc5hs52lafxwru9kgeephvs7rqlqt9zj Taproot address to the other Taproot one: tb1p90h6z3p36n9hrzy7580h5l429uwchyg8uc9sz4jwzhdtuhqdl5eqmpwq6n; you can add the change and the corresponding address by modifying the createrawtransaction RPC in the example; remove "-testnet" option if you want mainnet):

Code:
$ ./bitcoin-cli.exe -testnet createrawtransaction '[{"txid":"8cdf19ed3ade4af038314ef58b116a523f99aa1c585ca3c157ce5386f9df6421","vout":0}]' '[{"tb1p90h6z3p36n9hrzy7580h5l429uwchyg8uc9sz4jwzhdtuhqdl5eqmpwq6n":0.00001000}]'
$ ./bitcoin-cli.exe -testnet importdescriptors '[ { "desc" : "tr(cV628xvqToz45dwdPmTcJ9RgEVnWMwP8dpZBGzb9LfTk3sBHFNwc)#8skcj28y", "timestamp" : "now" } ]'
$ ./bitcoin-cli.exe -testnet signrawtransactionwithwallet "02000000012164dff98653ce57c1a35c581caa993f526a118bf54e3138f04ade3aed19df8c0000000000fdffffff01e8030000000000002251202befa14431d4cb71889ea1df7a7eaa2f1d8b9107e60b01564e15dabe5c0dfd3200000000" '[{"txid": "8cdf19ed3ade4af038314ef58b116a523f99aa1c585ca3c157ce5386f9df6421", "vout": 0, "scriptPubKey": "5120c38859777bc9c3294d3587035fc3823a146dabaab1fa250bc04e92f16887a065", "amount": 0.00000000}]' "DEFAULT"
$ ./bitcoin-cli.exe -testnet sendrawtransaction 020000000001012164dff98653ce57c1a35c581caa993f526a118bf54e3138f04ade3aed19df8c0000000000fdffffff01e8030000000000002251202befa14431d4cb71889ea1df7a7eaa2f1d8b9107e60b01564e15dabe5c0dfd320140f10fc6bb1d414d4c888838fb6b1699c3e538331d32b64b5baf85c1cc34e2c43eb7bdd7a14fd4a4a07341d1b0390ad977be711bc49df786982243c6564a33f6b400000000
Source: "https://bitcoin.stackexchange.com/a/117013/135945".

Is that what you are looking for?


This command:

./bitcoin-cli.exe -testnet signrawtransactionwithwallet "02000000012164dff98653ce57c1a35c581caa993f526a118bf54e3138f04ade3aed19df8c00000 00000fdffffff01e8030000000000002251202befa14431d4cb71889ea1df7a7eaa2f1d8b9107e6 0b01564e15dabe5c0dfd3200000000" '[{"txid": "8cdf19ed3ade4af038314ef58b116a523f99aa1c585ca3c157ce5386f9df6421", "vout": 0, "scriptPubKey": "5120c38859777bc9c3294d3587035fc3823a146dabaab1fa250bc04e92f16887a065", "amount": 0.00000000}]' "DEFAULT"

At least in mainnet will output something like this:

"complete": false,
       "error": "Witness program was passed an empty witness"

Can you test it on mainnet and see?

Even the syntax of the command is not well done, the last parameter "DEFAULT" don't exist, here is the right syntax of it:

Argument #3 - sighashtype
Type: string, optional, default=ALL

The signature hash type. Must be one of
“ALL” “NONE” “SINGLE” “ALL|ANYONECANPAY” “NONE|ANYONECANPAY” “SINGLE|ANYONECANPAY”


If you want to use the default value you need to put ALL and not DEFAULT, some beginner made that.
pooya87
Legendary
*
Offline Offline

Activity: 3430
Merit: 10505



View Profile
October 05, 2023, 05:25:59 AM
 #7

signrawtransactionwithwallet

"complete": false,
       "error": "Witness program was passed an empty witness"
Do you also have the wallet containing the "tb1p8wp...." address?
I believe this error thrown because when you "sign with wallet" it has to have the address and the scripts used to create that address otherwise it doesn't know what to do and it gives you this error when it is missing the required "witnessScript".

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Greg Tonoski
Member
**
Offline Offline

Activity: 115
Merit: 68


View Profile
October 05, 2023, 06:54:53 AM
 #8


This command:

./bitcoin-cli.exe -testnet signrawtransactionwithwallet "02000000012164dff98653ce57c1a35c581caa993f526a118bf54e3138f04ade3aed19df8c00000 00000fdffffff01e8030000000000002251202befa14431d4cb71889ea1df7a7eaa2f1d8b9107e6 0b01564e15dabe5c0dfd3200000000" '[{"txid": "8cdf19ed3ade4af038314ef58b116a523f99aa1c585ca3c157ce5386f9df6421", "vout": 0, "scriptPubKey": "5120c38859777bc9c3294d3587035fc3823a146dabaab1fa250bc04e92f16887a065", "amount": 0.00000000}]' "DEFAULT"

At least in mainnet will output something like this:

"complete": false,
       "error": "Witness program was passed an empty witness"

Can you test it on mainnet and see?

Even the syntax of the command is not well done, the last parameter "DEFAULT" don't exist, here is the right syntax of it:

Argument #3 - sighashtype
Type: string, optional, default=ALL

The signature hash type. Must be one of
“ALL” “NONE” “SINGLE” “ALL|ANYONECANPAY” “NONE|ANYONECANPAY” “SINGLE|ANYONECANPAY”


If you want to use the default value you need to put ALL and not DEFAULT, some beginner made that.

I suggest checking that the command is executed with the correct wallet loaded (the one where descriptor had been imported). It may be easier to do it within Bitcoin Core GUI console.

I verified all in Bitcoin Core versions 24 and 25 where the "DEFAULT" argument is accepted.
nc50lc
Legendary
*
Offline Offline

Activity: 2394
Merit: 5543


Self-proclaimed Genius


View Profile
October 05, 2023, 07:36:22 AM
Merited by ABCbits (3), DaveF (2), pooya87 (2)
 #9

Use PSBT instead of raw transaction:

Firstly, import the necessary descriptor to the wallet if it's not available (command already provided).

Secondly, create a partially signed Bitcoin transaction:
Code:
createpsbt "[{\"txid\":\"<TXID>\",\"vout\":<N>}]" "[{\"<address1>\":<amount1>},{\"<address2>\":<amount2>}]"
Thirdly, process the psbt (update, sign):
Code:
walletprocesspsbt "<PSBT from above command>"
Fourthly, finalize it:
Code:
finalizepsbt "<processed PSBT from above command>"
Lastly, send it to mempool:
Code:
sendrawtransaction "<signed raw transaction from above command>"

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
cfbtcman (OP)
Member
**
Offline Offline

Activity: 264
Merit: 16


View Profile
October 05, 2023, 05:09:40 PM
 #10

Use PSBT instead of raw transaction:

Firstly, import the necessary descriptor to the wallet if it's not available (command already provided).

Secondly, create a partially signed Bitcoin transaction:
Code:
createpsbt "[{\"txid\":\"<TXID>\",\"vout\":<N>}]" "[{\"<address1>\":<amount1>},{\"<address2>\":<amount2>}]"
Thirdly, process the psbt (update, sign):
Code:
walletprocesspsbt "<PSBT from above command>"
Fourthly, finalize it:
Code:
finalizepsbt "<processed PSBT from above command>"
Lastly, send it to mempool:
Code:
sendrawtransaction "<signed raw transaction from above command>"

Hi, thanks for the answer, I have also tested without success, seems the wallet can't sign.

I read that is only supported in last core version 25 and for moments I can't try it because I only have 23 and is a testing node that I don't control.

Have you tested it with success on what core version?
nc50lc
Legendary
*
Offline Offline

Activity: 2394
Merit: 5543


Self-proclaimed Genius


View Profile
October 06, 2023, 05:08:45 AM
Merited by DaveF (2)
 #11

Have you tested it with success on what core version?
Version 25, but I tested it with a ranged descriptor that can derive the input's prvKey.

I read that is only supported in last core version 25 and for moments I can't try it because I only have 23 and is a testing node that I don't control.
Do you mean a node that doesn't contain the descriptor with private key?
Because walletprocesspsbt wont work in that case since it relies on the descriptor that can sign that particular PSBT.

Otherwise, I should've noted to use: utxoupdatepsbt after creating the PSBT.
Here's the command (use between the second and third steps):
Code:
utxoupdatepsbt "<PSBT from createpsbt command>"
or
Code:
utxoupdatepsbt "<PSBT from createpsbt command>" "[\"<related descriptor with checksum>\"]"

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
DaveF
Legendary
*
Offline Offline

Activity: 3458
Merit: 6241


Crypto Swap Exchange


View Profile WWW
October 06, 2023, 11:39:26 AM
 #12

....I read that is only supported in last core version 25 and for moments I can't try it because I only have 23 and is a testing node that I don't control.

Have you tested it with success on what core version?

Yes it works, I just did a quick(ish) test on a 25 node following what nc50lc posted.

This is going to be a bit more snarky then I want it to really come out as, but why are you testing / running on an older node that you don't control?
23 is at maintenance end and will be full EOL in 7 weeks: https://bitcoincore.org/en/lifecycle/

If you are going to be using this to provide a service you should be on a newer version of core.

As I said, it looks more snarky on a screen then I am trying to be, but something you should be thinking about.

-Dave

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
darkv0rt3x
Hero Member
*****
Offline Offline

Activity: 1204
Merit: 657


I rather die on my feet than to live on my knees


View Profile
October 06, 2023, 12:03:07 PM
Merited by nc50lc (1)
 #13

We have tried the simple approach of createrawtransaction, signrawtransactionwithwallet and sendrawtransaction with my node and all commands worked flawlessly. Something he was doing wrong because I didn't face any of his problems!

Bitcoin is energy. Bitcoin is freedom
I rather die on my feet than living on my knees!
nc50lc
Legendary
*
Offline Offline

Activity: 2394
Merit: 5543


Self-proclaimed Genius


View Profile
October 06, 2023, 01:09:07 PM
 #14

We have tried the simple approach of createrawtransaction, signrawtransactionwithwallet and sendrawtransaction with my node and all commands worked flawlessly. Something he was doing wrong because I didn't face any of his problems!
Did you added anything in signrawtransactionwithwallet or just the raw transaction?

Because I tried to spend a TapRoot input and I got the same "Witness program was passed an empty witness" error as OP with
signrawtransactionwithwallet command whether "witnessScript" was included under "prevtxs" or not. (prob. didn't helped bec. it's for P2WSH or P2SH-P2WSH)

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
Greg Tonoski
Member
**
Offline Offline

Activity: 115
Merit: 68


View Profile
October 06, 2023, 03:45:22 PM
 #15

We have tried the simple approach of createrawtransaction, signrawtransactionwithwallet and sendrawtransaction with my node and all commands worked flawlessly. Something he was doing wrong because I didn't face any of his problems!
Did you added anything in signrawtransactionwithwallet or just the raw transaction?

Because I tried to spend a TapRoot input and I got the same "Witness program was passed an empty witness" error as OP with
signrawtransactionwithwallet command whether "witnessScript" was included under "prevtxs" or not. (prob. didn't helped bec. it's for P2WSH or P2SH-P2WSH)
Data in your wallet need refreshing (rescan blockchain), most likely. Alternatively, you could pass the data ("prevtxs") manually in the signrawtransactionwithkey RPC.
nc50lc
Legendary
*
Offline Offline

Activity: 2394
Merit: 5543


Self-proclaimed Genius


View Profile
October 06, 2023, 05:02:19 PM
 #16

-snip-
Data in your wallet need refreshing (rescan blockchain), most likely. Alternatively, you could pass the data ("prevtxs") manually in the signrawtransactionwithkey RPC.
I did another quick test with non-PSBT workflow and it worked this time, without even including "prevtxs" during signrawtransactionwithwallet RPC.
Probably previous sync issue or something.

Anyways, AFAIK signrawtransactionwithkey wont work with TapRoot at the moment.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
darkv0rt3x
Hero Member
*****
Offline Offline

Activity: 1204
Merit: 657


I rather die on my feet than to live on my knees


View Profile
October 06, 2023, 05:51:55 PM
 #17

We have tried the simple approach of createrawtransaction, signrawtransactionwithwallet and sendrawtransaction with my node and all commands worked flawlessly. Something he was doing wrong because I didn't face any of his problems!
Did you added anything in signrawtransactionwithwallet or just the raw transaction?

Because I tried to spend a TapRoot input and I got the same "Witness program was passed an empty witness" error as OP with
signrawtransactionwithwallet command whether "witnessScript" was included under "prevtxs" or not. (prob. didn't helped bec. it's for P2WSH or P2SH-P2WSH)

No, just the output of the createrawtransaction. The only thing I added to all commands was the -rpcwallet=Wallet-name but this has no influence in the command other than to specify the wallet in question!

But you are saying you got that error also with createrawtransaction command? I can try to repeat the commands for you if you want (or if it is still doable)...

Bitcoin is energy. Bitcoin is freedom
I rather die on my feet than living on my knees!
nc50lc
Legendary
*
Offline Offline

Activity: 2394
Merit: 5543


Self-proclaimed Genius


View Profile
October 07, 2023, 06:45:16 AM
 #18

But you are saying you got that error also with createrawtransaction command? I can try to repeat the commands for you if you want (or if it is still doable)...
It was with signrawtransactionwithwallet command that I tried to reproduce based from OP's reply.
But refer to my reply just above yours for the update. (latest test worked)

It may not be a coincidence that I got the same result the first time but the command worked after a while.
So it's either his node is lacking the necessary UTXO, using the incorrect wallet or missing the needed descriptor.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
darkv0rt3x
Hero Member
*****
Offline Offline

Activity: 1204
Merit: 657


I rather die on my feet than to live on my knees


View Profile
October 07, 2023, 08:26:05 AM
 #19

But you are saying you got that error also with createrawtransaction command? I can try to repeat the commands for you if you want (or if it is still doable)...
It was with signrawtransactionwithwallet command that I tried to reproduce based from OP's reply.
But refer to my reply just above yours for the update. (latest test worked)

It may not be a coincidence that I got the same result the first time but the command worked after a while.
So it's either his node is lacking the necessary UTXO, using the incorrect wallet or missing the needed descriptor.

Yeah, probably a sync'ing problem. Somehow, when me and the OP tried the procedure in my node, I didn't even have to do any sync for the wallet. He had sent some sats to that address recently, so, everything was kind of recent. Maybe because of that we didn't have any issues!

Bitcoin is energy. Bitcoin is freedom
I rather die on my feet than living on my knees!
Greg Tonoski
Member
**
Offline Offline

Activity: 115
Merit: 68


View Profile
October 14, 2023, 02:54:37 PM
 #20


This command:

./bitcoin-cli.exe -testnet signrawtransactionwithwallet "02000000012164dff98653ce57c1a35c581caa993f526a118bf54e3138f04ade3aed19df8c00000 00000fdffffff01e8030000000000002251202befa14431d4cb71889ea1df7a7eaa2f1d8b9107e6 0b01564e15dabe5c0dfd3200000000" '[{"txid": "8cdf19ed3ade4af038314ef58b116a523f99aa1c585ca3c157ce5386f9df6421", "vout": 0, "scriptPubKey": "5120c38859777bc9c3294d3587035fc3823a146dabaab1fa250bc04e92f16887a065", "amount": 0.00000000}]' "DEFAULT"

At least in mainnet will output something like this:

"complete": false,
       "error": "Witness program was passed an empty witness"

Can you test it on mainnet and see?

Even the syntax of the command is not well done, the last parameter "DEFAULT" don't exist, here is the right syntax of it:

Argument #3 - sighashtype
Type: string, optional, default=ALL

The signature hash type. Must be one of
“ALL” “NONE” “SINGLE” “ALL|ANYONECANPAY” “NONE|ANYONECANPAY” “SINGLE|ANYONECANPAY”


If you want to use the default value you need to put ALL and not DEFAULT, some beginner made that.

I suggest checking that the command is executed with the correct wallet loaded (the one where descriptor had been imported). It may be easier to do it within Bitcoin Core GUI console.

I verified all in Bitcoin Core versions 24 and 25 where the "DEFAULT" argument is accepted.

What is the result of your attempts, cfbtcman?
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!