New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bitcoin-cli submitblock template #26830
Comments
It looks like the block header variables are:
So, there are six total variables that need to be submitted. Interestingly, the bitcoin.cpp file in Bitcoin Core does not include a reference to
There must also be a way to determine file format, whether bytecode or JSON. |
Answer to 1.
Answer to 2. |
Is your feature request related to a problem? Please describe.
Yes. I am working on using the
bitcoin-cli submitblock
method. However, one problem is there is no way to determine two keystone issues with respect to block validation.Describe the solution you'd like
I'd like a standard form example for
submitblock
. For example, aJSON
file ortxt
file that could be used as a template. The template could be stored asmydata
and submitted to the network for validation viabitcoin-cli submitblock mydata
. It would also be great if there was a guide that provided exactly what was required to be hashed. Generally, the solution would define the mathematical inputs and outputs required for block validation, as suggested in the Forum.As I understand it, the goal is to find a nonce, that when hashed is equal to or less than the hash of the previous block. However, if that were true, then in theory it would only require submitting one
32-bit number
to the network viasubmitblock
. Still, the documentation discusses so much more, such asMerkle Roots
andCoinbase Transactions
. So, the ideal solution would be able to cut out all noise and take a minimalist approach to answering 1 and 2.Describe alternatives you've considered
The Bitcoin Core Documentation for the
bitcoin-cli submitblock
method is extremely vague regarding the data formatting. According to the Docs,So, while this tells the reader one way to run this method is
bitcoin-cli submitblock
, no explanation is given for"mydata"
. As a result, it isn't clear how to actually run the function because there is no way to know what"mydata"
is or how to appropriately format it.In the Bitcoin Developer Reference Guide, there is a lot of information about block headers, but no actual file regarding the needed structure for
bitcoin-cli submitblock
. We do see an example in hex format of a block header, but it isn't clear what file format the data needs to be stored in or how the block header is generated.Perhaps the best existing solution for what to submit can be found on Stack Exchange.
Still, there is no reference to the proper format for this data or how it is derived.
Another example, comes from the Block Hashing Algorithm Wiki. The general requirements for the block header are made available.
Moreover, also included is code for the
header_hex
.The issue here though is that there is no guidance on how to get the block header data, what format to use for storage, or what to submit to the network using the
bitcoin-cli submitblock
method.Finally, BIP0022 defines the protocol for block submission.
But, the issue here is that there isn't any information on what the required parameters are for
submitblock
. There is much mention of JSON formatting throughout the Bitcoin Core protocol, but it is not clear if the proper template forsubmitblock
requires JSON formatting or some other hexadigit form. While the BIP says there are two arguments taken, no information is given regarding those arguments: 1) a string of the hex-encoded block data to submit; and 2) an object of parameters. Additionally, there is no further information onworkid
other than a data type and the description "if the server provided a workid, it MUST be included with submissions."Additional context
Running
bitcoin-cli getblocktemplate
gives a lot of data about the blockchain and previous transaction. However, one issue is that it provides both thepreviousblockhash
andtarget
variables. So, it isn't clear what should be solved for with the hash algorithm.I apologize for the noob feature request here. I've done my best to aggregate information and knowledge sources on this feature request, but I have not found the information to answer the two most important questions. I think it could be possible that there is more than one right answer, but I need to start with one first.
Thanks in advance for any suggestions or feedback here.
The text was updated successfully, but these errors were encountered: