1
1
I've been reading lots of articles, trying to understand how to hash the data returned from getwork; but I totally overlooked getblocktemplate.
I'm just trying to understand how all the data below is put together to generate hashes, in order to form a valid block (using various nonces).
Apologies if this has been answered already. I know there are lots of articles on how to put together a block header, and using midstate, etc. Most of that I understand; but the data composition of getblocktemplate is quite a bit different, and really threw me off.
If someone would be kind enough to explain the whole hashing process (from a mining point of view), I'd really appreciate it. A programmatic explanation would be ideal, as I'm trying to make my own mining client.
{
"result":{
"version":2,
"previousblockhash":"00000000000000075f2f454573766ffae69fe41d6c7ccfcabbf8588fcd80ed52",
"transactions":[
{
"data":"0100000001cba672d0bfdbcc441d171ef0723a191bf050932c6f8adc8a05b0cac2d1eb022f010000006c493046022100a23472410d8fd7eabf5c739bdbee5b6151ff31e10d5cb2b52abeebd5e9c06977022100c2cdde5c632eaaa1029dff2640158aaf9aab73fa021ed4a48b52b33ba416351801210212ee0e9c79a72d88db7af3fed18ae2b7ca48eaed995d9293ae0f94967a70cdf6ffffffff02905f0100000000001976a91482db4e03886ee1225fefaac3ee4f6738eb50df9188ac00f8a093000000001976a914c94f5142dd7e35f5645735788d0fe1343baf146288ac00000000",
"hash":"7c90a5087ac4d5b9361d47655812c89b4ad0dee6ecd5e08814d00ce7385aa317",
"depends":[],
"fee":10000,
"sigops":2
},
...
],
"coinbaseaux":{
"flags":"062f503253482f"
},
"coinbasevalue":2501100000,
"target":"0000000000000026222200000000000000000000000000000000000000000000",
"mintime":1379549850,
"mutable":[
"time",
"transactions",
"prevblock"
],
"noncerange":"00000000ffffffff",
"sigoplimit":20000,
"sizelimit":1000000,
"curtime":1379553872,
"bits":"19262222",
"height":258736
},
"error":null,
"id":"curltest"
}
1I read through that, but a lot of the terminology is new to me, and hard to understand. For example, it doesn't explain the parameters it's passing in, and their significance -
{"capabilities": ["coinbasetxn", "workid", "coinbase/append"]}. Also, on the return data -'"mutable":["time","transactions","prevblock"]vs"mutable": ["coinbase/append"]. On my GBT response, it hascoinbaseaux flagsinstead ofcoinbasetxn data- what's the significance of that? What exactly doesheightmean? How is that all put together? It doesn't explain the smaller details. – xil3 – 2013-09-19T18:54:59.147Thanks for posting the gmp-proxy - I'll take a look at that. – xil3 – 2013-09-19T19:05:19.990
Unfortunately, I'm not even that well versed in working with GBT. There's very little detail in any of the documentation, and it's actually quite unusual to have that much detail on an internal topic on the internal wiki. I'd suggest talking to one of the developers on freenode#bitcoin, maybe try and catch Luke-Jr if he is around. If anyone knows how GBT works, it's the person who developed it. – Anonymous – 2013-09-21T05:34:41.880
Yeah, I just joined that channel, but everyone seems to be idle. Hopefully someone sees my plea for help. – xil3 – 2013-09-21T05:54:16.530
>bitcoin-dev would be the correct channel for this.< – Luke-Jr – 2013-12-17T01:32:08.167