{'fraction_non_alphanumeric': 0.021546584908874126, 'fraction_numerical': 0.004726622381195708, 'mean_word_length': 4.8624563155267095, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Blockchain in Depth

Blockchain is defined as a group of unsegregated blocks over a P2P network. It is also considered as a decentralised ledger which holds the records of any online event. It offers a secure platform for knowledge and value transfer even in an untrustworthy network. In digital transactions on blockchain, each transaction is verified by all the nodes within the network using consensus protocol. Through this paper we will give a comprehensive overview of how Blockchain technology works, its current and future applications and how it can change the digital events in future.

In short, blockchain is a time-stamped collection of permanent data records stored within a block and operated by a network of computers that are not controlled by a single individual. Each of these data blocks is encrypted and bound to one another using the principles of cryptography. The data within the network is accessible to every peer within the network. Since it is a ledger of shared and immutable records, by its very nature all that is created on the blockchain is transparent, and the person responsible for a specific transaction is accountable for their actions.
These properties of blockchain were leveraged to create cryptocurrencies such as Bitcoin.
Bitcoin is the most popular real life application of blockchain. The first thing that comes into our minds when we talk of blockchain is Bitcoins. Bitcoins currently validate multibillion-dollar global market of anonymous digital transactions without any government interference. Cryptocurrency (i.e. bitcoins) is a modern form of digital asset, distributed on a network spread across a wide range of computers. The decentralised structure allows them to live free from the power of any central authority.
Our current digital transactions are governed by some central authorities where they are assumed to be trusted. We assume that the trusted third party is telling us the truth about our transactions and about our digital assets. Still the third party possess a threat what if its hacked, manipulated or jeopardized. Here is when Blockchain Technology comes in the picture. Its principle of decentralisation has remodelled the entire digital world by introducing distributed ledger, immutable blocks with digital assets of all the nodes within the networks and introduction of consensus protocol which is used to verify every transaction taking place in the network and eliminating chances of any cyber-attack. The blockchain is further classified into two types: In bitcoin blockchain each block is created after every 10 minutes.
 Chain: Once a block is created it is added to the chain of blocks through a hash which is described below. Since blockchain is referred as a linked list therefore all the blocks are chained to each other through their hash. The hash value of the previous block is inserted in the new block as shown in the Fig.:1. This way a link is created between the old blocks and the new block.
Since the hash value of any block is very volatile to changes, hence if any of the block is altered the hash value of the block will be changed and all the blocks after that block will be considered as faulty since the previous hash value will not match with the altered block"s hash value. This way if there is any Cyber-attack over any block, we will be able to identify it. This makes each block within the blockchain immutable.

Fig. 2: Altered Block [Ref.: 17]
 Network: It can be defined as a collection of nodes or peers each containing a complete record of all the transactions on a blockchain. There is no centralised governing body that has control over the entire blockchain. Each node is referred as trustless node and data integrity is maintained by the blockchain being replicated on all of the node. [17]  Consensus: this algorithm agrees with one consistent blockchain state, as it includes multiple copies on each network node. Consensus algorithm is used in order to validate any transaction within the network.
Within a network details of each transaction in public ledger goes to each node and using consensus protocols with majority of verification/ votes will decide whether the transaction will be accepted or there is double spending. To accomplish this, different schemes are used, such as: The interconnectivity of blocks within blockchain is based on Merkle Tree where the genesis block represents the root node, all the child nodes and leaf nodes represents the remaining blocks of blockchain and recently added transaction on the blockchain. The leaves contain the stored values, and each internal node is the hash of their two children.

Fig. 4: Merkle Tree [Ref.: 21]
The process of adding transactions to the larger distributed ledger of existing transactions is known as Mining. It is used to protect and validate bitcoin transactions. Mining involves Blockchain Miners who are responsible for creating and adding the blocks with transaction data to network with past transactions. Blocks are protected in the ledger by the blockchain miners.
[5] The miners uses advanced tools and the computing power of their own computers to validate the transaction.
[8] The processing power or the computation power required is very large.
Hence the miners who are utilizing so much of electricity and computational power are compensated with some rewards. In Blockchain after every 10 minutes a block is created which holds verified transaction record(copies). Thus, miners are responsible for developing blocks, verification of block and making transactions between two parties smooth and trustworthy.
Mining Pools are basically considered as a group of cryptocurrency miners who come together and share their computational power and resources over a network. A particular individual contributes its computational powers with others in order to find the block and get rewards quickly. The miners in the mining pool will be rewarded based on who finds the block first by calculating the hash code for the block and contribute to the blockchain. Mining pools consist of a pool manager who takes care of proper management of the pool. They take cuts of the reward for their work. For receiving the reward, individual miner who successfully found the block must show proof of work. All the mining pools are not the same i.e. they function differently and have different protocols. Setting up these mining pools can be very expensive, since for establishing such a pool requires lots of hardware equipment such as ASIC (Application Specific Integrated Circuit), CPU, GPU, FPGA (Field Programmable Gate Arrays). Mining pools generates revenue using the following formula: Some of the most common mining pools are as follows: 1. Proportional Mining Pools 2. Pay-per-share pools 3. Peer-to-Peer mining pools Mining Incentive can be calculated as follows: If revenue > cost then: All the blocks in the blockchain are connected to each other through hash value. These hash values are calculated using Cryptography Hash Functions. Each block in the network consist of hash function of its previous block which is calculated as: They are specially designed in order to provide collision resistance property which plays a very important application of information security. A cryptography hash function increases the security and efficiency of a digital signature. In proof of work systems like blockchain, the nonce is used to make it more difficult to generate a valid hash for a given block. A hash value consists of 256-bit output. Miners must find a nonce value that, when plugged into the hashing algorithm, generates an output that meets certain requirements (a certain number of leading zeros).
[18] Various hash functions used in symmetric key cryptography are either SHA-256 or SHA-01. Hashing a block in the blockchain makes the block immutable as if anyone tries to tamper the block the hash value changes and the whole chain is affected and the future chains too, since the network won"t verify the blockchain as its history will be different. Nonce is considered as partial preimage hash puzzle since one part of the input will be given and other part of the input is to be calculated. Double hashing technique is used in bitcoin mining so that quantum computers cannot reverse the hash value and generate the information. In double hashing public key is first hashed with SHA-256 and then with RIPEMD 160 (which shortens the address size from 256 bit to 160 bit). It is possible to generate value of "n" in Q = nP of private key from the value of "n" of public key. This problem is known as Elliptic Curve Discrete Logarithm Problem.
Timestamp is used to check when the block was published in order to form a chain. Timestamp is used to prevent selfish miners. Each block will be timed and mostly issued after 60 seconds. If blocks in competition are received in roughly same time span, say 120 seconds of each other, then the block with fresh timestamp will be picked by miners. This increases the profits from 25% to 32%. A selfish miner with higher computational power like 40% could easily break this defence.

Fig. 5 Timestamp Blockchain [Ref.:19]
Byzantine Generals Problem: It is referred as a component in a distributed system. It was first introduced and published by Leslie Lamport in 1982 in his thesis titled "The Byzantine Generals Problem". The concept behind the problem is whether a group of generals of different nations who are surrounding a hostile nation will reach to an agreement of attacking strategy by communicating with each other under the circumstance where some of them might betray and spread false information. Thus, it questions whether any consensus can be established among groups based on communication and transmission of false information within a distributed system. According to the problem:  Each general has to decide either attack or retreat  Once the decision is made it cannot be changed  All the generals have to agree on the same decision and act accordingly Hence two-third generals among which the information is transmitted must be saying the truth in order to solve this problem and this way we shall achieve consensus as a whole.
[8] Similarly in context of Blockchain, let us consider each general as a node and all the generals (i.e. nodes) within a distributed network. Then in order to make distributed network execute properly consensus protocols are used such as PoW, PoS etc. Putting in simpler terms, majority of the nodes must reach to consensus on the current state of system which will provide authenticity and mutual approval.
Implementation: One node (general) will generate a message telling to attack or retreat and broadcast it. Since there are chances that the message can be tampered, that node will then generate a hash value for this message by hashing the message + nonce (for more strong hash value) and will broadcast it also. This hash value will become as a hash target for other nodes. The other nodes will simply hash the broadcasted message and will compare their hash value with the broadcasted hash value i.e. hash target. If the value is same, hence the message is broadcasted properly.
Hashing happens very fast, the sender node has to spend time, recourses and computational power to produce the required value of nonce in order to generate the hash value. The concept of finding the nonce is referred as Proof-of-Work. If the malicious node even thinks of tampering the message then it first has to change the hash value which means to regenerate the nonce. This can be very time consuming and would require lots of recourses and computational power. This method is said to have solved possible extend of the Byzantine Generals Problem.

2 nd Generation of Blockchain
Ethereum Blockchain: in general, there are two approaches to create a consensus protocol to incorporate the advanced Blockchain-based applications. The following are the two protocols: 1. Creating an autonomous network and

Developing a protocol on top of an existing blockchain
The following solution however needs to automate an individual blockchain as well as check the requisite state transfer and networking code and most implementations will be too limited to merit their own blockchain.
Ethereum was first introduced in late 2013 and launched in 2015. It provides a blockchain with completely-fledged Turing-complete programming language that can be used to construct "contracts" that can be further used to encode arbitrary sate transition functions, enabling users to build new blockchain systems and decentralised applications simply by writing a few lines of code.
It currently is not using Zero-Knowledge proof but by making some necessary functionality changes for zk-SNARKs (Zero-Knowledge Succinct Non-Interactive Argument of Knowledge) a type of Zero-Knowledge proof is included in it. [30] Ethereum Accounts: In Ethereum, the state is made up of objects called "accounts". There are two types of accounts in Ethereum:
EOAs are simple accounts that have no linked code or data storage. They are governed by the private keys and used via software that is external to the Ethereum platform such as a wallet application. Contract accounts are managed by the contract code. It has a smart contract code but does not have a private key. Contract Accounts are owned (and supervised) by the logic of its smart contract. Once a message is received by the contract account, its code is allowed to read and write to internal storage and send certain messages or create contracts.
Ether (ETH): is the intrinsic currency of Ethereum to incentivise the computation within the network. The smallest sub denomination of Ether is the Wei. One Ether is defined as 10 18 Wei.
Gas: It is a crucial part of Ethereum"s antidenial of service model. Impedes any form of computational loss in the code. Each transaction on Ethereum is required to set a STARTGAS and a GASPRICE.
STARTGAS represents the maximum number of computational steps permitted for execution of a transaction. GASPRICE represents the fee the sender pays per computational step. "Gas" is the fundamental unit of computation. A computational step can cost 1 or more gas, depending on the how computationally expensive each step is. The transaction data also contains a charge of 5 gases for each bit.

Code Execution:
The code in Ethereum contracts is written in a low-level, stack-based bytecode language, referred to as "Ethereum virtual machine code" or "EVM code". The code is composed of sequence of byte, where each byte is an operation. Code execution is usually an infinite loop consisting of repeatedly executing the procedure at the current program counter (starting at zero) and then incrementing the program counter by one until the process ends or an error or STOP or RETURN instruction is detected.

Smart Contract:
A "Smart Contract" is a program which runs on Ethereum. Because it controls valuable things like Ether and digital assets, it is called a "contract". They are unalterable computer programs that. Run as part of the Ethereum network protocol deterministically within the context of an Ethereum Virtual Machine. They"re written in high level language like solidity. They are compiled into low-level bytecode running within the EVM. Contracts can run only if they are called by a transaction (which can be initiated from an EOA).
Ethereum 2.0: Ethereum 2.0, ETH2 or Serenity is the next major upgrade of the Ethereum protocol. It intends to bring Sharding, Proof of Stake, a new virtual machine (eWASM) and more. With this it will speed up the transactions per second in order to increase the trade and with low fees. It will be introduced with main objective of moving the ETH"s network from Proof-of-Work to Proof-of-Stake algorithm.

A. Hyperledger Fabric
Hyperledger protocol was introduced for business-to-business and business-to-consumers transactions. It allows for acquiescence with regulations while supporting the varied requirements that arises when completing businesses work together on the same network. The network consists of some central elements such as smart contracts, digital assets, record repositories, a decentralised consensus-based network and cryptographic security. [12] Since the traditional blockchain network was fallen short of meeting the requirements inherited in complex world of business transaction, challenges and threat to confidentiality for private transactions were extreme and to make business transaction trustworthy, Hyperledger was introduced to meet the varied demands of modern marketplace.
Hyperledger is a permissioned blockchain with shared ledger. It takes novel approach towards traditional blockchain model by controlling and managing the admission/ participation of the participants within the network. Hyperledger responds to industrial use cases requirements by providing a secure, robust and scalable model for identity, auditability and privacy. Hyperledger is also useful in saving computational cycles. Hyperledger is considered as an open source community which focuses on developing suite of stable framework, tools and libraries for enterprise blockchain deployment. It was hosted by The Linux Foundation in December 2015. It is considered as an enterprise-grade, open-source distributed ledger framework. Since it is a permissioned blockchain, large enterprises adopted it and started private transactions, sharing confidential documents and other utmost important businesses. For private industries using Hyperledger fabric, identity of the participant is the primary requirement. It uses Smart Contracts, also called chaincode, which comprises the distributed logic processing and agreement of the system. It also controls the overall transaction process over the network. It can be drafted according to the demands of the business. Hyperledger uses X.509 certificates to generate public keys. There are in total two types of consensus algorithms i.e. SOLO which developers usually use to play with the Hyperledger Fabric Networks [31] and KAFKA which is used for production. Since it is Crash fault tolerant, not Byzantine fault tolerant, it prevents system from reaching agreement in the event of malicious or defective nodes. [31] Hyperledger uses "Open Governance" model where the hyperledger Technical Steering Committee (TSC) is final authority. This committee has 11 members and is changed every year. The new team is selected from hyperledger environment"s active contributors and maintainers through voting.

Fig. 6: Hyperledger Reference Architecture [Ref.: 12]
Hyperledger Fabric also provides a feature called plug-and-play of various components. This allows to reuse any existing feature and ready-made modules. For e.g.: if participant verification function already exists, then an enterprise network simply has to plug-in and reuse the existing module instead of designing a new one.
[29] The hyperledger greenhouse hosts various projects from hyperledger labs for developing business for codes which are ready for production. Corda is defined as a P2P network of nodes. Every node serves as a legitimate entity (a person or a company). Every legitimate node is running the corda programs (an occurrence of corda and multiple corda applications is termed as CorDapps). All of the nodes within the network are able to connect with each other. But they only consider a transactions between a group of parties. There are no global broadcasts as in the Bitcoin blockchain. This ensures privacy of data.
State artefacts are an arrangement among two or more parties which is controlled by smart contracts. Every node within the ledger is considered as immutable since corda follows UTXO model which is referred as Unspent Transaction Output model. States may hold random data, which would allow them to portray facts of any kind. The ledger expands over a period of time with the flow of transactions. Such transactions accumulate current state objects and create new state objects.

Consensus:
To determine if a transaction is valid, there are two different types of consensus: Validity Consensus and Uniqueness Consensus.

Validity Consensus: Transaction is valid only
if it has all the signatures of the involved parties and it is contractually valid. The smart contracts accepts the transaction as an input and decides if the transaction is legitimate according to the contract. Once it is approved, the state will be changed and added to the ledger. Contracts thus enforces laws over time on the evaluation of states.

Uniqueness Consensus:
It is important to rectify whether the transaction proposed is true or not, in order to prevent double spending attack. Uniqueness Consensus is provided by notaries. Each state has an appointed notary clusteran observer predetermined to be a group of mutually trustless individual. The transaction which is proposed will be signed by the notary cluster only when they verify whether the proposed transaction is authentic or not. Corda ha a feature called "pluggable" consensus which gives notary cluster a facility to decide which consensus algorithm will be a best fit depending on their requirements in terms of privacy, compliance with the legal system, scalability and algorithmic agility criteria.
The uniqueness consensus is not required to check the validity of the transaction itself. This means that the full contents of any transaction need not be seen by the uniqueness services which significantly increases the privacy and scalability of the system in comparison with other distributed ledgers and blockchains. 2. Notary Public: Various legal documents can be authorised using blockchain technology which will eliminate the middle man and the centralised body. All these documents can be digitally coded using smart contracts and using consensus protocols we can make sure the documents are highly secured and protected b. Punitive Forking c. Feather Forking

A. Innovation Opportunities in Blockchain
The process in which a blockchain is diverged into two different parts due to network"s transaction history or new rule in deciding what makes a transaction valid or due to selfish mining(attack) is called Forking.

Fig.7: Forking in Blockchain [Ref.:8]
6. Selfish Mining: Suppose a miner found a block and instead of publishing it within the network he will hold it and try to add another block which makes two blocks in a row with miscellaneous data before any other miner then he will be able to create a longer chain and can fool the network.

Conclusion
Blockchain is one of the most developing and innovative technology which is expanding its horizon just not in the field of cryptocurrency but also in variety of fields like energy, entertainment, banking, notary and many more. Blockchain restores the entire power of the transaction network to the network users, rather than any centralised authority. This provokes the ideology of decentralization. Decentralisation ideology has changed the way users used to interact with the internet and this made blockchain a key part of Web 3.0 revolutions. We introduced about what blockchain is. Leveraging on it, we listed key terms such as hashing, network, blocks, mining, timestamps, miners, hidden dangers, attacks, innovation opportunities, application in the field of Bitcoins, Ethereum, Hyperledger, R3 Corda.
With the above discussion we can conclude that innovation and development of blockchain technology looks very promising.