Author

Topic: Finding Bitcoin Code (Read 180 times)

newbie
Activity: 9
Merit: 1
June 23, 2019, 08:39:08 PM
#7
Thank you very much for your replies guys, all of you, especially @Heisenberg_Hunter !
Grateful to have enough feedback to point me somewhere.
hero member
Activity: 1220
Merit: 612
OGRaccoon
June 23, 2019, 02:54:58 PM
#6
I have started to create a Satoshi Codebase topic ( Needs update )

https://bitcointalksearch.org/topic/m.48300342

But I started to cover most of the features from the older code base most of which are still in the main release of bitcoin but it will help to give a better understanding of how the Bitcoin protocol works under the hood.

It covers things like block reward.  Mining. OP-CODES, + much more.

It is also open to contributuon by the community so feel free to make a post but please follow the guide at the top if posting about the codebase.

Magic
legendary
Activity: 1584
Merit: 1280
Heisenberg Design Services
June 21, 2019, 05:53:17 AM
#5
It would be pretty much difficult for you to read the code if you don't have any knowledge on cryptography and how data structures work. Though cryptography is the one which secures the blockchain you need to understand the concepts of data structures and must have a deep understanding of either one of the popular programming languages like JAVA, Python or C++.

Right now, I'm actually reading the original white paper and it seems too technical for me, as I am not too exposed into cryptography.

The whitepaper written by satoshi would be much more technical for normal readers who has just read the cryptography as a university subject. You could start with Mastering Bitcoin by Andreas where he delves into the code base more slowly and explains cryptography in a more newbie friendly manner. Once you have finished Mastering Bitcoin, read through the Developer Documentation in bitcoin.org website which might be more understandable after that. I assume, if you right away start with Developer Documentation it would be difficult for you to understand the code.

If you have read the Developer Documentation, it is more than enough for you to easily understand the code and help the developers with testing and code review. The bitcoin code base has changed a lot and is more complex than it was during the initial days. You need to compile the code and run through them to have a better understanding on how the flow works in real time.

how BTC creates Bitcoins in code-level.

Here is the code which generates new coins and they are present in the validation.cpp

Code:
CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams)
{
    int halvings = nHeight / consensusParams.nSubsidyHalvingInterval;
    // Force block reward to zero when right shift is undefined.
    if (halvings >= 64)
        return 0;

    CAmount nSubsidy = 50 * COIN;
    // Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
    nSubsidy >>= halvings;
    return nSubsidy;
}
legendary
Activity: 2730
Merit: 7065
June 21, 2019, 04:08:05 AM
#4
You can also study the Developer Documentation.
https://bitcoin.org/en/developer-documentation

That and a few other interesting resources can be found in this source:
https://bitcoin.stackexchange.com/questions/46067/is-there-developer-documentation-for-the-bitcoin-core-source-code
newbie
Activity: 9
Merit: 1
June 20, 2019, 10:12:11 PM
#3

Thank you!
Right now, I'm actually reading the original white paper and it seems too technical for me, as I am not too exposed into cryptography.
Do you have a more simplified version of the paper?
Or a paper that is more understandable to someone who does not have a deep cryptography background?
legendary
Activity: 1806
Merit: 1828
June 20, 2019, 09:22:23 PM
#2
newbie
Activity: 9
Merit: 1
June 20, 2019, 08:58:58 PM
#1
Hi all,

I am a coder.
I've been holding BTC since 2016, and now I want to dig a little deeper and understand how BTC creates Bitcoins in code-level.
I'd be glad if you guys could point me to the right direction.

May I know where the code is located?
If someone could point me to the right functions, modules, classes, etc, that would be great.
For me who has zero know-how on the code, where should I start exploring?
Thank you!
Jump to: