Share and get +16 +16

So, you want to become an Ethereum developer? This guide is going to help you come closer to that goal.

The idea of this guide is to teach you the basics of Ethereum. In this guide you will learn:

What is Ethereum?

How does Ethereum mining work?

What are Smart Contracts?

What is the Ethereum Virtual Machine?

What are Ether and Gas?

What is solidity?

Dapps and ICOs.

How does Ethereum wallet work?

By the end of this guide, you should be well acquainted with Ethereum enough to gain the foundation required to become a developer.

NOTE: Much of your success as a developer will be dependent on your own initiative and the amount of work that you personally put in. You need to constantly educate yourself with the latest updates.

Ethereum Developer: How To Become One, Guide

This is how Ethereum’s website defines itself:

“Ethereum is a decentralized platform that runs smart contracts: applications that run exactly as programmed without any possibility of downtime, censorship, fraud or third party interference. These apps run on a custom built blockchain, an enormously powerful shared global infrastructure that can move value around and represent the ownership of property.”

But in simpler terms, Ethereum is planning to be the ultimate software platform of the future. If the future is decentralized and dAPPs become common place, then Ethereum has to be the front and center of it.

While Bitcoin is the first application of the blockchain technology, it is still only a currency. Ethereum brings with it the whole scope of what could be possible in a blockchain technology.

As Ethereum co-founder Dr. Gavin Wood puts it:

“Bitcoin is first and foremost a currency; this is one particular application of a blockchain. However, it is far from the only application. To take a past example of a similar situation, e-mail is one particular use of the internet, and for sure helped popularise it, but there are many others.”

How Does Ethereum Mining Work?

As of right now, Ethereum is using the same Proof-of-Work protocol that Bitcoin is using. However, Ethereum soon plans to to move over to Proof-of-stake and they are going to use the Casper protocol to make this transition.

So what is the difference between proof of stake and proof of work?

Proof of work: This is the protocol that most cryptocurrencies like Ethereum and Bitcoin have been following so far. This means that miners “mine” cryptocurrencies by solving crypto-puzzles using dedicated hardware.

Proof of stake: This protocol will make the entire mining process virtual. In this system we have validators instead of miners. The way it works is that as a validator, you will firstly have to lock up some of your ether as stake. After doing that you will then start validating blocks which basically means that if you see any blocks that you think can be appended to the blockchain, you can validate it by placing a bet on it. When and if, the block gets appended, you will get a reward proportional to the stake you have invested. If, however, you bet on the wrong or the malicious block, the stake that you have invested will be taken away from you.

To implement “proof of stake” Ethereum is going to use the Casper consensus algorithm. In the beginning it is going to be a hybrid style system where majority of the transactions will still be done proof of work style while every 100th transaction is going to be proof of stake. What this will do is that it will provide a real world test for proof of stake on Ethereum’s platform. But what does that mean for Ethereum and what are the advantages of this protocol? Let’s take a look.

Advantages of proof of stake

Lowers the overall energy and monetary cost: The world’s bitcoin miners spend around $50,000 per hour on electricity. That’s $1.2 million per day, $36 million per month and ~$450 million per year! Just put your head around those numbers and the amount of power being wasted. By using “Proof-of-stake” you are the making the whole process completely virtual and cutting off all these costs.

No ASIC advantage: Since the whole process will be virtual, it wouldn’t depend on who has the better equipment or ASICs (application-specific integrated circuit).

Makes 51% attack harder: 51% attack happens when a group of miners gain more than 50% of the world’s hashing power. Using proof of stake negates this attack.

Malicious-free validators: Any validator who has their funds locked up in the blockchain would make sure that they are not adding any wrong or malicious blocks to the chain, because that would mean their entire stake invested would be taken away from them.

Block creation: Makes the creation of newer blocks and the entire process faster.

Scalability: Makes the blockchain scalable by introducing the concept of “sharding” (More on this later.)

