Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Oracle Blockchain Quick Start Guide

You're reading from   Oracle Blockchain Quick Start Guide A practical approach to implementing blockchain in your enterprise

Arrow left icon
Product type Paperback
Published in Sep 2019
Publisher Packt
ISBN-13 9781789804164
Length 350 pages
Edition 1st Edition
Concepts
Arrow right icon
Authors (3):
Arrow left icon
Vivek Acharya Vivek Acharya
Author Profile Icon Vivek Acharya
Vivek Acharya
Nimesh Prakash Nimesh Prakash
Author Profile Icon Nimesh Prakash
Nimesh Prakash
Anand Eswararao Yerrapati Anand Eswararao Yerrapati
Author Profile Icon Anand Eswararao Yerrapati
Anand Eswararao Yerrapati
Arrow right icon
View More author details
Toc

Table of Contents (8) Chapters Close

Preface 1. Exploring Blockchain and BaaS FREE CHAPTER 2. Construing Distributed Ledger Tech and Blockchain 3. Delving into Hyperledger Fabric 4. Engage in Business Case on Blockchain Platform 5. Managing Solutions on Oracle Blockchain Platform 6. Developing Solutions on Oracle Blockchain Platform 7. Other Books You May Enjoy

Blockchain definition and analogy

With all of these fact checks about ledgers, types of systems, and knowing about the difference between DLT and blockchain, let's get into the definition and analogy of blockchain. Blockchain is a P2P network, where the ledger is distributed and transactions are posted to the ledger, but only upon consensus. Such a P2P network, along with various components, such as smart contracts, cryptography, and algorithms, help build a blockchain network that delivers trust. Blockchain allows participating parties (nodes) to establish consensus, without an intermediary, which leads to a single distributed truth (ledger). There's no reconciliation, no delays, and no intermediary, and transactions are recorded in real time over an immutable ledger forever.

Let's use an analogy for blockchain. Let's refer to blockchain as a notebook. Each page represents a block on this blockchain. You can record data of any kind, such as medical records and financial transactions, on this page, which is also known as a block, where each page (block) is chained to the previous page (block). This chain is not just a link to the previous page; it also contains information about the page in such a way that, once the data on the page is defined and added to the notebook, it cannot be changed. If it is changed, information about the page is changed. Then, the chain it holds with the other page is changed and so on. This is noticeable since the chain link is broken. Hence, the lines on each chained page are immutable.

Blockchain technology also includes smart contracts, which are intelligent programmatic contracts, also known as rules; these are defined and executed when an event of a certain type occurs on the blockchain network. It is called blockchain because the chain of blocks are a linked list of the blocks, where each block has one or many transactions. These transactions are verified and validated by the blockchain network in a given time span. The blockchain protocol's consensus algorithm, adopted for that blockchain network, defines the rules and incentive of the participating nodes. We will cover this in detail in the consensus algorithm section.

Blockchain is a chain of blocks, where each block has transactions that are recorded on a ledger (blockchain), which is distributed over all of the participating nodes in the blockchain network. This distributed ledger is the distributed double-entry ledger (as discussed previously), which records transactions for any digital asset or an asset of value. For a blockchain network, transactions are recorded on the distributed ledger from when it (the ledger) started, and they remain there immutably, forever. Hence, financial statements can be generated, traced, and validated from the start of the network. Interestingly, as the ledger is distributed and a copy of it is on all of the participating nodes, any node can verify the transaction and announce the transaction verification to reach consensus.

Analogy

Let's look at another analogy. Let's journey to a technology-less time. There was a beautiful village with a few families where, instead of currency, they exchanged goods.

A vegetable farmer would trade vegetables for rice, and a rice farmer would trade rice for peanuts, and so on. It worked fine until they started making promises to each other. Promises (transactions) were the credits, where a farmer would buy vegetables without giving away the rice; instead, the rice farmer would promise the vegetable farmer they would return rice when it was harvested. Similarly, the fruit farmer would get rice, with the promise of delivering oranges at the time of harvest.

The vegetable farmer trusted the rice farmer; however, over time, there were several promises transacted between various farmers and it was difficult to track those promises, which resulted in a breach of trust. Finally, the villagers appointed a person to keep track of these promises. This person was given the title LedgerMan (centralized third party). Soon, the LedgerMan established trust; however, he was overwhelmed with promises and started demanding a fee (transaction cost). The villagers agreed to pay him a portion of the promise as a fee. This eventually turned the LedgerMan into a rich person. Later, the LedgerMan indulged in corruption, started accepting bribes to tamper with the ledger, bribed villagers to keep his position safe, and sometimes enhanced the fee.

Soon, the villagers realized the challenges of having a LedgerMan (a centralized system). Hence, they decided that, instead of a single LedgerMan keeping the promises, promises would now be kept by everyone (decentralized). There would not be a single person holding the promises; the villagers would meet at a designated place to make promises, and every promise would be recorded by each villager (P2P network).

Once a week, they would validate the promises by reading out their version of the promise. If the majority of the villagers reached an agreement (consensus) over a promise, that promise would be considered valid and would be considered as truth (ledger). In the event of an issue, the promise, which had most of the entries, would be considered a correct promise and would help to resolve any promise-based issues (longest chain). Over the course of time, they added security and various other bells and whistles.

We will revisit this story and extend it as well. For now, we understand that blockchain is a solution (protocol) that allows a leaderless (decentralized) group of peers (P2P) to reach an agreement (consensus) on a transaction, and the moment they occur (synchronized), they are recorded (post) on an omnipresent tamper-proof (immutable) distributed linked-list (ledger), where each peer holds a copy (distributed) of it. We just learned that blockchain is a P2P network; now, let's find out exactly what a P2P network is.

