Bitcoin Forum
May 06, 2024, 12:36:10 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Study Bitcoin core source code  (Read 572 times)
Flevio23 (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 6


View Profile
August 30, 2020, 10:52:46 PM
Merited by hugeblack (4), ABCbits (2)
 #1

Hi,

I have read a lot of documentation and books where they explain the general functioning of Bitcoin and I think that the time has come to study the source code of Bitcoin core.

I have knowledge of c++ and python but due to the large size of the project and the number of files, I don't know where it would be correct to start.

Could someone help me on how to properly perform that task?
Bitcoin mining is now a specialized and very risky industry, just like gold mining. Amateur miners are unlikely to make much money, and may even lose money. Bitcoin is much more than just mining, though!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714955770
Hero Member
*
Offline Offline

Posts: 1714955770

View Profile Personal Message (Offline)

Ignore
1714955770
Reply with quote  #2

1714955770
Report to moderator
NotATether
Legendary
*
Offline Offline

Activity: 1596
Merit: 6728


bitcoincleanup.com / bitmixlist.org


View Profile WWW
August 31, 2020, 09:05:07 AM
Merited by hugeblack (2), BrewMaster (2), vapourminer (1), ABCbits (1), Heisenberg_Hunter (1), c_atlas (1)
 #2

You should start by reading the Bitcoin developer documentation, it has a section about examples that show you the outputs different parts of bitcoin core make, along with their input parameters. The Reference, Developer guide and Glossary are also good resources.

You can also study the various BIPs inside the codebase and the associated Github issues and pull requests that implement those BIPs. These BIPs give a high level description of how the protocol works and since Bitcoin core is an implementation of this protocol you get to see how each part of it is implemented in C++.

The bitcoin-dev mailing list also contains a few gems that explain why some parts of bitcoin core code are written the way they are.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Pmalek
Legendary
*
Offline Offline

Activity: 2758
Merit: 7132



View Profile
August 31, 2020, 02:26:57 PM
 #3

You can try reading Mastering Bitcoin by Andreas Antonopoulos if you haven't already. It's a technical piece meant for programmers. 
https://www.oreilly.com/library/view/mastering-bitcoin-2nd/9781491954379/

This is a very basic guide on Bitcoin development that could be useful.
https://blockgeeks.com/guides/bitcoin-developer/

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
hugeblack
Legendary
*
Offline Offline

Activity: 2506
Merit: 3647


Buy/Sell crypto at BestChange


View Profile WWW
August 31, 2020, 06:31:48 PM
 #4

You need to rethink it a bit, Bitcoin is not a program but rather a set of protocols that are cooperated by the community. As long as you follow these rules, you can set up your own Core.
To simplify things, choose the first versions[1] (less than 20K lines,) follow the changes and updates that have occurred and then it will be easier for you.
You can also ask any questions here.

[1] https://github.com/bitcoin/bitcoin/releases/tag/v0.1.5

.BEST..CHANGE.███████████████
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
███████████████
..BUY/ SELL CRYPTO..
Heisenberg_Hunter
Legendary
*
Offline Offline

Activity: 1583
Merit: 1276


Heisenberg Design Services


View Profile WWW
September 01, 2020, 11:02:37 AM
Merited by ABCbits (2), vapourminer (1)
 #5

If you already have a really good overview of how bitcoin works on a practical scale, then you should be skipping the Mastering Bitcoin book suggested by Pmalek. Mastering Bitcoin will take you from the start of what bitcoin is and will end with the most advanced concepts of the complete protocol. The book itself is over 2 years old and might be a little bit outdated with minor changes which has happened in these 2 years.

If you are willing to get into the protocol development or testing or understanding them in a raw level, you should probably practice more source code examples from Programming Bitcoin book by Jimmy Song. The book itself is written for python developers and covers some of the difficult tech which bitcoin has currently. You will be able to interact with the protocol and once you have done that, read a lot of resources from Jameson Lopp's website which ETFbitcoin has said.

Later when you have read a few resources, try finishing off Chaincode Labs curriculum This is really a good syllabus book like material for you to understand protocol and cryptography at a basic level and will help you in getting forward in the code. So if you have done with all the above resources, start with reading example_test.py from functional tests. You should be knowing atleast a little bit of python testing code before you get into the main code. example_test.py is really a good starting point and has been written with keeping newbies in mind.

Participate in a lot of weekly PR review club hosted by John Newbery and other lead devs. You can ask doubts regarding the PR on a technical scale and they will be happy to help. This week, I think we have Taproot review and I hope it will be exciting for you to attend the meeting.
unsigned_long_long
Jr. Member
*
Offline Offline

Activity: 39
Merit: 6


View Profile
September 03, 2020, 12:31:53 AM
Merited by vapourminer (1)
 #6

Hi,

I have read a lot of documentation and books where they explain the general functioning of Bitcoin and I think that the time has come to study the source code of Bitcoin core.

I have knowledge of c++ and python but due to the large size of the project and the number of files, I don't know where it would be correct to start.

Could someone help me on how to properly perform that task?

Speaking as somebody who has tinkered with the C++ codebase a few times, I find a good way to learn it is to first look in the test directory, and run some of the tests individually, try them with different inputs, etc.

All the tests for most of the core protocol stuff are in here - scripts, base58, transaction, etc. So you can relate the core data structures back to all the books you've read on the topic.

It's not the easiest code base to understand, I find it's helpful to use an IDE with a bookmarking facility so you can "map out" the important parts.

Good luck!
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10549



View Profile
September 03, 2020, 03:52:58 AM
Last edit: September 09, 2020, 04:40:40 AM by pooya87
 #7

the problem with looking at bitcoin core source code and trying to "study" that is that it has little to no documentation. there are some comments in some parts that are doing very specific things (such as preventing a very special attack vector) but the basic things (block verification, scripts,...) are never explained and some of them are very difficult to understand.
that means you first have to have a very good understanding of bitcoin protocol before you start looking at the source code. using some of the sources mentioned before (dev. doc.) should be your first step.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Wind_FURY
Legendary
*
Offline Offline

Activity: 2912
Merit: 1825



View Profile
September 03, 2020, 11:56:35 AM
 #8

OP, you can also reach out to some of the other developers. I'm not sure if it's active, but the IRC channel bitcoin-core-dev on freenode might have people there who can help you.

I believe reaching out to achow and gmaxwell in the forum could also help start your journey. There's also Bitcoin Stack Exchange. The resources are everywhere if you know where to look, and as long as you persist. Good luck.

██████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
██████████████████████
.SHUFFLE.COM..███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
█████████████████████
████████████████████
██████████████████████
████████████████████
██████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
██████████████████████
██████████████████████
██████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
.
...Next Generation Crypto Casino...
Flevio23 (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 6


View Profile
September 08, 2020, 07:25:13 PM
 #9

Thank you all for the answers. I think I have been very presumptuous in trying to understand, with my current knowledge, the code. Your advice will be very useful to me to continue moving forward. Studying bitcoin is one of the few things that motivates me, as my current job frustrates and bores me.
Wind_FURY
Legendary
*
Offline Offline

Activity: 2912
Merit: 1825



View Profile
September 11, 2020, 09:28:22 AM
 #10

Thank you all for the answers. I think I have been very presumptuous in trying to understand, with my current knowledge, the code. Your advice will be very useful to me to continue moving forward. Studying bitcoin is one of the few things that motivates me, as my current job frustrates and bores me.


It's not for everyone, but if you're passionate enough, follow what feels right for you. Plus if you want to be a good developer of Bitcoin/cryptocurrencies, I heard that some adequate understanding of applied cryptography is needed. Good luck.

██████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
██████████████████████
.SHUFFLE.COM..███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
█████████████████████
████████████████████
██████████████████████
████████████████████
██████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
██████████████████████
██████████████████████
██████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
.
...Next Generation Crypto Casino...
Wind_FURY
Legendary
*
Offline Offline

Activity: 2912
Merit: 1825



View Profile
October 15, 2020, 07:22:16 AM
 #11

OP, here is another good resource for people like you, who are aspiring to be Bitcoin developers, https://twitch.tv/videos/768401215

achow shows some of his work in real time. I believe you can also show some support through Twitch donations in the chat-box.

██████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
██████████████████████
.SHUFFLE.COM..███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
█████████████████████
████████████████████
██████████████████████
████████████████████
██████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
██████████████████████
██████████████████████
██████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
.
...Next Generation Crypto Casino...
DaCryptoRaccoon
Hero Member
*****
Offline Offline

Activity: 1202
Merit: 580


OGRaccoon


View Profile
October 19, 2020, 05:16:13 PM
 #12

I started a topic on the breakdown of the Satoshi codebase feel free to add to it.

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

┏━━━━━━━━━━━━━━━━━┓
┃   💎 Mine Solo with CKPool 💎    ┃
┃    ➤ Hit Blocks on Your Own!      ┃
┃ ███▓▓  ███▓▓  ███▓▓  ███▓▓┃
Wind_FURY
Legendary
*
Offline Offline

Activity: 2912
Merit: 1825



View Profile
October 24, 2020, 08:55:12 AM
 #13

I started a topic on the breakdown of the Satoshi codebase feel free to add to it.

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


To all actual coders who have actual experience in cryptography. Based on Satoshi's code, would you give thought to some of the doubts that Satoshi wasn't a "cypherpunk" before Bitcoin? Or was he that good in concealing his real identity?

██████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
██████████████████████
.SHUFFLE.COM..███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
█████████████████████
████████████████████
██████████████████████
████████████████████
██████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
██████████████████████
██████████████████████
██████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
.
...Next Generation Crypto Casino...
DaCryptoRaccoon
Hero Member
*****
Offline Offline

Activity: 1202
Merit: 580


OGRaccoon


View Profile
October 26, 2020, 05:20:11 PM
 #14

I started a topic on the breakdown of the Satoshi codebase feel free to add to it.

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


To all actual coders who have actual experience in cryptography. Based on Satoshi's code, would you give thought to some of the doubts that Satoshi wasn't a "cypherpunk" before Bitcoin? Or was he that good in concealing his real identity?

I don't think it matters if he was or was not a cypherpunk he had the right idea and released it at the right time sometimes that is all that matters.  He did leave a few trails about the place but I would say he did a pretty good job keeping his identity a secret.

What I find amazing is the fact that no one has yet been able to uncover the person behind the name and I really hope that it continues to stay that way.

┏━━━━━━━━━━━━━━━━━┓
┃   💎 Mine Solo with CKPool 💎    ┃
┃    ➤ Hit Blocks on Your Own!      ┃
┃ ███▓▓  ███▓▓  ███▓▓  ███▓▓┃
seoincorporation
Legendary
*
Offline Offline

Activity: 3150
Merit: 2930


Top Crypto Casino


View Profile
November 09, 2020, 11:45:08 PM
 #15

A good start would be to put your hands on the code... Install the core and make it run, see what can you do from the command line, create a test net, make transactions, sign them and send them. Learn as much as you can on the fly and then modify parameter on the code.

A nice challenge for a coder like you would be to create a genesis block and start your own bitcoin. I think this is the best way to get familiarized with the code.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
Wind_FURY
Legendary
*
Offline Offline

Activity: 2912
Merit: 1825



View Profile
November 13, 2020, 06:16:10 AM
 #16

I started a topic on the breakdown of the Satoshi codebase feel free to add to it.

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


To all actual coders who have actual experience in cryptography. Based on Satoshi's code, would you give thought to some of the doubts that Satoshi wasn't a "cypherpunk" before Bitcoin? Or was he that good in concealing his real identity?

I don't think it matters if he was or was not a cypherpunk he had the right idea and released it at the right time sometimes that is all that matters.  He did leave a few trails about the place but I would say he did a pretty good job keeping his identity a secret.


That wasn't the question. You as a coder, I was asking based on the code he wrote, can you tell if he was a cypherpunk, or an outsider?

I believe the only person in the cryptography mailing that appreciated Bitcoin was Hal.

Quote

What I find amazing is the fact that no one has yet been able to uncover the person behind the name and I really hope that it continues to stay that way.


He might be hiding in plain sight. Cool

██████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
██████████████████████
.SHUFFLE.COM..███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
█████████████████████
████████████████████
██████████████████████
████████████████████
██████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
██████████████████████
██████████████████████
██████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
.
...Next Generation Crypto Casino...
chrisvl
Legendary
*
Offline Offline

Activity: 1274
Merit: 1006

Trainman


View Profile WWW
November 15, 2020, 01:08:06 PM
 #17

This questions has not a single answer and you should to explore diffrent opinions in order to find the ideal for you.
My opinion is to not read the source code files like a book you will not gain anything, Back in school, when student reads something he thinks that understand it..But, doing is where the real learning takes place, you can create an altcoin based on bitcoin 0.9v its easy you have to change only 2-3 lines of code, and start perfome changes to code then test test test!!

BrewMaster
Legendary
*
Offline Offline

Activity: 2114
Merit: 1292


There is trouble abrewing


View Profile
November 15, 2020, 03:39:33 PM
 #18

But, doing is where the real learning takes place, you can create an altcoin based on bitcoin 0.9v its easy you have to change only 2-3 lines of code, and start perfome changes to code then test test test!!

that would only create a parrot who can edit text files after reading some guide on the internet not someone who understands how bitcoin works.
you have to understand what you change, what those changes affect and why you are changing them.

There is a FOMO brewing...
TofuDefi
Jr. Member
*
Offline Offline

Activity: 156
Merit: 4

Trade and stake Ethereum assets on TRON


View Profile WWW
November 29, 2020, 08:33:00 AM
 #19

Hi,

I have read a lot of documentation and books where they explain the general functioning of Bitcoin and I think that the time has come to study the source code of Bitcoin core.

I have knowledge of c++ and python but due to the large size of the project and the number of files, I don't know where it would be correct to start.

Could someone help me on how to properly perform that task?

Start with src/chainparams.cpp.

TofuDefi.com - trade and stake Ethereum assets on TRON
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!