Bitcoin Forum
November 08, 2024, 05:22:35 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Finding Bitcoin Code  (Read 177 times)
vic.cebedo (OP)
Newbie
*
Offline Offline

Activity: 9
Merit: 1


View Profile
June 21, 2019, 01:58:58 AM
 #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!
bones261
Legendary
*
Offline Offline

Activity: 1806
Merit: 1828



View Profile
June 21, 2019, 02:22:23 AM
 #2

Here you go.  https://github.com/bitcoin/bitcoin
vic.cebedo (OP)
Newbie
*
Offline Offline

Activity: 9
Merit: 1


View Profile
June 21, 2019, 03:12:11 AM
 #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?
Pmalek
Legendary
*
Offline Offline

Activity: 2940
Merit: 7547


Playgram - The Telegram Casino


View Profile
June 21, 2019, 09: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

▄▄███████▄▄███████
▄███████████████▄▄▄▄▄
▄████████████████████▀░
▄█████████████████████▄░
▄█████████▀▀████████████▄
██████████████▀▀█████████
████████████████████████
██████████████▄▄█████████
▀█████████▄▄████████████▀
▀█████████████████████▀░
▀████████████████████▄░
▀███████████████▀▀▀▀▀
▀▀███████▀▀███████

▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
 
Playgram.io
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

▄▄▄░░
▀▄







▄▀
▀▀▀░░
▄▄▄███████▄▄▄
▄▄███████████████▄▄
▄███████████████████▄
▄██████████████▀▀█████▄
▄██████████▀▀█████▐████▄
██████▀▀████▄▄▀▀█████████
████▄▄███▄██▀█████▐██████
█████████▀██████████████
▀███████▌▐██████▐██████▀
▀███████▄▄███▄████████▀
▀███████████████████▀
▀▀███████████████▀▀
▀▀▀███████▀▀▀
██████▄▄███████▄▄████████
███▄███████████████▄░░▀█▀
███████████░█████████░░
░█████▀██▄▄░▄▄██▀█████░
█████▄░▄███▄███▄░▄█████
███████████████████████
███████████████████████
██░▄▄▄░██░▄▄▄░██░▄▄▄░██
██░░░░██░░░░██░░░░████
██░░░░██░░░░██░░░░████
██▄▄▄▄▄██▄▄▄▄▄██▄▄▄▄▄████
███████████████████████
███████████████████████
 
PLAY NOW

on Telegram
[/
Heisenberg_Hunter
Legendary
*
Offline Offline

Activity: 1584
Merit: 1280


Heisenberg Design Services


View Profile WWW
June 21, 2019, 10:53:17 AM
Merited by Foxpup (5), bones261 (2)
 #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;
}
DaCryptoRaccoon
Hero Member
*****
Offline Offline

Activity: 1241
Merit: 623


OGRaccoon


View Profile
June 23, 2019, 07:54:58 PM
 #6

I have started to create a Satoshi Codebase topic ( Needs update )

https://bitcointalk.org/index.php?topic=5077159.msg48300342#msg48300342

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

┏━━━━━━━━━━━━━━━━━┓
┃     𝔱𝔥𝔬𝔲 𝔰𝔥𝔞𝔩𝔱 𝔴𝔬𝔯ⱪ 𝔣𝔬𝔯 𝔶𝔬𝔲𝔯 𝔟𝔞𝔤𝔰       ┃
┃                ➤21/M                      ┃
┃ ███▓▓  ███▓▓  ███▓▓  ███▓▓┃
vic.cebedo (OP)
Newbie
*
Offline Offline

Activity: 9
Merit: 1


View Profile
June 24, 2019, 01:39:08 AM
 #7

Thank you very much for your replies guys, all of you, especially @Heisenberg_Hunter !
Grateful to have enough feedback to point me somewhere.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!