7 min. read

June 27, 2021

blockchain

How to Start Programming in the World of Blockchain

As a developer, you’ve probably wondered about blockchain programming...

Gianmarco Guazzo

Gianmarco Guazzo, Web & Blockchain Developer

The Blockchain and the world of cryptocurrencies that surround it are undoubtedly two of the most discussed and interesting tech topics in recent years. The Blockchain as a technology represents an effective way to improve the lives of many people around the globe and in a number of different ways. As a developer, you’ve probably wondered about the growth of this sector and technology. 

Reports have shown that Blockchain, cryptocurrencies, and the whole web3 field is growing, as are their need for new engineers, computer scientists, and technicians of all kinds. More importantly, this growth doesn’t seem to be slowing down. In fact, more and more companies and investors are moving their capital in technology that could represent the future of currency with Bitcoin but also the future of our digital economy.

With this kind of growth, it’s clear that there’s both opportunity and money in the field. So, if you’re interested in getting started, the question that arises is: where do I start with Blockchain programming? Within this industry, there are many options and many facets of the same coin. There’s Bitcoin and its open-source contribution. There’s Ethereum and its Solidity language. There are many other projects with their respective SDKs and ways to interact. So let's try to get some clarity on all the options so you take your first step into programming in this world.

First of All, Back up

Let's start by first dispelling a myth: many say that it no longer makes sense to ‘build’ a new Blockchain in 2021. They say that this practice could just have purely educational purposes to understand how the technology works under the hood. If anybody plans to come into the industry and create a new Blockchain, ultimately it’s foolish and leads nowhere. The best way to learn about the Blockchain is to work with what already exists and learn from the tools made available to build on top of existing Blockchain.

Of course, before starting to program decentralized applications on the Blockchain, it’s good to have a good base of one of the following languages: Javascript, Python, Java or C#.

Once you understand this, it’s crucial to understand what is meant by Blockchain, Bitcoin, and decentralization. Spend your early days trying to understand the technology’s basic workings and how the industry has developed.

Once you understand the fundamentals, it’s time to jump in. As Cicero said, ‘Historia magistra vitae’, which translated means ‘history is the teacher of life.’ It’s necessary to understand what has been built and why in order to build the applications of tomorrow. And that means you need to jump in and try building a Blockchain from scratch. It’s good to start putting your hands in the dough. So have fun. Jump in, and give it a try.

Start Programming Blockchain and Working with Solidity

As mentioned above, to build decentralized applications (or DApp) you first need to have a good knowledge of web or mobile development languages. Once you’re comfortable, you need to choose the language you want to use for the so-called ‘Smart Contracts’. Smart Contracts are basically software that self-executes when certain inputs are inserted. They also interface with the particular Blockchain you are using.

The most used language for Smart Contracts is called Solidity. Solidity was born as a language compatible with the Ethereum Blockchain and was later adopted by many other protocols almost as a standard. It’s purely an OOP language, very influenced by C++, Python, and JavaScript. For those who already have previous knowledge in one of the three languages, it makes sense to start directly from the documentation, as it is very clear and self-explanatory.

Another programming language for developing Smart Contracts on Ethereum is called Vyper. Vyper is much less used than Solidity but has several interesting features aimed at security and reliability. It’s a language that derives directly from Python (now the name makes sense, huh?). It is strong typing and has a very lightweight compiler for the code. As said before, it deliberately has fewer features than Solidity, which makes contracts more secure and easier to audit. If you’re a Python lover and you want to start programming Smart Contract with Vyper, you can find the original documentation here.

Supporting libraries and tools

Solidity alone, however, is not sufficient. While it allows us to create these Smart Contracts (which are very similar to classes that define objects taking the concept of OOP), it does not allow us to connect directly to the Blockchain and execute them. That's why certain libraries have been created specifically to put your app in communication with the Blockchain. These libraries, specifically, are web3js and ether.js (clearly you can see my bias towards JS as a language). They allow you to send transactions, execute contracts, create tokens, and so on.

However, to connect the application to the real Blockchain, we need two more tools. The first is: access to an Ethereum node, which then allows us to connect to the Blockchain. The second is: Truffle Suite, which is a set of tools that allows us to easily interact with our Smart Contracts.

Next, let’s break down one of those Smart Contracts. Inside, you’ll find:

  • Truffle: a testing framework and a blockchain asset pipeline that uses the Ethereum Virtual Machine (EVM), with the goal of making the developer's life easier.

  • Ganache: a personal and local blockchain for Ethereum development that you can use to deploy contracts, develop your applications and run tests.

  • Drizzle: a collection of front-end libraries that make writing front-end apps easier and more predictable. Drizzle's core is based on a Redux store, so you have access to the spectacular development tools around Redux.

The problem with the ‘blind’ Blockchain

One of the underlying problems with Blockchains is the fact that they are ‘blind’. In fact, any Blockchain can see the data within itself but not that of the world around it. Data such as the price of gold, the weather, or the result of the European Football Championship are not visible ‘objects’ for your Blockchain. For this reason, it’s commonly recommended to use the protocol Chainlink which allows access to data from the outside world. It also has a type of security to make our DApp higher performing and more affordable.

Other Blockchain and tips

As Blockchain is a new programming paradigm, it’s not necessary that you know every last thing about it, but it is essential to have a good base and to test the field. With a few months of preparation and testing, you will be ready to land a job without having invested too much money but only your available time. Here are a few options to get you started.

In addition to the documentation for the most experienced and skilled users, there are several courses on Udemy or YouTube to introduce newbies to Blockchain programming. I personally believe that learning as a self-taught person in this area is the right choice. As this is a new way of making software, it doesn't make sense to buy expensive courses when you can find wonderful guides on the internet. Udemy offers guides at a very low cost and with content that is really good. Undoubtedly one of the most interesting courses in Udemy to learn how to develop with Solidity is called "Ethereum and Solidity: the complete developer guide" by Stephen Grinder.

On top of this, remember that the community is always ready to help and answer questions. You can check out Ethereum Stack Exchange, which is similar to StackOverflow. YouTube of course also offers many explanatory guides and introductory videos to understand the basics.

Lastly, although this guide has been very focused on Ethereum, there are still very interesting alternatives with less extensive but very active developer communities. One example is Solana, which is an alternative Blockchain to Ethereum that makes scalability its strong point. Then there’s Polkadot, another Blockchain that makes interoperability between Blockchains its best part. There are also Cardano and Algorand which can be used to develop applications. However, it’s highly recommended that you start with more established protocols. This will allow you to grow as a blockchain programmer and enter a market with much more demand in terms of established protocols. The longer protocols have been on the market the more the community supports them and incentivizes them to constantly improve. After you’re comfortable, it makes more sense to invest your time in the more futuristic Blockchains.

Conclusion

Getting started with Blockchain programming isn't difficult at all. Entry into this world can be very easy if you already have a background in programming. For beginners as mentioned above, it’s good to start with some basic knowledge on Blockchain and then delve into the many guides, videos, and documents from which to develop a Smart Contract and the underlying logic. Last of all, if you really want to go further with Blockchain, it's good to have a basic knowledge of some programming language for web or mobile so you can ‘dress’ your Smart Contract with a UI that can be used by anyone. Cheers!