How to add a scroll bar in C #

Blockchain Tutorial | How to become a blockchain developer

In this guide, we are going to describe your path to becoming a blockchain developer. Blockchain development is not that different from normal web development - the main difference is that a blockchain developer develops specifically for the blockchain. To make your work easier, we will divide this guide into different sections and give you recommendations for action at the end of each section.

We are undoubtedly in the "era of the blockchain". The impact this will have on our future is indeed frightening and immense. So how can you participate in this “blockchain trend”? If you want to become a blockchain developer, then there are very specific steps that you need to take.

We hope that by the end of the guide you have the tools you need to get started. If you are serious about becoming a developer, let's start with some expectations. First of all, this will take a lot of time and you will need to dedicate this and your resources to this training (continue your training with us by taking our online courses). Second, you won't see results right away because there is no magic bullet to becoming a blockchain developer.

So let's get started.

Section # 1: Understand the Basics

First of all, you need to become familiar with various concepts that come with new and breakthrough technologies like blockchain.

If you are a beginner then there are certain terms that you need to be familiar with:

Get to know blockchain technology

  • Blockchain: The blockchain is a chain of blocks in which each block contains important data without central monitoring. It is cryptographically secure and cannot be changed.
  • Decentralized: The blockchain is deliberately decentralized because there is no central and monitoring authority.
  • Consensus Mechanism: The mechanism through which a decentralized network comes to a consensus on certain issues.
  • Miner: Users who use computing power to search for blocks.

It is advisable to learn more about these crypto-sphere terms. To do this, go through our comprehensive glossary. It is important to understand these basic terms, otherwise you will get lost very quickly in the course of your training. In the next step, it will be necessary to find out more about the technical side of the blockchain.

If you are interested in the technical side of creating a financial application of the blockchain, then you should definitely get to know the peculiarities of the crypto-economy. Most developers are usually very familiar with the “crypto” part, but their knowledge of the “economics” part is almost entirely lacking.

This knowledge discrepancy becomes very apparent when you look at some of the existing ICOs. It is all too obvious that the economic side of their ICOs has not been well thought out.

That is why it makes sense to find out about general economic processes. If you want to learn about cryptoeconomics in general, then you can read our article here.

If you are particularly fascinated by cryptography, you want to know how signatures work and what public-key cryptography is, then read on here.

We also encourage you to understand how Bitcoin works. Bitcoin is the most widespread, best, and one of the most elegant uses of blockchain technology. It's the best example of what blockchain technology can do, if only for the impact that Bitcoin has unleashed.

So read Satoshi Nakamoto's whitepaper on Bitcoin. You can find it here. This ends the first section.

Let's take a look at the recommendations for action that you have to carry out here up to this point:

  • Get to know the various terms and lexicons.
  • Find out more about the more technical aspects of blockchain.
  • Read the Bitcoin whitepaper.

Section # 2: Learn How the Procedure Works.

It is quite a surprise to see how many budding “developers” have no experience with cryptocurrency at all. How can you re-design and improve a platform if you haven't even used it?

It is imperative that you become familiar with the system immediately.

Find Coinbase or any other exchange that you are comfortable with or that is available in your country and buy some coins. No need to start a large portfolio right away, just purchase a few coins and learn the whole process.

It's very easy. Since you won't buy a lot of coins, it is best to use a simple online wallet.

These wallets are very easy to use. It's super easy to set up as you create your own account with an exchange service. You can also access these wallets from any server or device in the world - all you have to do is be connected to the network. However, there is one major problem with online wallets. Your private key is stored on another server. With this, you give hackers your key on a silver tray. DO NOT use online wallets to store large amounts of money there. Just keep the bare minimum there that you need for replacement.

As you build a large portfolio, you need to learn how to use cold wallets to hold your money. You can find out how to do this here. When creating your ICO later on, you MUST understand how wallets, and especially multi-sig wallets, work.

That ends this section and the difficult part begins with the next section.

Your recommendations for action are here:

  • Learn how the exchange works.
  • Familiarize yourself with wallets.

Section # 3: Let's Start Programming! The blockchain guide

As a blockchain developer, you face a multitude of challenges in the backend. Creating and maintaining a public blockchain is not easy for various reasons.

(Before we proceed, a big thank you to David Schwartz for his keynote address on the use of C ++ in blockchain software development at CPPCON 2016.)

Reason # 1: security

Blockchains, as David Schwartz put it, should be fortresses. First, the code is public and can be viewed by anyone. Anyone can look at the code and look for bugs and vulnerabilities. Unlike other open code programs, weaknesses found in blockchain code can have a huge impact. Any programmer can hack and potentially steal millions of dollars. Because of these legitimate security concerns, blockchain has typically been very slow to develop.

Reason # 2: resource management

It's important to keep up with the network. You can't fall behind too far and keep up with all network demands. Be well prepared to handle remote and local inquiries.

Reason # 3: efficiency

The blockchain always has to work as well as possible and the language chosen has to be extremely versatile. The challenge is that certain tasks in the blockchain can be carried out in parallel, but other tasks cannot be carried out in parallel.

