Skip to content

Bitcoin #2

Description

@lucasleecr

Link to the codebase

https://github.com/bitcoin/bitcoin/

Which release/version did you read?

0.1.5. (https://github.com/bitcoin/bitcoin/releases/tag/v0.1.5)

Why it is a good project to read?

  • Written by Satoshi Nakamoto!
  • First implementation of blockchain. A lot of cryptocurrencies are forked from it.
  • Concise - only 9k lines of source files and 6k lines of header files.
  • Most of the code is still relevant today.

Starting point

ui.cpp (https://github.com/bitcoin/bitcoin/blob/v0.1.5/ui.cpp). This is where the initialization happens when a bitcoin application starts.

Reading order

  • Bitcoin address
  • Transaction
  • Mining
  • P2P network
  • Blockchain and consensus

Interesting parts

Almost everything. It was an innovation.

Any parts should be skipped?

  • Bitcoin features that were experimental. This includes: using IRC to find peer addresses (in irc.cpp and irc.h), marketplace/product/review (market.cpp and market.h), and sending bitcoins to an IP address. Code related to GUI.

Other tips

  • Just get started. Don't try to read a lot of theories about bitcoin before you start. The code is pretty clear. Only look up an unfamiliar concept when needed (like merkel tree).
  • Don't be afraid to skip code. For example, the algorithm to select the UTXO is very long but can be safely skipped https://github.com/bitcoin/bitcoin/blob/v0.1.5/main.cpp#L2440). Focus on the concept and workflow.
  • Don't try to compile the project because it's a very old release and requires old dependencies too.

Links and resources

Contributor

@lucasleecr

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions