Clarification on the use of getblocktemplate RPC method.



Summary:

The author of the post has recently become interested in the bitcoin protocol and has been using GNU guile scheme to experiment with it. However, the author has run into inconsistencies with the documentation found on https://en.bitcoin.it/wiki/Getblocktemplate regarding the creation of the templates merkle root. According to the author's understanding, a coinbase transaction should have the transactions data concatenated before creating the merkle root. But getblocktemplate does not have a json cointbasetxn field, leaving the author unsure how to create a coinbase transaction without that. The author has provided links to a test template response data and a modified version of the merkle python reference script found on the wiki page. Using these resources, the author has been able to create a merkle root with the hash c5fff939f628a04428c080ed5bd7cd9bc0b4722b2522743049adb18213adf28a but minus the coinbase transaction. The author is attempting to replicate this hash using the test data in guile but would like to sanitize this so that they are using a coinbase transaction and making sure the python and guile merkle roots match.


Updated on: 2023-05-21T04:10:16.619840+00:00