A good example of a "parallelizable" task is the confirmation of digital signatures. All you need for signature verification are the key, the transaction and the signature. With just three pieces of data, you can perform parallel checks.

However, not all functions of a blockchain should be performed this way. Think about the execution of the transaction itself. Multiple transactions cannot be executed in parallel; it must be done one at a time to avoid errors such as double spending. Some languages ​​are good for parallel operations; others are better for non-parallel operations.

Reason # 4: isolation

What is a set behavior?

If A + B = C, then A + B will always be C, regardless of the circumstances. This is called a set behavior.

Hash functions are predefined, i.e. the hash of A will always be H (A).

In blockchain development, all transaction operations must therefore be specified. You cannot have a transaction that behaves like this today and behaves differently the next day. Neither can you have smart contracts that work differently on two different machines.

The only solution to this is isolation. Basically, you separate your smart contracts and transactions from elements that are not defined in advance.

There are a few languages ​​that meet most of these requirements. If you are a blockchain developer then you absolutely need a basic knowledge of C ++ and JavaScript.

Even if C ++ seems a bit out of date, it fulfills all of the functionalities that we described above wonderfully. Indeed, Satoshi Nakamoto wrote the Bitcoin source code in C ++.

In addition to HTML and CSS, this is one of the three core technologies used to produce content on the World Wide Web. Javascript is usually used to create highly interactive web pages.

So let's create a very simple blockchain with Javascript.

A big thank you to savjee.be for the content below.