Blockchain components

Blockchain comprises various components that work in tandem in a blockchain network. We will cover some of these components in this chapter, as well as a few others, such as member services, will be discussed in detail in subsequent chapters. The following is a list of blockchain components:

  • Ledger: A ledger is a distributed ledger where transactions are recorded/posted immutably. Being a type of DLT, blockchain ensures immutability of transaction history, right from the genesis block to the current block. We have covered single-entry and double-entry accounting in this chapter. A blockchain ledger is a secure implementation of a distributed double-entry accounting system.
  • Peer network and nodes: A P2P network is a computer network where computers (peers/nodes) are distributed and share the network's workload to reach the end goal. Nodes perform transactions on the blockchain. There are two kinds of nodes—full node and light node. DLT types such as blockchain or Hyperledger can be public or private. In public blockchain, each node has equity; however, they can operate with distinct roles, such as miners, as full nodes, where the entire copy of the blockchain will be replicated on such nodes. They can also act as light nodes and can hold key or block header values only.
  • Smart contracts or chaincode: For a blockchain such as Ethereum, and a DLT such as Hyperledger, smart contracts, or chaincode, are the code logic that is executed on a blockchain network. Participating nodes or blockchain clients can issue transactions against that business logic (smart contracts or chaincode). With the inclusion of a blockchain layer, the ledger will store not only the immutable transactions but also the immutable code.
  • Membership services: For DLTs such as Hyperledger, membership services offer identity and security solutions, which ensure the participation of users on a blockchain network. Authentication and authorization are functions of membership services. They are mostly used in private and permissioned blockchains or DLTs.
  • Events: It's the responsibility of the blockchain or DLTs to raise events when certain defined actions happen on the blockchain/DLT. Events are effective ways to allow other subscriber applications or systems to interact with the blockchain network.
  • Consensus: The consensus algorithm (or protocol) is the core for the existence of blockchain platforms. Needless to say, a blockchain network cannot exist without consensus. The consensus layer is the most critical and crucial layer for any blockchain (Ethereum or Hyperledger, or any other). Consensus is responsible for validating the blocks, ordering the blocks, and ensuring that everyone agrees on it. Visit the Consensus algorithm subsection, in this chapter for details about consensus algorithms.

In the previous section, we discussed ledgers and distributed systems in detail. In this section, we will focus on the P2P network. This chapter, Exploring Blockchain and BaaS, and Chapter 2, Construing Distributed Ledger Tech and Blockchain, cover all the enlisted components in detail.

P2P network

Blockchain technology leverages the internet and runs on a P2P network of computers. These computers run the blockchain protocol, which allows these computers to keep a copy of the ledger. This ledger includes transactions that are packaged in blocks and chained together in a genesis block. The inclusion of blocks in the chain is agreed over consensus, without an intermediary.

A blockchain distributed ledger runs on a P2P network, where transactions are validated using cryptography by consensus algorithms. A blockchain network defines the consensus algorithm for it, which is essentially the rule to validate transactions on the blockchain P2P network. Upon reaching the consensus, blocks are added to the ledger. The node adding the block to the network is then offered incentive (depending on the type of blockchain). Hence, the highlights are that, in the P2P network of a distributed ledger, transactions are verified using cryptography and validated using consensus.

The following diagram shows types of networks:

P2P network

As shown in the previous diagram, a Centralized network has a central node, which defines and governs the validation and verification of the transactions. All other connecting nodes rely on the central authority. The central authority has full access and control of the data, information, and state of the transactions. Although it's a network that is highly regulated, it's also centrally controlled. On one hand, it's safe and secure as long as trust holds true between the central authority and participating nodes; however, human error, malicious intent, single point of failure, and power being in the hands of a single authority has its own challenges. It is suited for very small organizations, where decisions can be taken quickly and even the smallest decision is visible. Decentralized networks are almost the same as centralized ones; however, here, the central node itself is distributed. This means the centralization of authority is distributed. In a decentralized network, each node is not directly connected to node; however, in a P2P network, each node is connected to other nodes.

Network of equity or the peer-to-peer network

A P2P network leverages the network; however, the attachment and detachment of nodes is completely voluntary. The network is a network of equity, where each peer is the same as any other peer, and it is fair and impartial. One peer offers computing resources to other peers, without the need for a central authority to control, govern, or maintain the network. Even though it has equity, each node has a fair chance of adopting the role of the miner or can turn itself into a full node. Each node keeps a copy of the distributed ledger, and this protocol of the blockchain network ensures resilience and immutability of the blockchain network. A blockchain network can resurrect the entire system as long as there is a single node that holds the copy of the distributed ledger.

On a P2P network, information is recorded and replicated between all of the participating nodes; hence, the power, consistency, reliability, and trust in the P2P network grows more and more, as more and more nodes join the blockchain network. Also, as there is no single point of failure and no single authority, the system is not vulnerable to hacking, loss of data, inconsistency, human errors, or a single part controlling the network agenda, and so power and privacy remains with each node. Note that it's the consensus algorithms that ensure the synchronization of data on the blockchain. There are various consensus algorithms, such as proof of work (PoW) and proof of stake (PoS). We will be talking about them in detail in this book.

You have been reading a chapter from
Oracle Blockchain Quick Start Guide
Published in: Sep 2019
Publisher: Packt
ISBN-13: 9781789804164
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image