Recipe ID: hsts-r38
A blockchain is, in the simplest of terms, a time-stamped series of immutable record of data that is managed by cluster of computers not owned by any single entity. Each of these blocks of data (i.e. block) are secured and bound to each other using cryptographic principles (i.e. chain). The blockchain network has no central authority — it is the very definition of a democratized system. Since it is a shared and immutable ledger, the information in it is open for anyone and everyone to see. Hence, anything that is built on the blockchain is by its very nature transparent and everyone involved is accountable for their actions. In other words, blockchain is decentralized, Distributed, Immutable CryptoGraphic Primitives, that has characteristics of Autonomy, Anonymity and transparency in its accounts and transactions.
As you might know, blockchain is an emerging technology that has the potential to dramatically revolutionize many different fields. This potential is primarily based on its ability to offer people a trustworthy channel to transfer value or real assets (tokenization) over the internet. Blockchain has the capacity to move us from the internet of information to the internet of value, potentially breaking our existing financial systems. Blockchain is in many ways a revolution, similar to the internet when it was conceived—certainly not a passing trend. The reason for this is that it presents a solution to a previously unsolved financial dilemma. For the first time in history, we are able to establish trust within trustless environments (such as the internet), without relying on an authority. As a result, some refer to blockchain as a trust machine.
The potential impact of blockchain is huge—it goes far beyond the mere decentralization of the financial sector. In fact, its ability to circumvent intermediaries opens the door to redefine almost every field revolving around technology—even the internet—pushing us toward a peer-to-peer world.
Many find it hard to understand the logic and the concepts behind blockchain, and why they would need it. This is primarily because we don't have a clear idea what problems it solves, or what advantages it promises. Therefore, I believe it is necessary to clarify from the start which problems are solved by blockchain. We will start by learning about the concept and history of cryptocurrencies.
Blockchain didn't appear out of the blue. It was the product of the evolution of fintech and virtual currencies over the last few decades. At the end of the last century, the widespread use of the internet favored the emergence of digital currencies as an extension of electronic cash systems. Many projects were developed to create new digital currencies: E-cash, E-gold, WebMoney, and Liberty Reserve, to name just a few. Despite huge success in the 1990s, these projects had ceased to exist by the beginning of the new century, either through bankruptcy or being halted by authorities. A currency which is capable of disappearing overnight is a real financial nightmare, but this situation was inevitable due to the centralized nature of such digital currency systems.
There was also always a need for a central authority to be involved, to fight fraud and manage trust within the system. Because of this fatal weakness, the opposite, decentralized model was presented as a solution. However, it was hard to establish trust in such environments without any central authority. This contrast made creating a reliable digital currency a disentangled Gordian Knot.Thankfully, the progress of cryptography and the emergence of some clever solutions brought hope of breaking the deadlock.
In 2008, Satoshi Nakamoto rose to the challenge and unveiled a digital currency called bitcoin. This new currency effectively harnessed cryptography techniques to manage ownership and to secure the system—hence the name cryptocurrency.Satoshi solved the aforementioned problems by introducing what he called initially a chain of blocks. In his published whitepaper, he presented his vision for a new peer-to-peer electronic cash system—bitcoin—and described in detail its underlying machinery—blockchain.
Bitcoin was the first reliable and distributed electronic cash system that's fully peer-to-peer, underpinned by the following basic concepts:
With the assumption that the network majority (>51%) is honest, the bitcoin system operates autonomously following the rules defined by the protocol (consensus rules) to validate a given transaction. By using a shared blockchain, each player has the ability to check the transaction's log history and the sender's solvency, then vote on whether the proceeded transaction is valid or not. The voting depends on the overall hash-power the player puts into service to secure the network (initially, one CPU is one vote).
To use a cryptocurrency, users need to install a specific client which creates a wallet, generates cryptographic key pairs (private/public keys), and syncs the blockchain with the network. The public key is used by the client (software) to generate valid addresses, and the funds sent to a given address are controlled by the private key from which the address was calculated. In this way, we rely on secure cryptographic principles to manage ownership.
The following diagram depicts how transactions are processed in bitcoin's peer-to-peer network and added into a blockchain:
In a bitcoin network where users don't know one another, the blockchain is considered the single source of truth to which they refer to learn about previous consensus outcomes. The blockchain with the consensus protocol allows the network to manage transactions without a single point of failure.
Often confused with bitcoin, blockchain is the underlying technology used by bitcoin to operate. Concretely, it's an append-only and chronologically (timestamped) growing database, which harnesses basic cryptographic measures to protect stored transactions from being tampered with (in other words, data can't be deleted or altered). This database, or ledger, collects and records monetary transactions validated by the network in elementary units called blocks. Once validated by the network consensus mechanism, these blocks are added to an existing sequential chain of cryptographic hash- linked blocks, to ensure the integrity of the data—hence the name blockchain. If a single bit changes in one of the linked blocks, the hash-link collapses, the chain is broken, and it will be rejected by the network.
Below diagram shows the process behind blockchain technology in a normal transaction between two parties.
The following diagram shows how the blockchain is replicated and processed by the members of the network to ensure that everyone has a consistent view of the transaction log. When a new block is validated, all nodes synchronize the same copy:
The diagram also shows us that blockchain implements a special data structure, consisting of linked blocks storing transactions and smart contracts. Let us take a closer look at these key elements in detail.
If we consider blockchain to be a ledger or a book, a block can be compared to a page or a table in which we record a collection of confirmed transactions. Each block stored in the blockchain is uniquely identified by a hash, and composed of a header and a body. The header encloses information about its creation (timestamp, Merkle root, Nonce, difficulty target, and version), and a reference to a previous block, whereas the body is a collection of the accepted transactions. When a block is successfully validated (mined), it becomes part of the official blockchain. New bitcoins are generated in the block (a coinbase transaction) and paid to the validators (or miners).
Transactions are the most fundamental building blocks of the blockchain system. They represent the transfer of value (cryptocurrency) within the blockchain network between two addresses. More tangibly, they are represented by small data structures, defined by the blockchain protocol (such as bitcoin or Ethereum), which specifies their attributes (metadata, inputs, outputs, and so on), and model.Before broadcasting the transaction, the user sending the funds signs it using their private key (managed by their wallet), and specifies the destination address. Digital signatures and public keys are used to enable network users to validate the transaction, and to check whether the sender has the right to spend the bitcoins held by a specific address.
Smart contracts are one of the most exciting concepts in blockchain, representing self- executing scripts stored on the blockchain itself. The smart contract takes the blockchain concept to the next stage, enabling it to translate business logic into inviolable contract terms, which will be autonomously executed without relying on a broker, lawyer, or other intermediary.
The earliest form of a smart contract was defined in bitcoin using basic locking and unlocking scripts, but the concept evolved with the emergence of other blockchains. Smart contracts are one of the more powerful, disruptive forces within blockchain, and are garnering more and more business attention. Gartner estimates that by 2022, smart contracts will be used by more than 25% of global organizations. Due to their importance, we have created many recipes for implementing smart contracts in leading blockchain platforms—bitcoin, Ethereum, and Hyperledger.
We have now finished describing the concepts, you can follow our recipes to develop your first blockchain application.
Now that you know what is blockchain technology, you can take a next step by learning blockchain development. We offer the following 4 beginner level classes. Also, we have developed many hands-on recipes for blockchain development in two categories: Hyperledger blockchain development and Ethereum blockchain development. Visit Comprehensive Hyperledger Training Tutorials and Comprehensive Ethereum Training Recipes pages to get the outline of our tutorial articles.
Hands-on Node.JS, MongoDB and Express.js Training
Learn Hands-on Blockchain Ethereum Development & Get Certified in 30 Hrs
Learn Blockchain Hyperledger Development & Get Certified in 30 Hrs
Become Blockchain Certified Security Architect in 30 hours
Blockchain Certified Solution Architect in 30 hours
Introduction to Python Programming
Object Oriented Programming with UML
We provide private tutoring classes online and offline (at our DC site or your preferred location) with custom curriculum for almost all of our classes for $50 per hour online or $75 per hour in DC. Give us a call or submit our private tutoring registration form to discuss your needs.