How do we create a block? What is a simple block made of? In our simple cryptocoin that we are going to make (let's call it "BlockGeeksCoin"), each block will contain the following information:

  • Index (index): To find out the block number.
  • Timestamp: To know the time of creation.
  • Data: The data within the block.
  • PreviousHash (previous hash): The hash of the previous block.
  • Hash: The hash of the current block.

 

Before we go any further, you need to understand certain terms that we will use in our program:

This: The keyword "this" is called within a function and enables access to the values ​​within a particular object that calls that particular function.

Constructor: A constructor is a special function that can help when creating and initializing an object within a class. Each class is limited to only one constructor.

So let's start creating our block.

Create the block

Code analysis

This is from a block. In the first line of code, we called the crypto-js library because the sha256 hash function is not available in JavaScript.

Next we called a constructor inside the class to call objects that have certain values. You probably noticed the calculateHash () function. Let's see what this does exactly.

In a block, we take all of the content and hash it to get the hash of that particular block. We use the JSON.stringify function to convert the data of the block into a string and hash it.

We have now completed the block and it is ready to go. Now let's connect the blocks to a blockchain.

Building the Blockchain: Becoming a Blockchain Developer

Code analysis

Various things happen in the chain above, which we break down into sections below.

  • Part 1: The Genesis Block

What is a Genesis Block?

The Genesis block is the first block on the blockchain. It is special because, unlike any other block that references a preceding block, it does not refer to anything. So as soon as a new chain is created, the Genesis block is called immediately.

You will also see a “createGenesisBlock ()” function in which we entered the data of the block manually:

  • Part 2: adding the blocks

First of all, we need to know the last block of the current blockchain. To do this, we use the getLatestBlock () function.

So what is happening here? How do we add blocks? How do we check if the given block is valid or not?

Do you remember the content of a block? A block has the hash of the previous block, right?

So what we're going to do here is simple. Compare the previous hash value of the new block with the hash value of the last block.

Image courtesy: Lauri Hartikka

If these two values ​​match, then it means the new block is correct and will be added to the blockchain.

  • Part 3: checking the chain

Now we need to check that no one has messed around with our blockchain and that everything is stable.

We use the "for" loop to get from block 1 to the last block. The Genesis block is block 0.

If the “previous hash” of the current block is not the same as the “hash” of the previous block, then this function returns False, otherwise True.

Use of the blockchain

Now we are going to use the blockchain to create our BlockGeeksCoin.

And that was it!

So what happened here?

We created a new cryptocurrency based on the blockchain and called it BlockGeeksCoin. By calling this new object, I activated the constructor, which in turn created the Genesis block automatically.

We just added two more blocks and put some data on them.

As simple as that.

(Thanks savjee.be for the amazingly simple explanation.)

So much for this section. Let's take a look at the recommendations for action. It's very simple, but definitely not easy:

  • Learn one of the many blockchain friendly languages ​​like C ++, Javascript, C #, Go etc.

 

Section # 4: Learn What Smart Contracts Are

What is the definition of a smart contract?

According to Wikipedia, a smart contract is “a computer protocol designed to facilitate, review, or enforce the negotiation or performance of a contract”. This concept was first proposed in 1996 by the American cryptographer Nick Szabo. Today it is often attributed to Ethereum, popularizing this concept and making it mainstream.

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

What desirable properties do we want in our smart contract?

Everything that runs on a blockchain must be immutable and have the ability to run through multiple nodes while maintaining integrity. For this reason, the functionality of smart contracts must meet three conditions. It must:

  • Be set beforehand
  • Be terminable
  • Be isolated

Feature # 1: Be fixed from the start

A program is deterministic if it produces the same result every time for a particular input. For example, if 3 + 1 = 4, then 3 + 1 is ALWAYS 4 (with the same base). So if a program always returns the same result for the same inputs on different computers, the program is called deterministic.

There are several moments when a program can act indefinitely:

  • Calling indefinite system functions: When a programmer calls an indefinite function in his program.
  • Non-deterministic data resources: If a program is collecting data at runtime and this data source is indeterminate, the program becomes indeterminate. For example, let's say a program that gathers the top 10 Google searches for a given query. The list can change all the time.
  • Dynamic calls: When a program calls the second program, it is called a dynamic call. Since the target of the call is only determined during execution, it is of an indeterminate nature.

Feature # 2: Cancelable

In mathematics, we know a mistake called the “hold problem”. Basically, this means that it is not possible to know whether a certain program can perform its function in a time limit or not. In 1936, Alan Turing, using Kantor's diagonal problem, concluded that there was no way of knowing whether or not a particular program could end in a time limit.

This is of course a problem with smart contracts, because contracts must, by definition, be terminable within a certain period of time. There are precautions to ensure that a contract can be terminated externally so as not to be caught in an infinite loop that costs resources:

  • Turing incompleteness: An incomplete Turing blockchain has limited functionality and is not able to make jumps and / or loops. Therefore, they cannot go into an infinite loop.
  • Level and fee display: A program can simply count the number of "steps" it has carried out, i.e. the number of instructions executed, and stop after executing a certain number of steps. Another method is the billing meter. Here the contracts are concluded with a prepaid fee.Each order execution requires a certain amount of fees. If the fee issued exceeds the prepaid fee, the contract will be terminated.
  • Time switch: A preset time switch is used here. If the execution of the contract exceeds the deadline, it is canceled externally.

Feature # 3: Isolated

In a blockchain, anyone can upload a smart contract. As a result, however, knowingly or unknowingly, the contracts may contain viruses and errors. Failure to isolate the contract can affect the entire system. Therefore, it is critical that a contract is isolated in a sandbox to protect the entire ecosystem from negative impacts.

Now that we are aware of this feature, it is important to know how it is carried out. Typically, smart contracts are executed using one of the following two systems:

  • Virtual machines: like Ethereum
  • Docker: like Fabric

Let's compare these two and see which one makes a better ecosystem. For the sake of simplicity, we will compare Ethereum (Virtual Machine) with Fabric (Docker).

Virtual machinedocker
deterministicThe contracts have no indefinite functions and the data is limited to information on the chain. However, it makes dynamic calls that cannot be deterministic in nature. Fortunately, the data available is deterministic.Due to the design of the Docker, the system relies on users to create deterministic contracts. It's not really the best solution.
terminableEthereum uses the "fee meter" to terminate. Every step in the contracts costs “gas” and as soon as the gas costs exceed the prepaid fee, the contract is terminated.Fabric uses a timepiece. However, the timer can differ from node to node because each node has its own computing power. Therefore, there is a risk of adhering to the consensus process.
isolatedHas good insulation properties.Relies on the namespace and unable to properly isolate.

If you are specifically interested in the evolution of Ethereum then it is important that you also dig into Solidity.

For anyone looking to learn how to create DAPPs (Decentralized Applications) or interested in ICO, learning Solidity is an absolute must. We already have a detailed guide on how to do this, which you can read here. At this point, however, we would like to give you a basic overview. Solidity was developed by Gavin Wood, Christian Reitwiessner, Alex Beregszaszi, Yoichi Hirai and other former key Ethereum employees to enable the writing of smart contracts on blockchain platforms like Ethereum.

Solidity is a deliberately lean, loosely structured language with a syntax that is very similar to that of ECMAScript (Javascript). There are some important points from the Ethereum Design Rationale document to be noted, e.g. that it is a stack-and-memory model with a 32-byte instruction word size, the EVM (Ethereum Virtual Machine) provides access to the program " Stack ", which corresponds to a directory location where memory addresses can also be accommodated in order to make the loop / jump for the program counter (for sequential program control), an expandable temporary and a permanent" memory "that is actually written into the permanent blockchain, and most importantly, the EVM requires absolute certainty within the smart contracts.

If you are interested in learning Solidity, you can attend our intensive course here.

Our recommendations for action are:

  • Learn how smart contracts work.
  • (Optional for Ethereum developers) Learn Solidity.

 

Section # 5: Be There!

One of the most important things you can do as a budding developer is to keep up to date.

Head to the Reddit forums, Gitbub pages, and StackExchange to engage with fellow developers and keep an eye out for the latest in technology.

Additionally, it makes sense to know what people want from blockchain developers. What skills are companies looking for? You can find information on this here.

This information can be very useful in adding the finishing touches to your business-critical skills.

Your way to becoming a blockchain developer: Conclusion

So this is a rough guide on your path to becoming a blockchain developer. Of course, that alone is not enough, you have to show initiative and always be up to date.

If you are looking for more information on blockchain development, click here.

We wish you all the best on your way!

 

Like what you read? Give us one like or share it to your friends and get +16