Bitcoin Stack Alternate is a query and reply web site for Bitcoin crypto-currency lovers. It solely takes a minute to enroll.
Anyone can ask a query
Anyone can reply
The perfect solutions are voted up and rise to the highest
Requested
Seen
563 occasions
I wish to generate a transaction with createrawtransaction
such that it may be handed to submitblock
together with the block header.
I attempted to make use of:
[{"txid":"0000000000000000000000000000000000000000000000000000000000000000","vout":0}]{"bc1qd8hza5w3mz7t3tudtlplm9xht4sjwg0e3t9gy2":6.25000000}
but it surely’s not outputting a coinbase transaction:
020000000100000000000000000000000000000000000000000000000000000000000000000000000000ffffffff0140be40250000000016001469ee2ed1d1d8bcb8af8d5fc3fd94d75d612721f900000000
8
It’s not attainable to create a coinbase transaction utilizing createrawtransaction
. There are quite a few guidelines that coinbase transactions should comply with that the createrawtransaction
RPC doesn’t have the power to set the fields to satisfy these guidelines. For instance, BIP 34 requires the coinbase comprise the block’s top within the scriptSig. Nevertheless createrawtransaction
doesn’t help you set the something within the scriptSig.
Miners should use software program that may independently create the coinbase transaction. Miners really desire doing this as a result of they need to have the ability to modify the coinbase to make use of as an additional nonce in order that once they run out of nonces, they do not essentially should re-select the transactions to incorporate within the block. As a substitute they’ll change the coinbase to trigger the merkle root to alter.
In keeping with BIP 34, you have to embody the block Top to your Coinbase transaction, in any other case, it is going to be invalid,
The scryptSig of your coinbase transaction, should start with variety of pushed bytes (Really is 0x03) after which the hex illustration of your candidate block, dont overlook the little endian conversion