Even though there have been various simplistic implementations of Proof of Stake before, what separates Casper from the rest is that it incentivizes the honest miners and punishes the dishonest ones. If you have put your stake on a malicious block, then the stake will be taken away from you. It will punish anyone who doesn’t play by the rules.

This is how Vitalik explains it:

“Imagine 100 people sitting around a circular table. One person has a bundle of papers, each with a different transaction history. The first participant picks up a pen and signs one, then passes it onto the next person, who makes a similar choice. Each participant only gets $1 if they sign the transaction history that most of the participants sign in the end. If you sign one page and later sign a different page, your house burns down,”

He then added that this is probably a good incentive to sign the right piece of paper!

What are Smart Contracts?

Smart contracts are automated contracts. They are self-executing with specific instructions written on its code which get executed when certain conditions are made.

You can learn more about smart contracts in our in-depth guide here.

Smart contracts are how things get done in the Ethereum ecosystem. When someone wants to get a particular task done in Ethereum they initiate a smart contract with one or more people.

Smart contracts are a series of instructions, written using the programming language “solidity”, which works on the basis of the IFTTT logic aka the IF-THIS-THEN-THAT logic. Basically, if the first set of instructions are done then execute the next function and after that the next and keep on repeating until you reach the end of the contract.

The best way to understand that is by imagining a vending machine. Each and every step that you take acts like a trigger for the next step to execute itself. It is kinda like the domino effect. So, let’s examine the steps that you will take while interacting with the vending machine:

Step 1: You give the vending machine some money.

Step 2: You punch in the button corresponding to the item that you want.

Step 3: The item comes out and you collect it.

Now look at all those steps and think about it. Will any of the steps work if the previous one wasn’t executed? Each and every one of those steps is directly related to the previous step. There is one more factor to think about, and it is an integral part of smart contracts. You see, in your entire interaction with the vending machine, you (the requestor) were solely working with the machine (the provider). There were absolutely no third parties involved.

So, now how would this transaction have looked like if it happened in the Ethereum network?

Suppose you just bought something from a vending machine in the Ethereum network, how will the steps look like then?

Step 1: You give the vending machine some money and this gets recorded by all the nodes in the Ethereum network and the transaction gets updated in the ledger.

Step 2: You punch in the button corresponding to the item that you want and record of that gets updated in the Ethereum network and ledger.

Step 3: The item comes out and you collect it and this gets recorded by all the nodes and the ledger.

Every transaction that you do through the smart contracts will get recorded and updated by the network. What this does is that it keeps everyone involved with the contract accountable for their actions. It takes away human malice by making every action taken visible to the entire network

What is the Ethereum Virtual Machine?

Before we understand what the Ethereum Virtual Machine (EVM) is, we must understand why a “Virtual Machine” is needed.

So let’s go back to smart contracts.

What are the desirable properties that we want in our smart contract?

Anything that runs on a blockchain needs to be immutable and must have the ability to run through multiple nodes without compromising on its integrity. As a result of which, smart contract functionality needs to be three things:

Deterministic.

Terminable.

Isolated.

Feature #1: Deterministic

A program is deterministic if it gives the same output to a given input every single time. Eg. If 3+1 = 4 then 3+1 will ALWAYS be 4 (assuming the same base). So when a program gives the same output to the same set of inputs in different computers, the program is called deterministic.

There are various moments when a program can act in an un-deterministic manner:

Calling un-deterministic system functions: When a programmer calls an un-deterministic function in their program.

Un-deterministic data resources: If a program acquires data during runtime and that data source is un-deterministic then the program become un-deterministic. Eg. Suppose a program that acquires the top 10 google searches of a particular query. The list may keep changing.

Dynamic Calls: When a program calls a second program it is called dynamic calling. Since the call target is determined only during execution, it is un-deterministic in nature.

Feature #2: Terminable

In mathematical logic we have an error called “halting problem”. Basically, it states that there is an inability to know whether or not a given program can execute its function in a time limit. In 1936, Alan Turing deduced, using Cantor’s Diagonal Problem, that there is no way to know whether a given program can finish in a time limit or not.

