16
votes
Accepted
What's the most efficient way to create a raw transaction with a specific fee rate?
Yes! The trick is to count each input with its effective value rather than its nominal value.
Transactions are composed of three parts: the overhead, the inputs and the outputs.
Outputs:
The size of ...
8
votes
Accepted
Breaking down a raw transaction:
The bolded byte in the following raw transaction is the number of outputs (two in this transaction):
...
8
votes
Accepted
How to disable RBF in Bitcoin Core?
walletrbf=0 only disables RBF when creating transactions through wallet RPCs such as sendtoaddress, sendmany or sendall. If you use the low-level RPC createrawtransaction, you need to either set the ...
7
votes
What does "operation not valid with the current stack size" mean?
The signrawtransaction RPC will verify the input scripts of the transaction after it signs it. If the transaction has not been fully signed (i.e. it isn't complete), then the script verification will ...
6
votes
What's the most efficient way to create a raw transaction with a specific fee rate?
Kind of, but coin selection is hard in general. The idea is that inputs pay for themselves. It is easy to compute how much in fees you will need to pay for an input at a given fee rate. So when you do ...
6
votes
Accepted
Function combinerawtransaction is not working
The issue here is that the two transactions are different, and combinerawtransaction does not operate on different transactions (it apparently just silently does nothing). It sounds like you expect ...
5
votes
bitcoin-cli commands like createrawtransaction not working with json on command line
When looking at the Bitcoin Developer Reference I saw an example where they use two additional '' before and after the list of inputs in comparison to you. For your input, I also got "Error parsing ...
4
votes
bitcoin-cli commands like createrawtransaction not working with json on command line
Try rewriting your command to
bitcoin-cli -testnet createrawtransaction "[{\"txid\": \"12b8e7ede4992f4d30f93idj3085746951d945e39f40becebd7c290af8c2e7ad\", \"vout\": 0}]" "{\"...
4
votes
Accepted
Create a raw transaction and broadcast it to blockchain using bitcoin core
EDIT: based on OPs request, I put examples in here:
there are a lot of examples for different tx types on bitcoin.org, in the developer examples. Basically you will need three steps. Assuming you are ...
4
votes
Values for txid and vout for create a coinbase transaction
The coinbase transaction contains a single input, which has txid set to 0000000000000000000000000000000000000000000000000000000000000000 and vout set to 0xFFFFFFFF.
4
votes
How to recover and sweep P2PK coins
You can achieve this without any script, simply using the Bitcoin Core wallet. For each public key you received funds on you can import a pk() descriptor containing the corresponding private key, WIF-...
3
votes
Error in creating bitcoin raw transaction
You provided the amount incorrectly. The amount is 0.54551 not 545500. This is important as Segwit inputs include the previous output's amount in the signature. Providing the wrong amount will result ...
3
votes
Accepted
bitcoin-cli createrawtransaction and purpose of "scriptPubKey"?
Currently, the create raw transaction method only uses the txid and vout parameters from that argument. You can view the relevant part of the source here.
For all practical purposes, you could pass in ...
3
votes
Accepted
Is there a way to create coinbase transactions with an RPC command?
Yep, it is partially possible with the getblocktemplate RPC command.
This is what miners routinely use to obtain the information necessary to begin mining a block.
The exact parameters and response ...
3
votes
Accepted
How to push a raw transaction using BitcoinJS (and Request)?
Body must be a string.
You can use form instead of body.
Reference:
https://www.npmjs.com/package/request#forms
3
votes
Accepted
Unable to create raw transaction with json-rpc command
Here is the correct json:
createrawtransaction '[{"txid":"0000000000000000000000000000000000000000000000000000000000000000","vout":0}]' '{"1Ka3q3DVTBNBo2c4kVGMNzbd32RARV1FbA":12.5}'
I used 0for ...
3
votes
Accepted
64: non-mandatory-script-verify-flag while broadcasting P2WPKH Bech32 with specific inputs
First of all, these are not P2SH-P2WPKH, these are normal P2WPKH outputs. They are not related to P2SH at all.
The problem here is probably that the amount is incorrect. If you are providing the ...
3
votes
When and where to add extra information when signing P2SH raw transaction?
Bitcoin Core's signrawtransaction RPC does not know about the specific type of script you're trying to sign for, and won't be usable.
You'll need to implement the signing logic yourself.
3
votes
What does "operation not valid with the current stack size" mean?
I have faced the same issue
i was trying to creat a raw transaction with erronerous Vout (1 instead 0)
bitcoin-cli createrawtransaction "[{\"txid\": \"...
3
votes
How to send bitcoins with commission extracted from payment in PHP or bitcoind
Here is the algorythm without the code:
createrawtransaction with amount that you want to send assuming that fees are 0
fundrawtransaction to let your bitcoind construct final transaction, put your ...
3
votes
Accepted
Create raw transaction what txid
In the console do listunspent
that will show you all the UTXO in your wallet including the txids.
You can type help to get a list of commands,
then help <command> to get details about each ...
3
votes
Accepted
Bitcoin-cli how to createrawtransaction without spending entire input?
Is there any possible way to create a raw transaction using Bitcoin-cli createrawtransaction API that doesn't require spending the entire input?
No. It's an inherent feature of the Bitcoin protocol ...
3
votes
Accepted
What "Data" should be inserted into the argument field of the "createrawtransaction" rpc command
The data field is only for when you want to create data-carrying transactions (ones with an OP_RETURN). This is generally not needed in normal transactions (and its usage there is somewhat ...
3
votes
json parsing error with createrawtransaction with bitcoin-cli in regtest
Using quotes and escaping like this should work on Windows:
createrawtransaction "[{\"txid\":\"7b2d65b85487a891a3e0a9c541975fa7e681e571ea18982da49402e594ca2af1\",\"vout\&...
2
votes
Accepted
How to estimate mining fee for raw transaction?
Have a look at fundrawtransaction (if you are okay using the internal wallet).
fundrawtransaction will give you back the used fee (next to the hex byte-array of the funded transaction) before signing ...
2
votes
Accepted
createrawtransaction and fundrawtransaction
There are many more parameters than number of confirmations for input selection. It mainly depends on the amounts used in the outputs because eventually enough inputs have to be used to cover the ...
2
votes
Accepted
Why do I get 5 bytes worth of 0x00 hex values in both outputs?
The value of an output in a transaction is a 8-byte field encoded in little-endian. The value is always represented with 8 bytes no matter how small it is. Here you have the full transaction structure ...
2
votes
Accepted
bitcoin rpc api createrawtransaction with python returns -3: Expected type array, got object
You are providing it an Object in JSON, not an array just as the error states.
return {"txid": sourcetransaction['txid'] ,"vout":sourcetransaction['vout']}
I would try creating it from a ...
2
votes
Accepted
Bitcoin-cli createrawtransaction with 3 outputs example
You need to use (simplified notation) [{addr:amount},{addr:amount}] for the outputs, not [{addr:amount,addr:amount}]. This is to permit multiple outputs with the same address (which wouldn't be valid ...
2
votes
The nlocktime parameter in createrawtransaction seems not work using Bitcoin Core Wallet GUI
You're putting the locktime in the wrong place. You have
"[{\"txid\":\"myid\",\"vout\":0}]" "{\"address\":0.01, \"address\":0.01} 20"
but it should really be
"[{\"txid\":\"myid\",\"vout\":0}]" "{\"...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
createrawtransaction × 58raw-transaction × 17
bitcoin-core × 15
bitcoind × 14
bitcoin-cli × 14
transactions × 13
signrawtransaction × 13
json-rpc × 10
coinbase-transaction × 5
sendrawtransaction × 5
multi-signature × 3
wallet × 2
transaction-fees × 2
script × 2
testnet × 2
windows × 2
output × 2
transaction-id × 2
bcoin × 2
blockchain × 1
address × 1
mining-theory × 1
api × 1
unconfirmed-transactions × 1
segregated-witness × 1