Bitcoin Forum
April 26, 2024, 05:29:09 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to write raw taproot transaction and apply an RBF flag?  (Read 95 times)
FractalEncrypt (OP)
Newbie
*
Offline Offline

Activity: 21
Merit: 11


View Profile
November 15, 2021, 03:52:01 PM
Merited by ABCbits (1)
 #1

Hi all,
I have 2 unrelated questions, but both about how to properly formulate a transaction template.

1. I'd like to know how to add an RBF indicator to the transaction (and any relevant details).

2. I'd like to know how to create a taproot transaction template I can use

Here's my current standard raw transaction template I use;

Code:

 createrawtransaction \
'[{"txid": "txid1", "vout": vout1},
{"txid": "txid2", "vout": vout2},
{"txid": "txid3", "vout": vout3},
{"txid": "txid4", "vout": vout4}]' \
'{"address1": Amount1,
"address2": Amount2,
"address3": Amount3,
"address4": Amount4}'


If there are any resources you can point me to, please let me know.

The software I am using to create, sign, and send transactions is Bitcoin Core QT (console)

Edit I found this, looks like the address type I need to get will use this command -getnewaddress "" "bech32m"
The rest of this post is gonna take a few times of me reading it to get my head around this...
https://bitcoin.stackexchange.com/questions/108006/how-to-make-a-taproot-transaction-with-bitcoin-cli
1714152549
Hero Member
*
Offline Offline

Posts: 1714152549

View Profile Personal Message (Offline)

Ignore
1714152549
Reply with quote  #2

1714152549
Report to moderator
1714152549
Hero Member
*
Offline Offline

Posts: 1714152549

View Profile Personal Message (Offline)

Ignore
1714152549
Reply with quote  #2

1714152549
Report to moderator
"In a nutshell, the network works like a distributed timestamp server, stamping the first transaction to spend a coin. It takes advantage of the nature of information being easy to spread but hard to stifle." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714152549
Hero Member
*
Offline Offline

Posts: 1714152549

View Profile Personal Message (Offline)

Ignore
1714152549
Reply with quote  #2

1714152549
Report to moderator
1714152549
Hero Member
*
Offline Offline

Posts: 1714152549

View Profile Personal Message (Offline)

Ignore
1714152549
Reply with quote  #2

1714152549
Report to moderator
1714152549
Hero Member
*
Offline Offline

Posts: 1714152549

View Profile Personal Message (Offline)

Ignore
1714152549
Reply with quote  #2

1714152549
Report to moderator
TheArchaeologist
Sr. Member
****
Offline Offline

Activity: 310
Merit: 727


---------> 1231006505


View Profile WWW
November 15, 2021, 07:40:39 PM
Merited by NeuroticFish (2), ABCbits (2), nc50lc (1)
 #2

Hi all,
I have 2 unrelated questions, but both about how to properly formulate a transaction template.

1. I'd like to know how to add an RBF indicator to the transaction (and any relevant details).

Here's my current standard raw transaction template I use;

Code:

 createrawtransaction \
'[{"txid": "txid1", "vout": vout1},
{"txid": "txid2", "vout": vout2},
{"txid": "txid3", "vout": vout3},
{"txid": "txid4", "vout": vout4}]' \
'{"address1": Amount1,
"address2": Amount2,
"address3": Amount3,
"address4": Amount4}'

The software I am using to create, sign, and send transactions is Bitcoin Core QT (console)
In createrawtransaction, there's an optional sequence field that you can set when specifying the inputs. To set a transaction to Opt into RBF, you need to set the sequence for at least one input to be 4294967293 or lower.

Sooner or later you're going to realize, just as I did, that there's a difference between knowing the path and walking the path
FractalEncrypt (OP)
Newbie
*
Offline Offline

Activity: 21
Merit: 11


View Profile
November 15, 2021, 08:51:26 PM
 #3

Thank you!
I ran the help for createrawtransaction and I see what you're saying about the sequence field. I also see it references locktime and replaceable fields. Replaceable seems like it would need to be set to True to turn on RBF, correct?

For the sequence number, it can be anything as long as it's lower than 4294967293? (and lol where does that number come from? Now I am curious AF)
FractalEncrypt (OP)
Newbie
*
Offline Offline

Activity: 21
Merit: 11


View Profile
November 15, 2021, 08:58:55 PM
 #4

I was able to find my RBF answer here
https://github.com/BlockchainCommons/Learning-Bitcoin-from-the-Command-Line/blob/master/05_2_Resending_a_Transaction_with_RBF.md

But do I need a sequence for each input? If I have 4 inputs, do I need 4 sequence fields?
TheArchaeologist
Sr. Member
****
Offline Offline

Activity: 310
Merit: 727


---------> 1231006505


View Profile WWW
November 15, 2021, 10:03:07 PM
Merited by ABCbits (1), nc50lc (1)
 #5

I was able to find my RBF answer here
https://github.com/BlockchainCommons/Learning-Bitcoin-from-the-Command-Line/blob/master/05_2_Resending_a_Transaction_with_RBF.md

But do I need a sequence for each input? If I have 4 inputs, do I need 4 sequence fields?
This is described in BIP-125 (https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki):
  • Explicit signaling: A transaction is considered to have opted in to allowing replacement of itself if any of its inputs have an nSequence number less than (0xffffffff - 1).

So one sequence is enough.

Sooner or later you're going to realize, just as I did, that there's a difference between knowing the path and walking the path
Pages: [1]
  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!