This is obviously a problem with smart contracts because, contracts by definition, must be capable of termination in a given time limit. There are some measures taken to ensure that there is a way to externally “kill” the contract and to not enter into an endless loop which will drain resources:

Turing Incompleteness: A Turing Incomplete blockchain will have limited functionality and not be capable of making jumps and/or loops. Hence they can’t enter an endless loop.

Step and Fee Meter: A program can simply keep track of the number “steps” it has taken, i.e. the number of instructions it has executed, and then terminate once a particular step count has been executed.Another method is the Fee meter. Here the contracts are executed with a pre-paid fee. Every instruction execution requires a particular amount of fee. If the fee spent exceeds the pre-paid fee then the contract is terminated.

Timer: Here a pre-determined timer is kept. If the contract execution exceeds the time-limit then it is externally aborted.

Feature #3: Isolated

In a blockchain, anyone and everyone can upload a smart contract. However, because of this the contracts may, knowingly and unknowingly contain virus and bugs.

If the contract is not isolated, this may hamper the whole system. Hence, it is critical for a contract to be kept isolated in a sandbox to save the entire ecosystem from any negative effects.

Now that we have seen these features, it is important to know how they are executed. Usually the smart contracts are run using one of the two systems:

Virtual Machines: Ethereum uses this.

Docker: Fabric uses this.

Let’s to compare these two and determine which makes for a better ecosystem. For simplicity’s sake we are going to compare Ethereum (Virtual Machine) to Fabric (Docker).

So, as can be seen, Virtual Machines provide better Deterministic, terminable and isolated environment for the Smart contracts. However, dockers have one distinct advantage. They provide coding language flexibility while in a Virtual Machine (VM) like Ethereum, one needs to learn a whole new language (solidity) to create smart contracts.

The EVM is the vitual machine in which all the smart contracts function in Ethereum. It is a simple yet powerful Turing Complete 256-bit virtual machine. Turing Complete means that given the resources and memory, any program executed in the EVM can solve any problem.

In order to code smart contracts in the EVM, one needs to learn the programming language Solidity.

What is Solidity?

For anyone who wants to learn how to create smart contracts, Solidity is an absolute must. We already have a detailed guide on it which you can read here. However, here we are going to give you a basic overview. Solidity was developed by Gavin Wood, Christian Reitwiessner, Alex Beregszaszi, Yoichi Hirai and several former Ethereum core contributors to enable writing smart contracts on blockchain platforms such as Ethereum.

Solidity is a purposefully slimmed down, loosely-typed language with a syntax very similar to ECMAScript (Javascript). There are some key points to remember from the Ethereum Design Rationale document, namely that we are working within a stack-and-memory model with a 32-byte instruction word size, the EVM (Ethereum Virtual Machine) gives us access to the program “stack” which is like a register space where we can also stick memory addresses to make the Program Counter loop/jump (for sequential program control), an expandable temporary “memory” and a more permanent “storage” which is actually written into the permanent blockchain, and most importantly, the EVM requires total determinism within the smart contracts.

NOTE: Ethereum is planning to eventually move on from Solidity to Viper.

So, before we continue, let’s checkout a basic Solidity contract example. (Codes taken from github).

Let’s run a simple while loop in solidity:

contract BasicIterator { address creator; // reserve one "address"-type spot uint8[10] integers; // reserve a chunk of storage for 10 8-bit unsigned integers in an array function BasicIterator() { creator = msg.sender; uint8 x = 0; //Section 1: Assigning values while(x < integers.length) { integers[x] = x; x++; } } function getSum() constant returns (uint) { uint8 sum = 0; uint8 x = 0; //Section 2: Adding the integers in an array. while(x < integers.length) { sum = sum + integers[x]; x++; } return sum; } // Section 3: Killing the contract function kill() { if (msg.sender == creator) { suicide(creator); } } }

So, let’s analyse the code. For ease of understanding we have have divided the code into 3 sections.

Section 1: Assigning Values

In the first step we are filling up an array called “integers” which takes in 10 8-bit unsigned integers. The way we are doing it is via a while loop. Let’s look at what is happening inside the while loop.

while(x < integers.length) { integers[x] = x; x++; }

Remember, we have already assigned a value of “0” to the integer x. The while loop goes from 0 to integers.length. Integers.length is a function which returns the max capacity of the array. So, if we decided that an array will have 10 integers, arrayname.length will return a value of 10. In the loop above, the value of x goes from 0 – 9 (<10) and assigns the value of itself to the integers array as well. So, at the end of the loop, integers will have the following value:

0,1,2,3,4,5,6,7,8,9.

Section 2: Adding the array content

Inside the getSum() function we are going to add up the contents of the array itself. The way are going to do it is by repeating the same while loop as above and using the variable “sum” to add the contents of the array.

Section 3: Killing the contract

This function kills the contract and sends the remaining funds in the contract back to the contract creator.

When asked about what was the inspiration and motivation behind creating solidity, Dr. Gavin Woods said this:

“It [Solidity] was meant to be a sophisticated tool for developing contracts that could ultimately give both developers and users good information on what the code did. To help this along, I devised NatSpec, a contract-friendly documentation format, and made that a first-class citizen in Solidity. I also proposed a formal proofing language subset (not yet implemented) in order to maximise the kinds of correctness guarantees that could be made. I introduced events as a first class citizen into the Solidity language in order to provide a nice abstraction for LOGs similar in form to function calls. Inspiration for that came from the Qt meta-object system’s “signals”.

One later feature that Christian R. and I figured out together was function modifiers; that allows attributes placed as part of a function signature to make some modifications to the apparent function body. Being a very declarative means of expression, it’s an idiom that falls nicely into the contract-oriented programming space.”

If you are interested in learning solidity then you can enroll for our solidity course here.

What are Ether and Gas?

Ether is the main token in the ecosystem. It is what incentivizes the players to carry out their end of the smart contract.

Gas is the amount of fuel that is required to fulfill all the needs of a given contract.

When someone submits a smart contract, it has a pre-determined gas value. When the contract is executed each and every step of the contract requires a certain amount of gas to execute.

This can lead to two scenarios:

The gas required is more than the limit set. If that’s the case then the state of contract is reverted back to its original state and all the gas is used up.

The gas required is less than the limit set. If that’s the case, then the contract is completed and the left over gas is given over to the contract setter.

The following is a graph that shows the average gas price in Wei.

Image Credit: Etherscan

Gas is the lifeblood of Ethereum.

All the transactions in Ethereum are validated by the miners. Basically they have to manually put each and every transaction into the blocks that they have mined for the transaction to be validated. In exchange of their services they collect a certain amount of transaction fees.

Usually smart contracts with high gas fees are given preference because the miners have the chance to collect higher fees there. The fee collected though is still pretty nominal as compared to bitcoin.

This graph here compares the transaction fess of Bitcoin to Ethereum.

Image Credit: Bitinfocharts

In fact, as you can see, in this transaction of 0.01 Ether only 0.00000000000002 Ether was collected as transaction fees which is <$0.000001.

Image Credit: Etherscan

So, as you can see, the miners in Ethereum, writing, collect a very nominal transaction fees. Obviously collect transaction fees is a secondary role for there miners, there main job is to…well…mine!

Creating Dapps and ICOs

One of the most exciting features of Ethereum is obviously the platform it presents for its users to create their own dAPPs.

Anyone, anywhere can create their own dAPP and gain fundings for it via an ICO (Intial Coin Offering) just by presenting a whitepaper!

This is one of the most exciting and dangerous features of Ethereum. In fact, chances are that you have already seen some of the crazy amounts of money that these ICOs have made recently.

Ethereum has seen widespread adoption because of the backing by certain corporate heavyweights and the popularity of its ICOs. As a result of this, the number of nodes on the Ethereum network has increased exponentially. In fact, it is the cryptocurrency with the most nodes and hence most decentralized.

In fact, as of May 2017, Ethereum had 25,000 nodes as compared to Bitcoin’s 7000!! That’s more than 3 times. In fact, the number of nodes from April to May increase by 81%…that’s nearly double!

Image Courtesy: Trust Nodes.

There are some interesting ICOs that deserve a proper examination:

Augur.

Bancor.

Golem.

WeiFund.

I Want to Develop A Dapp

There are many ways you can plug into the Ethereum network, one of the easiest ways is to use its native Mist browser. Mist provides a user-friendly interface & digital wallet for users to trade & store Ether as well as write, manage, deploy and use smart contracts. Like web browsers give access and help people navigate the internet, Mist provides a portal into the world of decentralized blockchain applications.

There is also the MetaMask browser extension, which turns Google Chrome into an Ethereum browser. MetaMask allows anyone to easily run or develop decentralized applications from their browser. Although initially built as a Chrome plugin, MetaMask will eventually support Firefox and a range of other web platforms.

While it’s still early days, Mist, MetaMask and a variety of other browsers look set to make blockchain-based applications accessible to more people than ever before. Even people without a technical background can now potentially build blockchain apps. This is a revolutionary leap for blockchain technology that could bring decentralized applications into the mainstream.

If you are interested, then you can learn how to create your first Dapp using our in-depth guide here.

Using Ethereum Wallets

If you want to become a Bitcoin developer, then you definitely need to to know how ethereum wallets work.

Without a doubt, the safest way to store any cryptocurrency is using a paper wallet. By following a few pointers below, you can set one up entirely for free. This truly makes you the master of your investment, and if precautions are followed, there’s no possibility of your private keys being known by anyone else.

Of course, this means that keeping a record of them is even more important. Losing private keys means you’ll forfeit the entire contents of your paper wallet (but then again, that’s true for every wallet out there.)

What is a paper wallet?

To keep it very simple, paper wallets are an offline cold storage method of saving cryptocurrency. It includes printing out your public and private keys in a piece of paper which you then store and save in a secure place. The keys are printed in the form of QR codes which you can scan in the future for all your transactions. The reason why it is so safe is because it gives complete control to you, the user. You do not need to worry about the well-being of a piece of hardware, nor do you have to worry about hackers or any piece of malware. You just need to take care of a piece of paper.

Setting up a paper wallet

Paper wallets are formed by using a program to randomly generate a public and private key. The keys will be unique, and the program that generates them is open source. Those with advanced knowledge of coding can check the backend of the program themselves for randomicity in results. What’s more, we’ll be generating our keys offline. This eradicates the exposure to online threats, and deleting the simple program after use will destroy any trace of them.

Don’t worry if it sounds confusing, it’s not. You’ll need no specific knowledge of coding, or encryption. All you do need is a computer, an internet connection, something to record your keys on.

So, let’s go through the steps.

First go to MyEtherWallet.com.

Next, click on the help tab.

Scroll down and click on option 5:

Now open the link

After that download this zip file into your computer:

Now open the zip file in your computer and click on the index.html file. Before doing that, switch off your internet so that you are offline.

Now create a new password and generate your wallet, be sure that you are putting in a strong password:

Now you will have to download your keystore file which is basically your wallet file. Be sure to keep a back up of this file. After you are done with that click on “I understand. Continue.”

And there you go, your wallet has been generated. What you see here is your private key. DO NOT share this with anyone.

You should now print your wallet by clicking on the “Print” button. This is what you will get. Notice that you can see both your private and public keys here:

And there you go. That is how you create an Ethereum paper wallet.

Conclusion: Ethereum Developer: How To Become One, Guide

So, there you have it, everything that you need to know in order to get you started in your journey. This is easily on of the most exciting fields out there right now, and it is only going to get bigger.

According to Upwork, blockchain related jobs is the fastest growing sector in the 4th quarter of 2017. More and more people are looking for developers and coders in the space.

If you think you want to delve deeper then our course may be perfect for you. Sign up for it today and we will guide you towards your journey of becoming an Ethereum developer.

Join Us Today



