Author

Topic: Can someone point me to the entry point where mining code lives? (Read 844 times)

sr. member
Activity: 574
Merit: 250
I think at this point the mining code has been ripped out of the current versions.  It may be easier conceptional to go back to a version that was all in one to see the mining all in one source base.
sr. member
Activity: 335
Merit: 250
Anyone looking to understand this in the future, here is the link I was looking for and it should get you started.

https://bitcointalksearch.org/topic/decentralized-mining-protocol-standard-getblocktemplate-asic-ready-108854

sr. member
Activity: 335
Merit: 250
Quote
it seems that the mining programs use JSON RPC

*it seems that the mining programs use JSON RPC to get the last block, then they assemble a set of transaction to build a new block to hash against.  The Nonce is the incrementor to change the hash while searching for a compliant hash result? right? maybe Wink.
sr. member
Activity: 335
Merit: 250
Quote

As far as I know, those articles (links at the bottom to the others) are the best guide to the source that anyone has written up so far.  I'm not sure if they will tell you where to look exactly, but I had hoped that they may at least get you pointed in the right direction.

Awesome thanks, at least I know I'm in the right spot. From the code I've been reading so far it seems that the mining programs use JSON RPC with bitcoind then apply the appropriate hashes and merkle tree structure to it, check to see if it's a viable solution. if it is, they then JSON RPC submit the new block to submitblock. continue processing, the next block while waiting for confirmation.  Does it sound like I'm on the right track?
kjj
legendary
Activity: 1302
Merit: 1026
Endlessa, with 17 posts...
post your credentials, or you are just another alt-developer or 4chan troll trying to hack a coin to make it proffitable.

If you are a proffessor, i think you need to lurk moar... i remember there's some satoshi pdf and threads explaining everything.
Search or just look at the sourcecode!

That's a bit rude, don't you think?  Why do you care why he wants to learn more about the source?

Did you read the sticky at the top of this board?

Yes did I miss something there? I didn't see where mining code was identified.  I read the specifications, but my understanding is the literal implementation of the code is where the facts live.  I'm hoping to map the facts of the code to the protocol specifications.

I looked again I assume you mean the "Satoshi Client Operation: Overview", but I'm still not seeing where it references mining.  Smiley let me know if I tarded out or something, as I'm a bit sleepy today and that is entirely possible Smiley

As far as I know, those articles (links at the bottom to the others) are the best guide to the source that anyone has written up so far.  I'm not sure if they will tell you where to look exactly, but I had hoped that they may at least get you pointed in the right direction.
sr. member
Activity: 335
Merit: 250
I am new without a doubt. I did make the mistake of thinking the forum was here to ask for help.  I guess I went to the wrong place.  Don't worry I will search the code I have the source, was just hoping some kind person would be helpful to people trying educate the community at large.  I thought this "community" project might be supportive of a community question. I was hoping someone might have a link set they'd share so I don't spend ages reproducing something somebody might have to share. . . .ya know like built on the shoulders of giants and all. No worries, I'll just use cpp2dia and keep the whole thing to myself.  thanks for being a dick.
member
Activity: 106
Merit: 10
Endlessa, with 17 posts...
post your credentials, or you are just another alt-developer or 4chan troll trying to hack a coin to make it proffitable.

If you are a proffessor, i think you need to lurk moar... i remember there's some wiki, satoshi pdf and threads explaining everything.

Use the Search first! You will find nice articles. or just look at the sourcecode!
sr. member
Activity: 335
Merit: 250
It did just occur to me that maybe what I'm looking for is actually in the open source mining clients combined with where the bitcoin client validates the proper block chain when a solution collision occurs.  Is this true? Maybe all I need from the bitcoin client is the solution collision/split resolution code? combined with some digging into mining clients? Anybody familiar with this?
sr. member
Activity: 335
Merit: 250
Did you read the sticky at the top of this board?

Yes did I miss something there? I didn't see where mining code was identified.  I read the specifications, but my understanding is the literal implementation of the code is where the facts live.  I'm hoping to map the facts of the code to the protocol specifications.


I looked again I assume you mean the "Satoshi Client Operation: Overview", but I'm still not seeing where it references mining.  Smiley let me know if I tarded out or something, as I'm a bit sleepy today and that is entirely possible Smiley
kjj
legendary
Activity: 1302
Merit: 1026
Did you read the sticky at the top of this board?
sr. member
Activity: 335
Merit: 250
I've been working my way through a lot of information as I setup hardware, learn about finance, dig into the mechanics etc.
I'm a programmer at heart and have been desiring a deeper understanding of the underlying code responsible for mining.
I've lived most my life doing back-end, so I get a bit lost in UI programming Wink any help pointing me to the underlying code would be greatly appreciated.

I've already through the P2P discovery bit, but I'm really more interested in the following code locations:

  • Where does new difficulty get calculated?
  • Where is the code that propagates new difficulty to the mining nodes?
  • Where is the code that deals with nuts and bolts of mining live? (Blockchain processing)

Any help or assistance would be hugely appreciated as I would love to knock the green off my understanding of the overall process Smiley

Also I will be sequence diagramming this code (and probably some other code) and documenting the functions.  I would be happy to share this with the dev community. Is there a preferred place or should I just use the regular bitcoin wiki?

I may also be doing local classes for developers (and some non-developers) and possible some online courses.  I will most likely be putting the curriculum into public domain.

Thanks Smiley



Jump to: