Knowing where to start when learning software development can be tricky. Even trickier still is going into relatively new fields of software development, like blockchain. There are very few places in which you can formally learn to do any form of blockchain development. This is partly because the technology and industry standards are still under rapid development. Furthermore, formal education tends to lag behind by a few years. Here, we’ll cover some basic concepts and useful resources so you can become a blockchain developer for Bitcoin.
But before we go over blockchain development, you will need some basic programming experience. All the information you need on that is also right in this article. But feel free to skip those parts if you are more advanced.
Why become a blockchain developer?
There are probably many, many reasons why becoming a blockchain developer interests you. Perhaps you are a radical crypto or cypher-punk who wants to disrupt financial technology and reshape society to fit a new paradigm of fairness, transparency, and economic inclusion.
Maybe you could help bring about this new world by re-aligning the interests of institutions and the people. It would be possible to reallocate resources more appropriately. Then we could usher in a new era of
All of it would be possible thanks to the opportunities inherent with a freer blockchain based economy. Conversely, corruption could sink to an all-time low in response to the transparency provided within the technology.
Type B personality?
Or maybe you are more of a type B personality. In that case, you are far more concerned with something more material, like dollar bills (or Satoshis). We have all heard of the incredible successes of people who bought into cryptocurrency early. Yet we’re also quite familiar with the failures like that poor soul who accidentally lost his Bitcoin fortune by throwing it into the bin. $127 million gone forever.
It could be too late to buy in and make this type of money again in the market. Even Vitalik has had his moments of pessimism saying that we wouldn’t see that kind of ROI again. Most cryptocurrency enthusiasts very much remain optimistic, at least for the long term. This is mainly due to the belief that blockchain
The world of tokenized asets
Most existing wealth in the world today will become tokenized and eventually placed on the blockchain. This includes:
- National currencies
- Virtually all digital assets
As a result, the “crypto markets”, for lack of a better term, will absorb most of the world’s wealth. But let’s assume you are a type B person. Then you are a businessman! Not a gambler! A diligent business person who knows to limit their risk while maximizing upside and opportunity.
Harnessing change while mitigating risks
So how can one benefit from this change without taking massive risks? Or at least having more options available that won’t be subject to the emotional prices swings of an immature, developing market? Something that is harder to take away or lose than crypto riches.
Maybe something less ephemeral than the price of magic internet money. Well, good news! You’re in luck! Skill sets and knowledge have a much stronger staying power than crypto prices. And it turns out that the demand for blockchain developers increased by 400% last year, with the median salary at around $127,000.
I am guessing that you are probably more a type A since you are reading an article about development on Bitcoin specifically. I say that because Bitcoin’s community has a reputation for being more
Why the Bitcoin community members are cypher-punks
This is largely due to the fact that these motivations have historical roots in these communities and that Bitcoin developers are technically volunteering. Although they might have a large investment in the currency itself, so they can still be a stakeholder in its success.
In this article, we are going to focus on the foundational knowledge related to understanding and programming for Bitcoin.
Is Bitcoin development hard?
In short yes, very. This is in part because there are only a handful of technical resources. It also draws on so many areas in computer science like programming, distributed computing, cryptography, network security, etc. The other factor is that a lot of major changes to the code are going to probably be on the cutting edge.
A small bug in a smart contract code, for example, could lead to devastating consequences for companies and individuals. In May 2016, several security issues were shown with a smart contract platform known as “The DAO”, DAO being an acronym for Decentralized Autonomous Organization, which is one of the most promising technologies to be coming out of blockchain.
How the DAO hack occurred
On June 17th, 2016, the DAO was hacked. The smart contract was exploited via a recursive call and other vulnerabilities. Recursive calls are basically just tricking a function in the contract to repeat itself and/or other parts of the contract. The attacker was able to use this to gain access to parts of the contract that he shouldnt have access to. He then called a withdraw function repeatedly.
It would be like going to a bank teller who has a really short memory. Say they were particularly bad at multitasking. Then you could just repeatedly ask them to withdraw cash from your account before they could properly update your balance on the books.
This would allow withdrawing an unlimited amount of money. Unfortunately, this vulnerability was avoidable by the simple act of reversing two lines of code, which can be seen on the Github post-mortem. A seemingly trivial fix could have prevented recursive calling.
The importance of caution
Hopefully, you aren’t too afraid of blockchain development now. Even the most talented developers accidentally write bugs into their code. Mistakes are unavoidable, but it should serve as a reminder that when doing blockchain development, you should be very cautious and security should always be the top priority. The conservative approach may not be fast enough for some, but it is partly the reason why Bitcoin is still the longest-running blockchain. There is a huge advantage to being cautious.
The first thing anyone interested in Bitcoin development or blockchain, in general, should read is the Bitcoin whitepaper. It does contain some math but for the most part, it’s easily digestible. And it helps you understand some of the philosophy and ideas that went into it as well.
The Satoshi Nakamoto Institute is a good resource for the emails, forum posts, and code that Satoshi wrote while he was still active with the project and it’s now translated into several languages! This isn’t to say everything Satoshi wrote was gospel, though. The ideas have undergone a lot of evolution since he left the project, but it’s good to have some context to the different designs decisions of Bitcoin.
Once you have a solid understanding of the high-level concepts of how a blockchain functions, then you are probably ready for the nitty-gritty aspects of it, which is the programming!
First things first, learn to code:
When first learning to write code, it can be very daunting, but it’s obviously a prerequisite before you can even think about blockchain development. But basic programming usually isn’t half as hard as people think and it’s a useful skill that can come in handy in all sorts of occupations and even day to day life.
It’s also nice to have a solid understanding of how the systems that control much of our modern world are actually working. Fortunately, it doesn’t inherently involve a lot of math, mostly it’s just basic logic.
For learning to program you have two options
Option 1 Go To School:
Going to a university or college for a programming related degree works for some people. But anecdotally, most people I know had to do a significant amount of learning and practice on their own after the fact anyways. There seems to be no shortage of stories like this online either.
There is also the question of cost, which depending on your location can be quite expensive. You definitely get better credentials and a more structured and disciplined learning environment, but maybe less bang for your buck. But since the goal is to develop for an open source project, option 2 seems more favorable.
Option 2 Open Learning:
The internet has democratized information. Many professional programmers use the internet on a daily basis for solving issues and learning new things. This is the path we will focus on.
Learn the basics
These languages are also convenient for front end interactions with Dapps anyways. So these are skills that you will likely be able to use as a Bitcoin developer. If you end up coding for any significant length of time, you’ll end up learning multiple languages. But the good news is each language is a lot easier to learn than the last as the main concepts are the same; it’s mostly just learning the new syntax and idiosyncrasies of the specific language.
Focus on goals and participate in fun projects
When learning to program, or do anything really, it is very important to keep things fun and engaging. Most successful developers have obtained their skills at least partially from their own interests and work on passion projects. It doesn’t matter if the program you want to develop already exists. It only matters that you are getting practice.
Figuring out how to develop a project on your own and then later comparing it to other projects is an awesome way to learn as you can see where people have improved upon the work of others. You could even play with development on the Bitcoin
Dive deeper into fundamental programming concepts
After you feel like you have a good grasp of programming and you can write almost anything, you probably need to improve on your theory and program design. Concepts like Object Oriented Programming and Design Patterns will be super important to your success.
Find ways if you can to learn development in settings with other developers or people learning. Bootcamps and meetups are a great way to do this. You will learn a lot from talking with other developers and sharing information.
Sharing your knowledge on places like stack overflow is a fantastic way to help reinforce the things you have learned as well as learn new things. Pay it forward to other up and coming developers and remember that even someone of a lower skill level might know things that you don’t, so there’s lots of opportunity for mutually beneficial learning.
Getting involved in
Fake it until you make it
Imitation is one of the most essential aspects of learning. Almost all forms of learning involve some level of imitation and copying from someone or something we are learning from. And so it follows that since we are aiming to become a Bitcoin developer, we should imitate what the previous developers have done.
To my knowledge, there haven’t been any studies or strong research on this specific occupation. It’s not surprising when you think about how blockchain is such a new field. But lucky for us, we do have some data to pull from since Bitcoin development is opensource. We’re able to scrape useful statistics about what other projects the developers have worked on. We can also find out what kind of skills sets they have. We can then try and use this information to inform us about an efficient path to learning.
One of the most frequent questions in figuring out what it takes to become a developer in any field is, “What language should I learn?”. To answer this question we can look at data pulled from GitHub to give us a good idea.
The best version control platform
If you are not already aware, GitHub is the largest version control platform for opensource development. Version control is super important in managing almost all computer code. This is especially so for large and complicated projects. This is because it allows you to make sure you don’t have conflicts in your code. Additionally, it enables you to do rollbacks to older versions of your code if you had the misfortune of writing an intractable bug, for example.
Forking and branching when you have multiple people working on the same project helps keep the “master” branch (or a copy of the code) clean and intact until you are ready to merge your new updated code.
How ease of use increases Bitcoin resiliency
Using these types of platforms are really great because of the transparency and ease of use. People can quickly find and submit issues found in the code and it really helps projects progress quickly. According to the Harvard Business review, when organizations make it easy for people to voice concerns and problems, it allows them to handle threats better and go after opportunities more effectively. This is the way open source projects work. So platforms like Github, by design, help make Bitcoin so resilient.
After Satoshi Nakamoto left the project, development of Bitcoin-Core moved to Github, where developers continue to work on it today.
Bitcoin-Core is the most common full node and wallet software in use. It also has code in it for mining. So we will focus on this specific client because of its market share dominance, but other clients use similar technology stacks so your skills will probably be transferable.
Technically, Bitcoin is more abstract than computer code. It is a mathematical concept. So you could write code for it in practically any language as long as your client can interface with the network. In fact, you could keep the Bitcoin network operational with papers and pencils if you wanted to; you can even do mining by hand!
But now let’s go back to the data and look at what languages the Bitcoin developers know!
What languages do Bitcoin developers use?
Pulling data from the top 100 contributors to Bitcoin-Core, we can find that the developers have quite a diverse set of skills as collectively they know 59 unique programming languages! But in terms of how much code experience they collectively have with each language, we find that just 10 of them make up about 80% percent of the experience or at least the code they have written publically on Github. And the average contributor has programmed in about 6 languages on Github.
A Pareto distribution
And here we have found a Pareto distribution in the wild! A Pareto distribution gets its name from an Italian economist and engineer who observed that many things in nature follow a power rule or roughly an 80/20. For example, just 20% of words are 80% of the written or spoken language. It also holds true here. Since only this tiny portion makes up the majority of the code, we will focus just on the top 10 languages. The others are rarer and niche languages that used rather infrequently.
Python, my personal favorite and the language for pulling data from the web and generating these graphs, is the #1 language among Bitcoin developers! It makes up about 19% of all the code they write on Github. Although this isn’t that much of a surprise given that it’s the second most popular language on the site. Additionally, its risen significantly in popularity in recent years because of its ease of use, versatility, and use in big data and machine learning applications.
Getting the complete picture
But this isn’t a complete picture as we don’t want to just know what Bitcoin developers happen to use most frequently because they obviously work on other projects outside of Bitcoin and blockchain.
Bitcoin-Cores actual code base is written mostly in C++ and a bit of Python followed by C, M4, Objective-C, and others. So now we might know a bit more precisely what languages we should focus on learning with this goal in mind. But you should note that most coders will tell you specific languages don’t matter too much as its more important to be
Now let’s take a look at user activity of the Github contributors:
The top contributor to Bitcoin Core has added 629,731 lines and removed 538,067 with a total of 1,619 commits! That’s quite a lot of work! But don’t worry about keeping up with the rockstars like that, the #100 contributor has only 7 commits and 73 line additions with 74 subtractions which is much more reasonable. The median level of commits is about 17.
Another good thing to look at is some of the more general Github activity such as the number of repositories a user has. This can be used as a rough indicator of open source coding experience. The maximum is 283, the minimum we pulled from the data is just 2! And the median is 36. So around 20-40 repositories is probably a more than sufficient experience level to start committing code!
Blockchain Core Concepts
Here are some of the most important ideas you might want to learn about when becoming a Bitcoin Dev.
Basically, game theory is the study of “games” or mathematical modeling of agents and decision makers who are rational. Game theory is used in a number of fields from economics and biol
It’s important to have a high-level understanding of how different agents in a system like a decentralized network will likely act as this will be useful in designing the system. Ultimately with Bitcoin, things like the block reward are designed with incentives and behavior in mind, and for molding them in such a way as to benefit the network.
One of the first formalized mathematical examples of game theory was the prisoner’s dilemma. What’s fascinating about the prisoner’s dilemma is that it shows that rational parties may not cooperate even if the individuals involved would have a better outcome if they did cooperate.
Example – the prisoner’s dilemma
This simple game goes as follows: Two men rob a bank but are later caught. Investigators are fairly sure that they have caught the right men but they are relying mostly on circumstantial evidence. Investigators separate the men so they are not able to communicate or share any information.
This is called a simultaneous game because each party has to make a decision without knowing what the other party’s decision is. The prosecutors go to each of the prisoners and offer a deal to them. If they betray their partner in crime and admit and testify against them, they will get a lesser sentence.
- Sentence 1 year
- Both prisoners remain silent
- Sentence 2 years
- Both prisoners betray each other
- Sentence 3 years
- If one betrays but the other stays silent, the silent one gets a 3-year sentence and the betrayer gets freedom
The betrayal strategy
The most rational thing for both prisoners to do at the 2-year is actually betray each other and get at worst a 2-year sentence or at best get freedom. Assuming your accomplice’s choice was totally random, a betrayal strategy would yield you an average of a 1-year sentence for every time you got caught, whereas the “staying silent” strategy would yield you an average of a 2-year sentence and so its best to always betray.
But things are not so simple. In real life, things don’t work out like this because of something called reputation. In reality, there is a chance that you might see this person again or that he might tell other people about your anti-social and disloyal behavior of betrayal, which will be risky for you as it will make it harder to find partners to do things with in the future.
Another variation – the iterated prisoner’s dilemma
We can play this game in a different way known as the iterated prisoner’s dilemma. This version maps a lot closer to reality because there are several rounds played consecutively and so each player has at least some memory of the other players previous moves. This allows the players to change their strategy for the next round of the game.
In computer simulations of the iterated version,
But always being silent and never ratting out your partners is also a bad strategy, as it would make you a doormat to the other player always allowing him to get off scot-free. It turns out that the middle path is best or the tit-for-tat strategy.
Yielding a successful strategy
If in the last round of the game your partner betrayed, then you betray this round, and if he was silent then you should be silent. On average, this yields the most successful strategy. It is believed that this could be the basis for altruistic behavior seen throughout nature.
The brilliant thing about the game theory behind Bitcoin is that the incentives to keep the network running in a fair matter are always higher than the incentives to attack or destroy the network. This can be seen in the fact that it’s cheaper to mine Bitcoins legitimately and strengthen the network rather than trying to take control of it with something like a 51% attack.
But the game theory doesn’t end there. In blockchain, there are many examples of the game theory being used in various ways such as with incentivization of miners, incentivization of validating/staking nodes on proof of work blockchain, reputation systems, smart contract prediction markets, oracles, and many more.
Cryptography or cryptology is a set of mathematical and statistical techniques used to secure information and keep it obscured so that even if a third party, known as an “adversary”, were to intercept the encrypted data, they wouldn’t be able to gain any useful information from it.
In simple terms encryption starts with some piece of data you want to encrypt, which can be anything like the string, “Hello World”. This is usually called plaintext. Next, you encrypt it using your key and encryption function and then your output could be something like “Ifmmp Xpsme”.
Example – Ceasar Cipher
This particular example is one of the first forms of encryption known as the Ceasar Cipher. It was used by Julius Caesar for his private messages. All it does is simply move the index of each letter over one. So A -> B and at the end of the alphabet, you just go back to A. So Z -> A. Although your key could be an index of 2 or any number up to 25.
Another early cipher was the Vigenere cipher; like the Ceasar Cipher it utilizes substitutions. It uses the same basic idea but instead of just shifting each character over by some index N, you have a key which has several sequential ciphers.
So if your key is BTC then that means your first character should be shifted by the index of “B” or 1, then “T” which is 19, and finally for the third letter “C” your shift is 4. Once you get to the end of your key, you simply start back at the first letter “B” and then repeat until you’ve encrypted everything in your message. So “Satoshi” + “BTC” = “
One drawback to Ceasar cipher
The problem with the Ceasar cipher is probably obvious since it wouldn’t take long for an adversary to quickly decrypt the message even with a pen and paper. On a normal laptop, it would take milliseconds.
The Vigenere cipher is a bit more interesting. It can actually be secure as long as the length of the plaintext you are trying to encrypt does not exceed the length of the key you are using. Also, the key must be a completely random string of text. If you can only use the key once, this type of single-use encryption becomes a “one-time pad”.
The security of the Vigenere cipher comes from the fact that the probability of guessing correctly a single character of a randomly generated key would be 1/26. But for each
How Bitcoin keys are handled
But of course, this is just using the alphabet in a single case. Bitcoin private keys are hexadecimal (16 character base) and with a length of 64 characters. So the probability of correctly guessing a Bitcoin private key via random chance is 16^64. Using the most powerful supercomputers in the world running 24/7, it would take several times longer than the age of the universe to correctly guess a single key that had bitcoins in it. This is also known as a collision.
In this graph, we can see how odds of guessing a key decrease exponentially with the number of characters you have in it. After just two characters the probability is only 0.4%, and by the full 64 characters the probability of a correct guess is 0.0 followed by 74 more zeros. Its such a small number that the graph can’t even do it justice!
To oversimplify things, this is the basis of encryption and why it’s so useful in securing data.
Understanding how cryptography works is obviously necessary if you are planning on becoming a Bitcoin or cryptocurrency developer, after all, it’s called CRYPTO-currency for a reason. You may not need to master it depending on the focus of your development, but it’s good to have a solid foundation.
Becoming knowledgeable in decentralized systems and systems theory will be helpful in understanding how the network actually operates. After all, decentralization is at the core of what makes blockchains preferable over other systems.
A centralized system usually has a single or a few controllers which dictate the actions or functioning of the system in a top-down manner. You can think of this as a traditional hierarchical structure of command where components usually have to get instructions on how to act from some managing component, often referred to as a “node”. They rely on higher ranking nodes for information about how to behave.
How decentralized systems relate to distributed systems
Distributed systems tend to have the different components spread out geographically from each other. Decentralized systems are a subset of a distributed system, the key difference being mostly the level of coupling. In a distributed system, if a node goes down it may halt the rest of the system and lead to downtime of the entire thing. In a more decentralized system, the components are also spread out but the downtime or malfunctioning of one node doesn’t affect the rest of the system.
How decentralized systems are different
A decentralized system differs in that the nodes do not need to rely on orders from a central management system. They can often rely simply on local information and interactions to make decisions about appropriate actions to take, even when the nodes may be acting in an entirely self-interested way. It may sound like such a system would be extremely chaotic or hard to control, but as it turns out there is an interesting phenomenon called emergent order whereby these local interactions are able to achieve the goals of the system as a whole.
Self-organization and emergence of order are found all throughout nature. A simple example is snowflakes. They form when water droplets collate into a particulate in the air, which then kick-starts a process in which it gathers and freezes more water vapor, further building out the arms of the snowflake. Even though this is a chaotic and stochastic process, it still produces organization and order.
A good example of self-organization
There are also numerous examples of self-organization or spontaneous order throughout biology. One that’s more directly related to decentralized systems is insect colonies like ants and bees. The individuals in these colonies follow very simple rules but as a whole, the colony behavior can be complex. These colonies may have queens but they don’t normally manage or dictate what the colony does from the top-down.
The individuals rely on signals from touch or smell to gain information. They may then use some of this information to decide to switch jobs within the colony if there is a lack of ants doing a certain type of task. Through these interactions, these colonies can do things like guard the colony from invaders and raise the young without the need of direct management from higher up.
This bottom-up approach to systems will generally create more resilient and adaptable systems and represents the main advantage. But of course it’s not a simple topic and there are drawbacks like efficiency in decentralized systems.
And sometimes the natural feedback loops that are often used to regulate and control the system can have deleterious effects like an ant mill where the ants lose track of the other ants in their party and aren’t getting proper signals about which direction to go in. So they end up following each other in a circle until they die of exhaustion.
Popular decentralized networks
Back to the technological aspects of things. Aside from blockchain, there are several other types of decentralized networks that have gained some popularity. Mesh networks like FireChat have been used during protests in Hong Kong.
The advantage of using these was that protesters could send messages to each other without the need
The IPFS decentralized network
The InterPlanetary File System (IPFS) is another example of a modern decentralized network. The design’s intent is to replace traditional HTTP. One advantage of using the IPFS is that it allows DApps to host their frontend code in a more decentralized and trustless manner. This is because almost all smart contracts and DApps end up using normal websites to interact with them. And this presents a security issue that almost defeats the purpose of using a DApp in the first place.
What do blockchain developer experts recommend?
Sometimes it’s just best to ask to ask the experts what the best course of actions is. So I took the liberty of doing that and asked the most prolific Bitcoin-Core contributor and Core team member to date user
Q: What is the most important aspect in becoming a Bitcoin developer?
A: I think, apart from knowing the subject matter well, being able to work (and focus) under hostile circumstances. There’s so much noise from anti-bitcoin people, either from competing projects or clueless people that parrot bank’s propaganda. It’s easy to either lose your shit or completely seal yourself up in an echo chamber—neither is very productive! –
Q: If you had to recommend only one book to someone wanting to become a developer, what would it be?
A: To be honest I’m not really that familiar with bitcoin books. I learned what I know from online resources, reading
A quick final summary
Following in the footsteps of the original Bitcoin developers may not be a bad idea. But only if you are truly passionate about it. We don’t know about Satoshi
The late and great Hal Finney graduated with a BS in engineering from California Institute of Technology. In his early career, he worked on video games. But he later shifted towards security when he joined PGP corporation. Finney also involved in himself cryptographic mailing lists throughout the ’90s. There, he made some notable contributions to the technology that would eventually lead to Bitcoin.
Mr. Szabo also obtained a degree in computer science. He was also involved in creating a program called “Bit gold” which Bitcoin would end up borrowing a lot from. He also coined the term “smart contracts”
Dai, like Szabo and Finney, also had his own contributions to early blockchain technology. He has a bachelors degree in computer science and a minor in math.
Some specific topics to become familiar with:
- Programming: C++ and Python to start
- Game Theory
Once you are comfortable with these check out the Jameson Lopp Bitcoin Resource page! It’s filled with tons of great bitcoin-related resources including things like coding and cryptography.
We hope this post on blockchain programming for bitcoin was helpful to you. Be sure to share it on your favorite social media and join us to find out more about blockchain technology.