Chapter 01: Blockchain Basics
The Blockchain technology is a concept of the distributed ledger or P2P (Peer-to-peer) shared ledger on a peer-to-peer network. A blockchain is a chain of blocks stored on the hundreds and thousands of computers across the globe and distributed over the geographical location. In blockchain technology, digital information is distributed among peers all over the world; this information is distributed among thousands of machines, not stored at any single location, all records are public and easily verifiable. It is a complete ledger that keeps the copy of all the credits or debits of digital assets. That digital assets can be a bank transaction statement, digital currency or any digital information. For example, consider a bank statement of several transactions. These transactions are recorded into a chain of blocks. This chain of blocks is distributed among thousands of peers across the globe so that each peer can individually verify the transaction without involving any other peer.
The blockchain technology is using decentralized network architecture to maintain its network, it means, block chaining is not centrally controlled by any corporation or agency but a decentralized network to make it more secure. According to Block Chain Council, the term “Blockchain technology” typically refers to the transparent, trustless, publicly accessible ledger that allows us to securely transfer the ownership of units of value using public key encryption and proof of work methods.
The term Trustless is popularly used with blockchain technology. It does not eliminate the trust between the peers, but reduces the level of trust required required from each entity in the system. To make it trustless, trust is distributed among different actors. These actors are the miners, who put computational power to maintain and secure the ledger. The more miners in a network, the more resources are shared hence, the network is more secured.
Therefore, the blockchain is decentralized ledger tracking digital assets on the P2P network. When we sayP2P network, it means peer-to-peer or decentralized network, where all the computers are connected in some way, and each computer holds the complete copy of the ledger.
Consider a bank account having transactions on a daily basis. The full ledger will keep track of every transactional amount either credit or debit. When the account holder demands the complete balance statement from the bank, the statement contains every transaction record with a time stamp. You can validate the transactions from the balance statement. Similarly, each block records the transactions. As we known, every new block is connected with the previous block so that the entire blockchain will contain the total number of transactions from the beginning.
The centralizednetwork always has a central root node or a root server that connects to all child nodes and always keeps the control inside. In a centralized network, all users and end-point devices are connected with a single, central node that controls all nodes and all communication throughout the network. The centralized network offers better controlling and visibility over the network, dependency regarding single-point of failure, and no data or application redundancy.
Figure 1-01: Centralized Network
Decentralized networks are being distributed among multiple nodes however a decentralized network may be either distributed or a point-to-point network. There is no centralized node controlling the entire network as a single point of control, it can be multiple or more than one node.
Distributed networks are comprised of multiple central nodes, connected and controlling several sub-nodes or endpoints. Distributed networks have divided control over the network among root nodes.
Distributed networks or P2P networks are categorized in the decentralized network because both of these networks have divided control. In a P2P network, the system that includes each node is connected to the other node directly or indirectly.
Figure 1-02: Distributed Network
Peer-to-peer network is another type of decentralized network where peers are referred as computer systems or endpoint devices connected and sharing resources with another peer via internet without the need of central or root server. Each endpoint acts as a file server or client to communicate over the P2P network. Sender of the file will become server whereas receiver of the file will be client.
Figure 1-03: Peer-to-Peer Network Model
The difference between client/server model and peer-to-peer network is very common. Peer-to-peer network, as defined above, requires no central server to communicate or share resources with the remote peer over the internet. Whereas, in a client server model, resources are shared over the server and can be accessible by any client. The client has to provide username and password to authenticate themselves, thus the client/server model possesses more security than a peer-to-peer network.
Figure 1-04: Client-Server Model
Block chaining is the technology that works on a P2P network for a distributed ledger. This distributed ledger includes information about digital assets. Therefore, the blockchain is a ledger that stores the credit or debit of every single record in such away that it cannot be tampered by anyone without letting the other notice in the changing or tampering. Every block and page are connected to each other. In a way, blockchain is related to cryptocurrencies but is not a cryptocurrency.
To understand the operation or workflow of block chaining, consider some transactions among three clients namely, A, B and C. First block of the chain is called “Genesis block.” Genesis block may also be called “Block 0” or “Day-Zero Block.” Each client initially has some balance amount, for example, client A has five coins, client B also has five coins, whereas client C has tencoins. The nonce is a 32-bit random or pseudo-random arbitrary number assigned by the miner to each block to ensure old communication is not replayed. Furthermore, it can be used as an initialization vector and in cryptographic hashing functions.
Sign n -1 value for genesis block is 0, because sign n denotes the hash value of the previous block which is none for the case of genesis block. When we move to block 1, sign n value will be considered for block 1 will be the hash value of the previous block (block 0), and so on.
Furthermore, genesis block contains some transactions, as shown in the figure below:
Figure 1-05: Block Chaining Process
In genesis block, as shown in figure 1-05, user A transferred one coin to user B. Similarly, user B transferred four coins to user C. Now, user A has four coins, user B has two coins, and user C has coins. Now the hash value is calculated for this block (genesis block) using the SHA-256 algorithm to ensure the integrity of the block.
Now, moving to block 1, “Nonce” value and “Sign n -1” value is to be calculated for this block. Sign n -1 value will require the SHA-256 value of the previous block (Block 0). Transactions are saved in this block in the same way as for previous block. At last, SHA-256 value is calculated for this block and in the same way, the chain continues.
The blockchain is an interesting technology that underpins the digital currency bitcoin. Bitcoin has a main application and is commercialized in a growing number of areas and the public sector to which it opens up its financial services.
What is the reason behind the blockchain?
The purpose of blockchain is to establish and govern minimum standards, to develope measurements and inform the public if the individual meets or exceeds the minimum standard. Being a blockchain expert is a unique and self-regulating profession.
This certification is well suited for an investment banker, consultant, and advisors who are advising a company in the blockchain space or in the supply chain health care. It is for those who are looking to understand blockchain and how it can be used. The certification is also suited for university professors, engineering and management students, programmers and developers, security professionals, administrators, senior government officials and operation heads in businesses.
In today’s modern era, blockchain experts are highly valued. Many organizations are looking for a certified blockchain expert and certified blockchain developers. This certification is the basic understood and gained knowledge of the blockchain.
You can build your own blockchain business with the acquired knowledge.
The blockchain is completely different from traditional technology. In the blockchain database, each participant maintains updates and calculates the new entries into a database, all nodes work together.
In a traditional database, running on the internet utilizes client-server network architecture. It means, clients can change entries that are present in the centralized server.
Decentralized control: it allows different parties who do not know each other but share information without needing a central system.
Centralized control: it is controlled by the administrator.
History of record
No history of record
There is no confidentiality of information; information on blockchain is public.
In traditional databases, information is accessible by authorized member.
No Access Control is required
Requires Access Control
There are two functions of the blockchain
There are four functions of traditional
Table 1-01: Difference between blockchain and traditional database
Table 1-01 helps us in gaining a better understanding of the differences between the functions of the blockchain and that of the traditional database.
The most important advantage of blockchain technology is a trustless system. In a typical system, you have to trust different entities within a system such as users, administrators, third parties and others. If any of the trusted party is compromised, the entire system becomes vulnerable.
Trustless nature of blockchain technology eliminates the need of trusting any entity within a system. When you are relying on a decentralized-ledger, you have distributed the trust among several miners who are responsible to compute validate and compare the transactions to keep it secure. You do not have to trust anyone to trust the ledger’s data. All blockchain-based ledgers are maintained by multiple nodes through the consensus-based algorithm.
How available is the blockchain system?
- It is a decentralized system.
- It is nearly impossible to shut down all nodes distributed all over the world at the same time.
- Any record of transaction can be verified by anyone openly whether it is running on a public or private blockchain based ledger with the permission.
- Auditability or verifiability does not mean the records are always accessible. There can be encryption layers on top of it, matching the record tape for security.
- It is easy to audit any transaction & the trail of it. This becomes a much more meaningful talk about the regulators. To know the business or use cases when the regulator is needed to audit the perfect usage.
Another most important thing that blockchain offers is an immutable ledger. This has been a standout amongst the most praised highlights of relatively every blockchain.
- Essentially, immutability is the most trusted for having the capacity to detect and prevent ‘double sending. ’If everyone trusts the ledger’s content to be immutable, prevention of double sending would be at any rate exceptionally faulty and virtually impossible.
- The blockchain is purposefully made to be practically immutable, i.e., no one (in theory, at least) can alter the blockchain’s ‘distributed ledger’ of every single committed block.
- Bitcoin or Ehtereum is the most popular implementation of the blockchain; immutability is accomplished by means of ‘proof of work’ system. It is the integral and the required part of their consensus reaching algorithm.
What is “Proof of Work”?
Proof-of-work is basically a consensus algorithm used in blockchain technology that proves the transactions and adds new blocks in the existing blockchain. Computation of PoW i.e. solving the mathematical puzzle is a difficult operation in terms of time consumption and resources required to compute, however it is easy to validate.
The responsible entities in a network are called Miners whereas the process is called Mining.
PoW is basically a competition among miners to complete the process of pending transaction in order to confirm & verify the transactions and to produce a new block in the existing blockchain. Miners are rewarded for the PoW and for bearing this responsibility.
Blockchain, hence is a decentralized track, as a result, the blockchain follows the longest chain rule.
Longest chain rule
- This means that all the nodes will always follow the longest chain. To handle a conflict in the blockchain, longest chain rule is applied. In case where two or more miners build the block simultaneously, the longest chain will continue the blocks whereas other chains will be discarded. Longest chain rule is defined in next chapter in detail.
The mining process in a blockchain requires heavy computational resources. Heavy hardware is required for mining. Comparing to a centralized system, computation resources required in a blockchain technology and time consumption is always slower than a centralized network.
The blockchain is more secured because of its’ decentralized nature.
- There are many honest nodes in the network. Corrupting anyone in the network at the same time is literally not possible.
- Faking the transaction is impossible since the other honest nodes can easily identify and reject the transaction.
- The blockchain is more secure if the proof of work is high.
Few application relating to financial services of blockchain are as follows;
- Capital market
- Trade services
- Wealth management
- Commodities exchanges
One of the main advantage of the blockchain technology is the goal of cost saving. Distributed ledger technology can easily reduce the financial services’ cost between US $15 billions and $20 billion per annum. It is possible to provide decommissions in the legacy system and significantly reduce IT costs. It also operates a lot quicker as well.
Bitcoin is an application of blockchain and implementation of the blockchain. Bitcoin is the cryptocurrency whose ledger is maintained by the blockchain openly.
The concept of “Proof of work” is to build a bitcoin platform where the data produced is expensive and time-intensive. In the case of bitcoin, proof of work is making through the process of “mining.”
The transactions are connected to the bitcoin user’s address that is stored on a general ledger called blockchain.
Figure 1-06: Bitcoin
Another application of blockchain is Ethereum launched on 30thjuly 2015. Ethereum is a platform to build decentralization applications revolving around the smart contract execution platform where we can deploy the smart contract and execute them.
Ethereum is the currency or token that is fuelling the entire network. Proof of Work and Proof of Stake consensus algorithms are used in Ethereum to validate transactions.
Figure 1-07: Ethereum
Figure 1-08: Ethereum website
Smart contract is used to define the computer program code that is capable of facilitating, executing and enforcing the negotiation or the performance of an agreement by using blockchain technology. There is also a smart program that runs on the blockchain.
Multi-chain is another platform to establish the private blockchain. Multi-chain provides an API and command-line interface for setup. In multi-chain, the transaction fees and the block incentive is null by default. Hand-shaking process in Multi-chain helps to identify two nodes representing themselves with an address and list of permissions. The mining process of multi-chain is defined in a criterion known as “Mining diversity”.
Recordkeeper is an open, public blockchain to keep your records. Recordskeeper’s public blokchain allows you to create verfiable and immutale records of any types of data which is not possible in traditional technologies like MySQL, Oracle and MSSQL.
Recordkeeper is a public chain for record keeping and data security. It also allows the users to retrieve the uploaded data by using the key. Data upload is calculated as per the data’s size or by the cost.
It is an open source platform for private blockchain that offers a set of key points including:
- Rapid deployment
- Data stream
- Permission management
Hyperledger is an open sourced community of communities that benefits an ecosystem of hyperledger based solution providers and users.-It focuses on the blockchain related use case that cross a variety of industrial sectors.
What the reason behind creating hyperledger:
- We know that a blockchain is a P2P distributed ledger forged by consent, joined with a system for smart contract and other useful technologies. Together they help in building a new gensis of transactional functions.
- It acts as an operating system for a data-sharing network, micro-currencies, marketplace, and decentralized digital communications.
- It conducts business processes and legal constraints, these functions establish accountability, trust, and transparency at the core.
- This includes various blockchains with their own particular consent and storage models and services for identity, access control and contracts.
- NEO is similar to the ethereum. NEO runs the decentralized software. The difference of the NEO is that NEO is written in a programming language like Python. While the main focus of NEO is on a smart economy, ethereum blockchain focuses on a smart contract.
- NEO lets clients digitize certain assets and track them on its blockchain. Making it easier to trade on them as the client sees fit.
Figure 1-09: NEO
- Stellar is an open source or distributed. It is the network of the decentralized server. A complete copy of global ledger exists on each stellar.
- The ledger records each transaction of the system for the companies and people alike. It records your money as credits that are issued by Anchors. This acts as a bridge between given currencies and stellar of the network.
- Stellar does not manage all type of software like ethereum. ICO aside is not the choice of ethereum.
- Stellar can manage exchanges between cryptocurrencies and fit-based currencies, like a ripple.
The network becomes stronger as the number of people running on these nodes increases.
Figure 1-10: Stellar
EOS is the one of the most or the newest blockchain technology to enter the cryptocurrency network. EOS blockchain is aiming to build a decentralized operating system that can process fast and free transactions. It’s ICO (Initial Coin Offering) has been interesting for a couple of reasons. ICO is a kind of funding using cryptocurrencies.
EOS offers the solutions at enterprise level such as Smart contracts, dApps (decentralized applications) hosting and decentralized storage. EOS sees the solution to solve the problems of usability. Such as, steam and bitshares can process around transaction per second and use smart contract technology. It is very difficult for developers to insert basic functions.
EOS is referred as “Ethereum killer.” Both ethereum and EOS are capable of hosting dApps; the smart contract is supported by both of them. The difference is the amount of transaction each network can process at a given time.
Ethereum is only able to process about 15 transactions in every second, but EOS is hoping to increase this number over millions. Perhaps EOS could be the real Ethereum killer.
Blockchain ecosystem refers different entities within a blockchain system and their interactions with each other such as users, miners, developers, exchanges and applications and the rest of the internet user. Following are some important stakeholders of blockchain ecosystem:
Blockchain developers are those who design, implement and support a blockchain network. Basically, blockchain developers develop using blockchain technology.People settling around the architecture and designing models of blockchain are called blockchain developers.
Types of blockchain developer
There are two types of blockchain developer;
- Blockchain core developer
- Blockchain software developer
Blockchain core developer
Blockchain core developer works on the design architecture of the blockchain network.
They are similar to the blockchain web developers who have included the development protocols like STTP, SLL, and network on architecture.
Role of blockchain core developer
The main role of blockchain core developer is as follows:
- Manage the architecture network
- Supervise the blockchain network
- Work on census algorithm
- Setup blockchain protocol
Blockchain software developer
Blockchain software developer works on the blockchain to create applications.
Role of blockchain software developer
The main role of blockchain software developer is as follows:
- Create a smart contract
- Develop a distributed app
- Work on front and back-end application development
- Supervision of full stack
How do you became a blockchain developer?
We should know the technical knowledge like
- Understanding the blockchain architecture
- Understanding the data structures
- Understanding the basic principles of cryptography used in the blockchain
- Learn languages used for smart contract development
- Basics of web-development
The process of recording the pending transaction by adding a new block into the blockchain through mathematical puzzle (proof of work) is called blockchain mining.
What are the miners?
Miners are referred to a computer or server that does all the required computation to guess a new block.
How does it work?
Miner uses CPU power to identify the random number through which they create a digest or signature of the next block. In such away that the new signature is in a particular order; it can be larger than the previous block or it can have some other logic, but it has to be particular in a systematic way.
In such a way, a new signature is lesser than the previous digest. This means the whole change can be described in a descending order, or it can be in an ascending order, depending on the blockchain that is using it. To calculate this hash, the miner submits the hash to the network and waits for a response. Submitting the hash does not mean that they will get an approval. Their block can also be rejected. Hence, the signature of the new block must be less than the recently added blocks.
Miners do this first, then announce it to the entire network and get the benefits.
Blockchain ecosystem application is considered to be the developer of communities and businesses that can be built to create their own particular services and projects.
As we know, the applications of blockchain are:
Basically, ethereum is the application of blockchain which has three kinds of applications;
- Financial application
- Semi-financial application
- Non financial application
Financial application gives users strong ways of managing and entering into contracts using money. This includes financial derivatives, hedging contracts, sub-currencies, saving wallets and even instruments like employment contracts.
Semi-financial application involves money, although there is also a heavy non-monetary side.
Nonfinancial application includes applications such as online voting and governance mechanism. Basically, this is not financial at all.
NEO is one of the most popular applications of blockchain ecosystem. There are the benefits of NEO ecosystem that invest in upcoming projects. Developers create their own particular alliances such as NEO’s city of Zions. It also helps to create or build infrastructure projects for NEO. NEO has NGC (NEO global capital).
Another application of the blockchain ecosystem is stellar. Stellars have two main components; first one is that user is running stellar nodes on their machines. The second one is the conversion of cryptocurrency to fiat currency.
Each blockchain project has an ecosystem that includes a decentralized exchange. This may be developed by a developer, project team or community.
There are some exchanges as follows:
- Stellar’s SDEX exchange
- NEO’S NEX exchange
Stellar’s SDEX Exchanges
Stellar SDEX is the working name for the project,and internal prototypes are underway. It is designed to find the rates between two digital assets, making it trade crypto. It will enable a chain, protocol-level trades and minimize spread and maximize the choice of assets.
Stellar is the major exchange. It will need to increase the quality and numbers of anchors and market-makers on our network.
Some points of SDEX include:
- Very low trading fees
- End-user control of secret keys
- Trading for stellar ICO tokens
Lighting network on stellar:
According to Stellar, “Lightning is a scaling solution for distributed payment networks, originally proposed for the Bitcoin blockchain. Lightning is designed to allow users to make off-chain payments through routers and hubs. Lightning even has the potential to support cross-protocol payments, such as a payment where the sender sends Bitcoins on the Bitcoin network and the recipient receives lumens on the Stellar network, without having to trust any parties in between.”
NEO’s NEX Exchanges
NEX is a platform that merges blockchain with the off-chain matching engine to enable faster and more complex trades.
NEX has some components that are as follows;
- High volume: NEX manages trade volume through the off-chain matching engine.
- Payment services: It enables smart contract on NEO to send and receive global assets.
- Complex trades: NEX manages complex order type that is not currently available on the decentralized exchange.
- NEX wallet extension: This underpins the NEX ecosystem, allowing fast and seamless coordinate between NEX, dApps, and websites.
- Cross-chain trading: NEX allows performing at nodes between token based on NEO and ethereum.
EtherDelta is one of the decentralized exchange that is used for trading ethereum token. For example, the user can create a wallet directly on the site.
Blockchain was invented by Satoshi Nakamoto in 2008. The blockchain is a technology that has the concept of the distributed ledger or P2P shared on a P2P network. The blockchain is decentralized ledger tracking digital assets on the P2P network.
Bitcoin is the crypto-currency application which deals in digital currency (BTC) only. The transactions are connected to the user’s bitcoin address, stored in a general ledger. The digital number that is being tracked in the ledger is called Bitcoin.
The concept of “Proof of work” is to build a bitcoin platform where data produced is expensive and time-intensive. In the case of bitcoin, proof of work is making through the process of “mining.”
Bitcoin is a crypto-currency.
Blockchain is a decentralized ledger
It focuses to speed-up cross-border transactions and reduces the governmental control.
It is decentralized ledger which keep the records of all peer to peer transaction.
Bitcoin application is limited to trading digital currency
Blockchain can easily trade with currencies to property rights
Blockchain is open, having vast scope in supply chain, health care, smart contract and other domains.
Table 1-02: Difference between blockchain and bitcoin
Figure 1-11: How the Bitcoin works
- Above figure shows, Bob generates his first transaction to Alice. Using his wallet, bob sends the bitcoin to Alice’s address.
- Private key signs the transaction to confirm the authenticity of the source.
- Miners in the network compute the pending transaction and calculating the hashes. The first correct miner will get rewarded for this mining.
- Nodes within the network validate the transaction.
- If the transaction is verified, new block is added in the existing blockchain. This newly added block is secured from being altered.
- Upon successful addition of new block, payment is transferred to Alice’s wallet.