In the bitcoin/src, which files are the "main" files I should start with if I want to learn how Bitcoin works? In other words, where's it good to branch off from?

I'm new to C++, but can code okay in PHP and Python. I'm learning C++ along the way.


I certainly appreciate your level of enthusiasm to want to dig straight into the code, but if I were you I'd start with the Developer Guide on bitcoin.org, and perhaps also the Developer Reference. A whole lot of effort has gone into this documentation (especially thanks to this guy), and I think you'd be remiss to not to take advantage of it.

After digesting some of that content, you'll have a better idea of what particular aspect of Bitcoin Core interests you the most. As I'm sure you've noticed, it's a rather large codebase, covering consensus issues, blockchain/storage/pruning issues, elliptic curve cryptography, DOS issues, Bitcoin scripting issues, Bloom filters, wallet issues, UI issues, and tons of other things I can't begin to fathom. After getting a good technical overview of Bitcoin and posing a more specific question, I'm sure someone (perhaps not me) can give you a more specific staring point.


I've found Python to be the best Bitcoin learning tool, and many agree, namely because:

  1. You can use the Python console without compiling code, allowing you to easily play with it until it makes sense
  2. Python (especially version 2.7) is dynamically typed (bytes, strings, ints do not need declaring) See Christopher Gurnee's comment below
  3. There's some fantastic libraries for Python, namely Pycoin and pybitcointools
  • 1
    I agree that Python is a great learning tool for Bitcoin, however saying that Python isn't strongly typed is inaccurate. Strong typing refers to the fact that values and objects have a specific type, and require explicit casts/conversions when converting between dissimilar types, e.g. this expression is invalid: "1" + 2, TypeError: cannot concatenate 'str' and 'int' objects. Strong/weak typing isn't related to whether or not variables are explicitly typed; you're probably thinking of static vs. dynamic typing (and Python is dynamically typed). It's also often called "duck" typed. – Christopher Gurnee May 4 '15 at 13:14
  • you're probably thinking of static vs. dynamic typing: You're right mate, I misspoke there! I've edited accordingly, thanks – Wizard Of Ozzie May 4 '15 at 14:08

Even I'm quite new to Bitcoin and I started out with this.

This short explanation gave me good overview.

And Christopher Gurnee is right with starting to study the Developer Guide, the Developer Reference and in addition you could take a look at the Developer Examples.

Regarding your interest in coding, you should take a look at the bitcoin-0.10.X/qa/ directory - here you find (also python) code for quality assurance tests.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.