Download as pdf
Download as pdf
You are on page 1of 35
Syllabus Blockchain - Public Ledgers, Blockehy The Chain and the Longest Chek t@tt 8 Public Ledgers - Block in Blockchain, A 5 Permissi Function, Properties ofa hash function «tres poe eg Blockchain, rkle tree, Transactions- Cryptographic - Hash Contents 1.1 History of Blockchain 1.2 Types of Blockchain 1.3 Blockchain as Public Ledgers 1.4 Block in a Blockchain 1.5 Thé Chain and the Longest Chain 1.6 Permissioned Model of Blockchain 1.7 Cryptographic - Hash Function 1.8 Merkle Tree 1.9 Two Marks Questions with Answers fo In to Blockchain Coptocurrency and Mookehary Tor nologies 1-2 _—_iniredcton 0 EBD History of Blockchain * The first concept of blockchain dates back 10 1991, when the idea of a cryprographically secured chain of records, or blocks, was introduced by Stuart Haber and Wakefield Scott Stometta, Two decades later the technology gained traction and widespread use- 1, as Satoshi Nakamoto gave the first blockchain and * The year 2008 marked a pivotal point for bloc! technology an established model and planned application, The hing the path of blockehain’s impact across eryptocurrency officially launched in 2009, b the tech sphere. * Year 2009 : Nakamoto implements the first blockchain as the public ledger for transactions made using bitcoin, © Year 2014 : Blockchain technology is separated from the currency and its potential for other financial, inter organisational transactions is explored, Blockchain 2.0 is born, referring to applications beyond currency. The Ethercum blockchain system introduces computer programs into the blocks, representing financial instruments such as bonds. These become known as smart contracts. © Year 2015 : Number of merchants accepting BTC exceeds 100,000. NASDAQ and San- Francisco blockchain company chain team up to test the technology for trading shares in private companies. Year 2016 : Tech giant IBM announces a blockchain strategy for cloud-based business solutions. The government of Japan recognizes the legitimacy of blockchain and cryptocurrencies. . © Year 2017 : Bitcoin reaches $1,000/BTC for the first time. Cryptocurrency market cap reaches $150 billion. JP Morgan CEO Jamie Dimon says he believes in blockchain as a future technology, giving the ledger system a vote-of-confidence from Wall Street. Bitcoin reaches its all-time high at $19,783.21/BTC. Dubai announces its government will be blockchain-powered by 2020. © Year 2018 : Facebook commits to starting a blockchain group and also hints at the possibility of creating its own cryptocurrency, IBM develops a blockchain-based banking platform with large banks like Citi and Barclays signing on. © Year 2020 : BTC almost reaches $30,000 by the end of 2020. PayPal announce allow users to buy, sell and hold cryptocurrencies. The Bahamas becomes the world’s first country to launch its central bank digital currency, fittingly known as the “sand dollar.” ill ¢ Year 2021: Bitcoin surpasses $1 trillion in market value for the first time. Popularity for the implementation of Web3 rises. El Salvador becomes first nation to adopt Bitcoin as legal TECHNICAL BIBI InATinne® ~~ pptocurrency and Blockchaln Technologios 1-3. Introduction to Blockchain tender. Tesla buys $1.5 billion in BTC, becoming the first car manufacturer to accept Bitcoin a form of automobile payment. as * Year 2022 : Cryptocurrency loses $2 trillion in market value, due to economic inflation and rising interest rates. Google launches a dedicated digital assets team to provide customer support on blockchain-based platforms. + The U.K. government proposes safeguards for stablecoin holders. Popular video game Minecraft bans blockchain technologies and NFT use in its game, Introduction of Blockchain * Blockchain is essentially a digital ledger of transactions that is duplicated and distributed across the entire network of computer systems on the blockchain. Each block in the chain contains a number of transactions and every time.a new transaction occurs on the blockchain, a record of that transaction is added to every participant’s ledger. The decentralised database managed by multiple participants is known as Distributed Ledger Technology (DLT). © Blockchain technology is a decentralized, distributed ledger that stores the record of ownership of digital assets, Any data stored on blockchain is unable to be modified, making the technology’ a legitimate disruptor for industries like payments, cyber-security and healthcare. Bitcoin stores all its transactions onto a public database called blockchain. A blockchain is a computer file for storing data. Or, it is an open, distributed database, The data is distributed (i.e. duplicated) across many computers and the whole blockchain is entirely decentralised. This means no one person or entity (government or corporation) has control over the blockchain; this is a radical departure from the centralized databases that are controlled and administered by businesses and other entities. ‘A blockchain is an open, distributed database, essentially, a computer file for storing information (data). The name comes from its stnicture: The file is made up of blocks of data, and each block is linked to'the previous block, forming a chain. Each block contains data (such as transaction records), plus a record of when that block was edited or created. Blockchain technology consists of three important concepts : Blocks, nodes and miners Blockchain can be broken down into two components: The block and the chain, A block is a collection of data that is linked to other blocks chronologically in a virtual chain, Each block also contains a timestamp and so it is clear when the data was recorded and stored. TECHNICAL PUBLICATIONS® - an up-thrust for knowledge shnologles _ urroney and Blockchatin Te Cryptoe lows : > Attractive properties of blockchain aro as foll yMUEe 1 Log of data with digital s 2) Immuble . ically secure , privacy preserving 3) Cryptographically secure , privacy , i ne : J computing on top of which applications can be built, ode 4) Provides isis Cor tras Blockchain Platform : i i vork describes the © While a blockchain network describes . a : platform describes a medium where users can interact with a blockchain and its Network, istributed ledger infrastructure, a Blockeaiy * Blockchain platforms are created to be scalable and act as extensions from an existing blockchain infiastructare, allowing information exchange and services t0 be poner direetly from this framework, * An example of a blockchain platform includes Ethereum, a software platform Which houses the Etherium, or ether, eryptocurrency, With the Ethereum platform, users can also create Programmable tokens and smart contracts which are built directly upon the Ethereun, blockchain infrastructure, © What is the difference between a database and a blockchain ? * Blockchain is a special type-of database management system that has more features than a regular database, We describe some significant differences between a traditional database and a blockchain in the following list : 1. Blockchains decentralize control without damaging trust in the existing data. This is not possible in other database systems, Companies involved in a transaction cannot share their entire database, But in as its copy of the ledger and the system een the two ledgers. labase systems we can edit or delete blockehain networks, each company fy automatically maintains Consistency betwe 3. Although in most dat it data, in blockchain we can only insert data, ERE] Genoric Elements of a Blockchain © Generic elements of a blockchain are : address, tr programming language, viru ‘al and state Fig. 1.1.1 shows genetic ructure of a bl nsactions, block, peer-to-peer network and machine, node and smart contract, lockchain, TECHNICAL PUBLICATIONS 7 ee ptocuoncy and Blockehain Tectnologion 4 falicrtuetion to tookohaln wal y oo) Menus Transaction, Transaction Transucsion and other and othor and other data data data nests block) Fig. 1.1.4 Gonorle structure of a blockchain * Address + Addresses are unique identifiers used in a blockchain transaction to denote sender sand receivers. An address is usually a publie key. ransaction : A tra saction is the fundamental unit of a blockchain, A transaction represents a transfer of value from one address to another, * Block : A block is composed of multiple transactions and other elements, such as the previous block hash (hash pointer), timestamp and nonce, * Peer-to-peer network : Peer-to-peer network is a network topology wherein all peers can communicate with each other and send and receive messages. Programming language : Scripts or programs perform various operations on a transaction in order to facilitate various functions. * Virtual machine : A virtual machine allows truing complete code to be run on a blockchain. * Node : Node in a blockchain network performs various functions depending on the role that it takes on. A node can propose and validate transactions and perform mining to facilitate consensus and secure the blockchain. Smart contract : These programs run on top of the blockchain and encapsulate the business logic to be executed when certain conditions are met, Layers of Blockchain Blockchain technology consists of five layers : Application and presentation layers, data layer, network layer, consensus layer, Infrastructure or hardware layer. However, blockchain technology layers can also be categorized as : Layer 0, layer 1, layer 2 and layer 3. Fig. 1.1.2 shows blockchain technology layers. TECHNICAL PUBLICATIONS® - an up-thrust for knowledge introduction to Blockchain rcoda + DapP te Chair Consensus layer pow + Pos « DOS + POET: PBFT Data layer Morkal troe + Tran saction Digital signature + Hash + Hardware / infrastructure layer os + Messaging Vatual machine + Containers + Servie Fig. 1.1.2 Blockchaln technology layers 1, The Hardware Infrastructure Layer adata server, When users browse the web or use any ecurely stored in ess to this data from the server. The framework that * Blockchain data lies blockchain apps, machines request acc facilitates this data exchange is known as the client-server architecture. * Blockchains are peer-to-peer networks that allow clients to connect with ‘peer-clients’ to make data sharing faster and easier. 2. The Data Layer © A blockchain is a series of hashed blocks carrying transactional records. The first block of the blockchain is the Genesis block. After that, every new block added to the blockchain is linked to the Genesis block through an iterative process. And thus, in this way, the blockehain keeps on expanding. «Every transaction is ‘digitally signed’ using the sender’s wallet private key. 3. The Network Layer * The P2P framework enables various nodes to exchange transaction data to arrive at a consensus about the validity of a transaction. This means that every node must be able to discover other nodes on the network for fast communication, * It is the network layer that facilitates this ‘inter-node communication’. As node discovery, block creation and block addition are also managed by this layer, it is also referred to as the ‘propagation layer,” yptocurrency and Blockchain Technologies _1+7 Introduction to Blockchain |. The Consensus Layer ¢ Consensus layer is the base layer for most of the blockchain systems. Main purpose of this layer is to make sure that all the nodes must agree on a common state of the shared ledger. The layer also deals with the safety and security of the blockchain. ¢ This layer is responsible for transaction authentication. Without this layer, the transaction validation will not take place, thus leading to system failure. This layer implements the protocol, which needs a specific number of nodes to validate'a single transaction. * Multiple blocks may be formed concurrently, resulting in a branch in the blockchain due to a large number of nodes processing ‘transactions, bundling them and adding them to the blockchain, However, a single chain block addition is required at all times and the consensus layer guarantees that this dispute is addressed. * There are many consensus algorithms which can be applied for generation of cryptocurrencies like Bitcoin and Ethereum, they use a proof-of-work mechanism to select a node randomly out of various nodes present on the network that can propose a new block. © Once a new block is created, the block is propagated to all the other nodes to check if the new block is valid or not with the transactions in it and based on the consensus from all other nodes the new block gets added on to the blockchain 5, Application and Presentation Layer The application layer consists of the programs that end-users take advantage of to establish Jockchain network communication. Smart contracts, decentralized applications, scripts, user interfaces, APIs and frameworks constitute the application layer. © Layer 0, layer 1, layer 2 and layer 3 of blockchain technology are as follows : 1. Layer 0 : Layer 0 is where the network hardware coexists. It is the foundation on which the rest of the layers are built. 2. Layer 1: The first layer of the protocol consists of the different blockchains that can process transactions. This layer of the protocol ensures the security of the blockchain with different consensus mechanisms, like proof of work and proof of stake being a part of this layer. 3. Layer 2 : This layer is also known as the execution layer, As a blockchain grows, the number of transactions being performed on it increases. To support the increased number of transactions, we need scalability layer 2 solutions. 4. Layer 3 : This is the application layer of the blockchain protocol. It is made up of the different blockchain-based applications. Se teeverwey ans REM Wy. 's Blockchain Important ? woduction fo Blocke, Bworehan Teohnaogies 1st _—____—{nirodation fo Blochchayy A blockehain isa Laigerbasedt peetsto-peet network where each peer has a ledger copy, 4, Dloekohain, ‘Ss Steatedt by connecting the blocks into a chain of documents. ockchain fcititates the verifleation and taceability of multisstep transactions that need Svc Choctions. Cay speedt ayy data tuanstior procedures, provide secure transactions and tower complianee ‘eapenses, Rlvekchain Weehnology nay thcititate contact administration and verify a product's Provenanee. Ly addition, it nay’ be used to manage titles and deeds and voting platforms, Blockchain is Kemmutable, “This opens a lot of opportunities for platforms that need tmumutadle teats to make theie system mote finetional in a highly competitive market. Nramparency: There are literent types of blockchiin, Public blockehain provides Brunspareney die to ite mature, I is very useflil for different finetions of our society, ‘scluding doing elections, Companies can also utilize it fo ensure that the end-user can Brteract with the processes with full or partial tra spareney, Better security : Blockchain uses eryptogtaphy to add a layer of security to the data stored oe the network, The deeentatization feature, on top of the eryplography, makes blockchain Provide better security than other systems, Cryptography utilized complex mathematical algorithats that are used to secure the data and systems on the blockchain network. ERRY chationges for Adoption of Blockchain 2 > mnetticient Technological Design Low scalability : Another one of the challenges of implementing blockchain is scalability, In wweality, blockchains work fine for a small number of users, When the user number increase on the network, the transitions take longer to process, As a result, the transactions cost higher than usual and this also restricts more users on the network. High energy constumption : Energy consumption is another blockchain adoption challenge. Most of the blockchain technology follows biteoin’s infiastructure and uses proof of work as a consensus algorithm, No regulation : ‘This is one of the main challenges of implementing blockchain in an organization, Many organizations are making blockehain technology a means of transaction. There are not any specific regulations about it. So, no one follows any specific rules when it comes to the blockehain Blockchains ean be stow : The blocke ain is complex, That's why jt takes more time to process any transactions, Also, the enetyption of the system ma s it even slower, TEGHNICAL PUBLICATIONS® . an up-thrust for knowiedgo enpiocurency and Blockchain Technologies 1.9 Inteartuction ta Blexkchain ¢ Data format : The success of utilizing blockchain capabilities depends on how well the n data format has been defined in a multi-party environment and keenly observing lated characteristics such as its dependency on other information. transact Decentralization + In blockchain, decentralization refers to the transfer of control and decision-making from 2 centralized entity to a distributed network, + Decentralized networks strive to reduce the level of trust that participants must place in one another and deter their ability to exert authority or control over one another in ways that degrade the functionality of the network, Benefits of decentralization : 1, . Provides a trustless environment 2, Improves data reconciliation 3, Reduces points of weakness 4, Optimizes resource distribution 5. Data cannot be altered or deleted : Blockchain technology's data structure is append-only. Disadvantages of decentralization 1, Conflict : Decentralization can lead to conflict if it is not well maintained in an organizational structure. 3 Cost : In an organizational setting, decentralization can cost more than centralization as it requires setting up of systems that can make communication more automatic. 3. Crime : When it comes to decentralized blockchain, then the crime can be one big disadvantage. As everything done on the network is anonymous and can lead to misuse. 4. Volatility : Decentralized cryptocurrency shows volatile behavior where the prices fluctuate a lot. Difference between Centralized Vs. Decentralized Systems a Trae Tse nialized systems 8 Decontratized systema TECHNICAL PUBLICATIONS® - an up-thrust for knowledge Cryptocurrency and Block ,o4 Centralization is the process of concentrating | power and authority in the hands of senior delegation of power and authority ¢g + functional-level management. management. Formal communication is possible in a entzalized organization, Centralization provides comprehensive leadership and coordination, Advantages and Disadvantages of Blockchain 1. Advantages : * Reduced cost and increased efficiency. * Improved security by protection. * Secure transactions : Blockchain responsible for keeping record of all the transactions be edited or manipulated. * High availability and accessibility * Reliability. 2. Disadvantages : © High implementation costs. * Inefficiency : It is inefficient to have several network users validating the same operations. + Regulations : Regulatory regimes in the financial arena are a challenge for blockchain’s implementation. Types of Blockchain Four different kinds of blockchain architecture are public, private, consortium and hybrid blockchains. Public Blockchain * A public blockchain is a fully decentralized platform where anyone can read and send transactions. The valid transactions are included in the ledger. * A public blockchain is a non-restrictive, permission-less distributed ledger system. * Public blockchains are secured by cryptoeconomics, a combination of economic incentives and cryptographic verification. The degree of influence in the consensus process is proportional to the quantity of economic resources brought in the system. TECHNICAL PUBLICATIONS® - an up-thrust for knowledge tocurrency and Blockchain Technologies 1-11 Introduction to Blockchain « Public blockchains are being used extensively in the mining and trading of bitcoins in the modern day. e Bihereun provider of a decentralized platform and programming language that helps running smart contracts and allows developers to publish distributed applications. e Public blockchains tend to have longer validation times for new data than private blockchains. e Example : Bitcoin, Ethereum, Litecoin. Advantages of Public Blockchain : a) There is a high level of transparency. b) tis also considered virtually unhackable. c) The network is also secure and resistant to censorship because it is highly accessible by users globally. d) Open environment - Public blockchains are open-source, which means that the code is publicly available. Disadvantages of Public Blockchains a) Centralized - Due to the uncontrolled nature of transaction formation, the blockchain is more centralized than private blockchain. b). Scalability - Due to increased usage, public blockchains have been encountering scaling issues. : ¢)Itrequires large amounts of energy and computing power to achieve consensus. Private Blockchain ° Ina private blockchain, write permissions are kept centralized to one organization. In this system the access and permissions are tightly controlled and rights to modify are restricted to the central authority. Private blockchains are usually used within an organization or enterprises where only selected members are participants of a blockchain network. © Private blockchains are more vulnerable to fraudulent activity and malicious actors. ® Private blockchain networks dre deployed for voting, supply chain management, digital identity, asset ownership, etc. + Examples of private’ blockchains are : Multichain and Hyperledger projects (Fabric Sawtooth), Corda, etc. TECHNICAL PUBLICATIONS® - an up-thrust for knowledge Gryptocurrency and Blockchain Technologies __1- 12 Introduction to Blockchain > Advantages of Private Blockchains 1, High security : Private Blockchains are more secure than public ones mainly because it 4 requires authentication to read the information on the bockchain. 2. Data confidentialit Participants can encrypt transaction data. 3. Higher transaction capacity : The private blockchain also has a faster transaction speed than the public one. 4. The private blockchain can easily integrate with other chains or databases without complicated integrations. Better customization : Private blockchains are customizable to the needs of the company. > Disadvantages of Private Blockchains 1, Centralized : All participants are known, so the network is centralized. 2. Scalability governing body, making it slower to execute transactions and achieve consensus. j 3. Regulatory : Participants are known, it is difficult to set up a regulatory framework for thes system. It is limited in terms of scalability as changes have to be approved by th 3] Hybrid Blockchain © Hybrid blockchains use both private and public blockchains, rather than being a standalone solution. ¢ Hybrid blockchains are blockchains that are controlled by a single organization but also hayg some supervision given by the public blockchain: This supervision is required to carry specific transaction validations, hence hybrid blockchains are important. ¢ With hybrid blockchains, a company may put their data or transactions on a prival blockchain to keep the information confidential but put a digital fingerprint of the data o1 public blockchain to secure it 4 © Example of a hybrid blockchain is Dragonchain. Consortium Blockchain © Consortium blockchains are permissioned blockchains governed by a group organizations, rather than one entity, as in the case of the private blockchain. ¢ Consortium blockchains, therefore, enjoy more decentralization than private blockchalt resulting in higher levels of security, 4 Consortium or federated blockchains operate with a particular group of participants control the blockchain, rather than a single entity. This group sets the rules, edits or can TECHNICAL PUBLICATIONS® - an uoannia vonurrency and Blockchain Technologies 4. 13 cunts Introduction to Blockchain incorrect transactions and solicits Cooperation amon, ° g its members, according to a blockchain council report. However, setting up consortiums can be a frau, var ight process as it requires cooperation between a number of organizations, which presents logistical challenges as well as potential antitrust risk. « Consortium blockchains are only useful for smaller groups where the identity of the participants can be determined, ¢ Examples of a consortium or federated blockchain include Hyperledger, Corda and Quorum. {22 Difference between Private and Public Blockchain ae ee ae — — a ah, ae ee Be 7 Ge rss aa oe a8 que ee on : ees ission ea ae ao = ee pt ee ee a ue: DID ee cee a Exany sett at pro oo oe a oe ye ee a a ani oo 2 oe 8 — oe 8 oe ae oon ee sset ownership, ete, a es ca Ghee fussaueae yee sae hen or eee oe _ es x meet aie pown eter, Henn ei ca een te al Nate na We Coptocumeney and Blockchain Technologies _1~ 14 [IEG Difference between Public, Private and Consortium Block | Determination of Consensus Blockchain as Public Ledgers the blockchain concept. The idea of a public ledger is to so that the operations on the application are § A public ledger is a common use o} make all of the transactions in the system public, transparent to all parties. Goals of a public ledger are as follows : Keep the identities of the parties in the transaction secure and anonymous. L 2. keep a record book of all genuine transactions between participants. 3. esp the state of all participants based on the transactions that have occurred. subiracting from their money balance, and verify the participants-using public/private pairs. Because the ledger is made publi, at al time, al transactions are publily know verifiable, and immutable. The blockchain is a Big, Long series of transactions, There is a fairly simple way to ke track of account balances even within the paradigm of storing a series of transactions. This i the Unspent Transaction Output (UTXO) model. Under this modél, user total account] balance is reflected by the output of our transaction. A basic public ledger is probably maintained by some central entity, Distributed ledgers are public ledgers that do not have a central controller who is in cha of adding blocks to the system. A distributed ledger has all of the goals of any public ite However, across a network of nodes, there are multiple copies of the ledger. The challenge is how to add new data to th ( e blockchain when th tog this. This is where the Consensus Algorithm comes in, eine nee TECHNICAL PUBLICATIONS® - an up-thrust for knowledge Cryptocurrency and Blockchain Technologies 1-15 BIZ] Block in a Blockchain ¢ Block is a place in a blockchai Introduction to Blockchain in Where data is stored. In the case of cryptocurrency blockchains, the data stored in a block are transactions. These blocks are chained together by adding the previous block's hash to the next block's header: It keeps the order of the blocks intact and makes the data in the blocks immutable, * Blocks contain data, usually transaction records, including the sender and receiver of a transaction, a timestamp and the amount and type of currency sent. ¢ Blocks in a blockchain contain more than transaction data, they also have what’s known as a hash. Cryptographic hash functions, or hashes, are the mathematical algorithms. These fulfill a crucial role within blockchain systems and are the reason blockchain works in the first place. e Hashes’ appear as a variable series of numbers and letters on a block, such as 4760RFGO7LDD492K83082P78C29Q66. This number-letter combination is generated from the data within a block and functions as its digital signature. ¢ Each block includes the hash of the previous block in its chain. This is how blocks are linked together and how blockchain networks maintain their integrity. Modifying any content within a block would change the hash, which is a red flag for others in the network. *. The structure of a block is different for every blockchain. Fig. 1.4.1 shows the general structure of a block. Transaction Transaction | > Fig. 1.4.1 General structure of a block * Block consists of two main parts : Header and body. * Header : A block's header contains information about the block and the miner. It is further divided into subparts : Previous block's hash and block header fields. Eee Cryptocurroncy and Blockchain Technologies 1-16 jous block. It chains the blocks togethep If data in the previous blocks ig ie blockchain, «Previous block's hash : This is the hash of the prev in the previous blocks immutable. ill change causing the unchaining of th and makes the d: then the hash of that block wi © Other block header fields : These fields can vary depending on the different Some of the common fields are as follows : at a miner changes to change the has! t requirements of different blocke! 1. Nonce : This is an integer thi h of the block to achieve the network's difficulty. ‘Timestamp + This is the Unix time at which the block was mined. Difficulty : It is the current difficulty level of the network. It is stored in different formats in every blockchain. 4. Merkel root hash : Hashes pair off trans: root hash or a Merkel root hash. 5. Block height : The number of blocks mined between the genesis block and the currei actions until only one hash remains, called a block. j s. Every blockchain hi © Body : It includes all the data stored in the block, such as transaction’ a different format for storing transactions. An array of transactions 1S stored in the body of the block. The Chain and the Longest Chain + Every block contains a hash of the previous block. This has the effect of creating a chain blocks from the genesis block to the current block. Each block is guaranteed to come after the previous block chronologically because the previous block's hash would otherwise not t known. «Each block is also computationally impractical to modify once it has been in the chain fora while because every block after it would also have to be regenerated. These properties are what make bitcoins transactions irreversible. The block chain is the main innovation’ Bitcoin. } The blockchain uses an append-only data structure, meaning new transactions and data can be added on to a blockchain, but past data cannot be erased. This results in a verifiable permanent record of data and transactions between two or more parties. This has i potential to increase transparency and accountability and positively enhance our social economic systems. TECHNICAL PUBLICATIONS® - an up-thrust for ‘knowledge . It can have numerous connected nodes, but remain totally separate and unique from other blockchains, Institutions and banks can build internal blockchains with their own features for various organizational purposes. internet, A blockchain is similar to thi: Fig. 1.5.1 shows blockchain structure. Block header Block 1 Block 2 Block 3 Fig. 1.5.1 Blockchain structure The longest chain is the chain of blocks that took the most effort to build. In short, to add a new block to the blockchain you need to use processing power, which means that every block on the blockchain uses up energy to get there. Each transaction in a blockchain is timestamped and captured in datasets known as blocks. It is then sequentially added to the chain, with each block header bearing the hash of the previous block header to form the ledger. Therefore, a blockchain consists of a chain of blocks that forms an immutable public digital ledger. It works like a virtual book that contains all the transactions conducted by a blockchain’s exchange parties, mainly individuals and businesses, Each block bears a header and a transaction list. The header holds all metadata about a particular block, including the previous block hash that points to an earlier block, also known as the parent block. In this fashion, each block points to its parent block and the chain can be traced down tothe first block, also known as the genesis block. This linking and pointing back into the past leads to a chain-like structure of blocks, termed a blockchain. TEAUMIAAL RiiDtinaTiANe® a oy ; HRLOSurTENeY and Biockchain Technologies _1- 18 Introduction to Blockchain ER Permissioned Model of Blockchain > Advantages : lL v Permis joned blockchains are blockchain networks that require access to be part of. In these Dlockchain types, a control layer nuns on top of the blockchain that governs the actions Performed by the allowed participants. Ina penis ned blockchain network, one needs permission to become part of the network, The owner of the network dictates who can or cannot join the network, In simple terms, the distributed ledger in this can only be aecessed by a few people who have been allowed to do so by the administrator, These users are provided different types of Privileges which allows them to do certain actions. However, it must be noted that anyone who is not allowed by the administrator, will not be allowed to access it publically. The major benefit of this model is that since the people accessing the ledger are limited. any kind of changes made in the ledger can be easily tracked and the user can be identified. There are many popular permissioned blockchain frameworks out there, It includes Hyperledger, Quorum, Corda and othe Permissioned blockchain will be mainly used in business operations or where data securit the highest priority. It can be used in supply chains, creating contracts and verifying payments. It is a decentralized model, the companies can easily participate without having to deal with the risk of centralized models. Privacy is the focal point of permissioned blockchain and strong privacy is what the users have to work with while accessing the transaction detail It can be easily customized with various configurations and as per the needs. . Since the access is limited, few modes handle the transactions which increase the performance and scalability. > Disadvantages : it v Since it has limited or few participants, it ha data, more chances of collusion and corruption of Getting a consensus in this model is not easy as rules of consensus can be changed by the operator at any time. Since the participants are limited, there is less transparency to outs ide oversight, TECHNICAL PUBLICATIONSS - an up-thrust for knowlsdge cryplocurrency and Blockchein Technologies 4-49 . Introduction to Blockchain [id Cryptographic - Hash Function ¢ Cryptographic hash functions are al gorithms that take and generate a fixed-size result data input (often called the 'message’) electronic data in the message, Hash functions are often used to determine whe algorithms and processes that provide a security se of the algorithm or process, including : ther or not data has changed. Many vice use a hash function as a component Keyed-Hash Message Authentication Code (HMAC) 2. Digital signatures 3. Key Derivation Functions (KDEs) 4. Random Number Generators (RNGs) Hashes are often used to speedup insertion, deletion and querying of databases. ¢ A hash function is a fianction (h) which has, as a minimum, the following two properties : 1 Compression : h maps an input x of arbitrary finite bit length, to an output h(x) of fixed bit length n. 2, Ease of computation : Given h and an input x, h(x)is easy to compute. A hash function maps a variable-length input into a fixed-length output. This hash function Output can be treated as a fingerprint of the input data. A very simple example of hash function is modulo operation. Hash functions have been used in many fields of computer science such as hash table in data structure, checksum algorithms for error detection, digital signature in information security ete. The most common cryptographic uses of hash functions are with digital signatures and for data integrity. * When hash functions are used to detect whether the message input has been altered, they are called Modification Detection Codes (MDC). * There is another category of hash functions that involve a secret key and provide data origin authentication, as well as data integrity; these are called Message Authentication Codes (MACS). * A hash value h is generated by a function H of the form. h = HM) jhere, M = Variable - length message H(M) = Fixed - length hash value. TECHNICAL PUBLICATIONS® - an up-thrust for knowledge Cryptocurency and Blockchain Technologies _1- 20 Introduction to Blockeh Hash code is also referred to as a message digest or hash value. A change to any bit or bits message results in a change to the hash code, «Fig, 1.7.1 shows cryptography hash function Message M (arbitrary length) Hash function Fig. 1.7.1 cryptography hash function The hash function involves repeated use of a compression function. The motivation is that if the compression function is collision resistant, then the hash function is also collisi resistant function. So a secure hash function can be produced. Bitcoin's blockchain uses SHA-256. (Secure Hash Algorithm) hashing algorithm. The Bitcoin network depends on a set of rules called the proof of work consensus algorithm. ensus algorithm is a set of rules that governs a blockchain network, Outside cryptocurrencies, the most common usage of hash functions is in the storage of password cons means if someone wanted to change the ledger or double-spend a transaction, he or would have to change the hash in all previous blocks. In order for the bundled block to be added to the blockchain, miners ‘need to find a hash th meets the target difficulty. Each block contains a blockheader with the number of the blook the hash of the previous block and a “nonce”, which includes a timestamp. The purpose of nonce is varying the input to a cryptographic hash function, that is increased randomness computation during the mining process. wcy and Bi zt Introduction to Blockchain ¢ Hash functions constitute the bs Mackbone of the proof of work process. Without confirmation and production of hash tran a j Sactions, the blockchain would not be tamper-proof and alterable and it wo > . in Would not be possible to prove who owned which amount of Bitcoin at what time. KA Properties of Hash Function 1 can be applied to a block of data of any size. H produces a fixed length output, * Nia) is relatively easy to compute for any given x, making both hardware and software implementations practical. 4. For any given value h, it is computationally infeasible to find x such that H(x) = h. This is called one-way property, For any given block This it is computationally infeasible to find y # x such that H(y) = H(x). s called weak collision resistance. 6. It is computationally infeasible to find any pair (x, y) such that H(x) = H(y). This is called strong collision resistance. &i One - way Hash Function * A one-way hash function is also known as a message digest, fingerprint or compression function. It is a mathematical function and takes a variable-length input string and converts it into a fixed-length binary sequence. * One-way hash function is designed in such a way that it is hard to reverse the process. * A good hash function also makes it hard to find two strings that would produce the same hash value. All modern hash algorithms produce hash values of 128 bits and higher. + Even a slight change in an input string should cause the hash value to change drastically. Even if | bit is flipped in the input string, at least half of the bits in the hash value will flip as a result. This is called an avalanche effect. A common way for one-way hash functions to deal with the variable length input problem is called a compression function. * Compression functions work by viewing the data being hashed as a sequence of n fixed- length blocks. * To compute the hash value of a given block, the algorithm needs two things : The data in the block and an input seed. Introduction to Blockchain Cryptocurrency and Blockchain Technologies 1-22 ‘is set to some constant value (c), and the algorithm compuict the hash value he first block, h, is used as the seed for the # The input see lue of t hy, of the first block. Next, the hash vah second block. © The function proceeds to compute # the second block and the hash value of the first block, h,. So, the hash value for block n is related to the data in block n an 1¢ of the last block. the hash value of the second block based on the data in \d the hash value h,., (for n> 1). The hash value of the entire input stream is the hash valuc [EZEI Application and Purpose of Symmetric Encryption gle key to encrypt and decryp: ¢ Symmetric cryptography relies on algorithms that use @ sin: the message. Then, information. In other words, the sender uses a secret key to encrypt recipients use the same key to decrypt and read the data, «Symmetric encryption, which is used often for bulk encryption/encrypting ma quickly than asymmetr sive number of data, such as database encryption, operates more smoothly and encryption. This is due to the fact that its algorithm is more straightforward. The database is the only 1. Financial transactions and other payment applications, where the protection of sensitive 2. Validations are used to check the identity of the sender, which ensures that onl authentic messages are sent. g 3. Random number creation and hashing are also used. Purpose of Asymmetric Encryption publicly shared, * The second one is the private key. Its job is to dec securely stored and should not be transferred at Public one is theoreticail il ly possible but practi © The verifi nha : typt the data. The private key should all. Calculating the private key based on| messa ter programmer or digit COI ge, compul eI digital record, 7 u181n Technol logies 1-23 Introduction to Blockchain + This can be done by tracin g the signature its poi igi eR ah or sealed seal have boos i back to its point of origin. A handwritten signature ae ‘aced in contemporary times by something called a digital The use of digital signat i lures, which are b; i ; the signer’s knowledge, on eee ee may authenticate the origin, document, transaction or commny ‘ nication, This i : isi igner' inowlédge. This is accomplished by recognising the signer’s identity and status of an electronic When utilising encrypted email, a file is first enci using a private key before being transmitted, Th which a significant Portion of the u: decrypt data. rypted with a public key and then decoded ese are just a few examples of situations in ser population could have the ability to encrypt and Asymmetric encryption is used by the SSL/TLS cryptographic protocols in order to protect data that is sent between servers and browsers, The essential ingredients of asymmetric cipher are as follows : L Plaintext : Itis input to an algorithm and in 4 readable message or data. 2. Encryption algorithm : It performs various transformations on the plaintext, 3. Public and private keys : One key is used for encryption and other is used for decryption. Ciphertext : This is the scrambled message produced as output. It depends on the plaintext and the key. i 5. Decryption algorithm : This algorithm accepts the ciphertext and the matching key and produces the original plaintext. Public and Private Keys A private key is a randomly generated number that is kept secret and held privately by its users. Private keys need to be protected and no unauthorized access should be granted.to that key. Private keys can be of various lengths depending on the type and class of algorithms used. For example, in RSA, typically a key of 1024-bits or 2048-bits is used, The 1024-bit key size is no longer considered secure and at least a 2048-bit key size is recommended. A public key is freely available and published by the private key owner. Anyone who would then like to send the publisher of the public key an encrypted message can do so by encrypting the message using the published public key and sending it to the holder of the private key. TECHNICAL PUBLICATIONS® - an up-thrust for knowledge plogien 1-24 -- Cryprocurency and Blockehain Technolog) the corresponding pri No ele is able to decrypt the message becau No one else is able sceurely by the intended recipient received, the recipient can decrypt the message} © Once the public key encrypted message is using the private key hy Difference botwoon Asymmotric and Symmetric Key Cryptography ; tography Sr. Symmotric key cryptography Asymmetric key cryptog) No. One key for encryption and other key for ne hey is used for eneryption and decryption. decryption, 2. Very fast Slower. Z e j Key exchange roblem. Key exchange is big problem. Key exchange is not a prob 4. Also called secret encryption ‘Also called public key encryption. One of the two keys must be kept secret. The key must he kept secret. 6. The sender and receiver must share the The sender and receiver must each have one of algorithm and the key. the matched pair of keys. Size of the resulting encrypted text is usually same as or Jess than the original clear text size. 8. Cannot be used for digital signatures, Can be used for ee 14 Elliptic Curve Cryptography Elliptic Curve Cryptography (ECC) is based on 4pon elliptic curves over finite fields (G types of public key the discrete logarithm problem fo alois fields). The main benefit of ECC over ot algorithms is that it requires level of security as, for example, RSA, a smaller key size while Providing the sa arithmetic, each of which gives dif 'ypes of arithmetic ar; 1. Zparithmeti, mene are; 2. GF (2') arithmetic, which can be done with shins and © s, * 40 Up-thrust for. knowledge — Foatures of SHA-1 : 1. The SHA-1 is used to compute a message digest for a message or data file that is provided as input. 2. The message or data file should be considered to be a bit string. The length of the message is the number of bits in the message (the empty message has j length 0). 1 ent the 4. Ifthe number of bits in a message is a multiple of 8, for compactness we can repres: message in hex. The purpose of message padding is to make the total length of a padded message a) multiple of 512. 2 6. The SHA-1 sequentially processes blocks of 512 bits when computing the message digest, 7. The 64-bit integer is 1, the length of the original message. 8. The padded message is then processed by the SHA-1 as a 512-bit block. © If the website uses the SHA-1 cryptographic hash function, it means our password is tumed into a checksum after we enter it in. That checksum is then compared with the checksum that is stored on the website that relates to our current password, whether we have not changed ij our password since we signed up or if we just changed it moments ago. If the two match, we are granted access; if they do not, we are told the password is incorrect. 4 © Another example where this hash function may be used is for file verification. So websites will provide the checksumi of the file‘on the download: page so that when the same as the one we intended to download. > SHA-512: record verification. SHA-512 is also used in blockchain technology, with the most notable example being the BitShares network. Fig. 1.7.2 shows working of SHA-512. . The function operates on 1024-bit blocks and Tetums a 512-bit hash value, commun Tepresented as 128 hexadecimal digits. SHA-512 Processes data in 1024-bit blocks a involves several computational steps Preprocessing, initialization, processing | finalization. TECHNICAL PUBLICATIONS® . an up-thrust for, ‘knowledge Introduction to Blockchain 1-27 $09 PZOL Sud CES: — [ NOBOIB | coptocurrency and Blockchain Technologies Hq p20} * N so} “uoqezieniuy Fig, 1.7.2 SHA-512 Working to Blockchatny Introduction Cryptocurency and Blockchain Technolosios_1 26 ae its length is a multiple 0 ci ig padded to ensure its length is 5 ot ‘ions, logical functions and modula ies of bitwise ope i 1024-bit message block. + In preproc stage involves a St ich are carried out in 80 rounds for each s nonlinear character input produces su ‘ed with the old hash value. processing arithmetic, which art ty of SHA-S12 is rooted in © The secu property Which ensures that a small change in th output that the new hash value appears uncorrelat EE Merkte T t eat + the purposes of datall * The Merkle tree is a kind of data synchronization and verification. It is also Juded inside it as childr structure that is used fo! widely referred to as the hash tree. en is stored in each non-leaf node of © A hash of the nodes that are incl depth and are positioned as far ig the tree data structure. All of the leaf nodes are of the sam y using hash functions, which allows it the left as they possibly may be. It achieves this b: maintain the integrity of the data. ; 2P) networks because of the need to ha © Merkle trees are often used with peer-to-peer (P: designed to ensure blocks information shared and independently validated. Merkle tree is gers in a peer to peer network, In most cases, a Merkle data can receive from other p comprises of two child nodes under each node on the network. © Merkle trees store transaction data efficiently in blockchains. The root has! reducing blockchain size. Merkle proofs verify data efficiently. They are space a h is commit computationally efficient, good for scalability and decentralization. © We know that blockchain has blocks linked to each other logically. Each block would thousands of transaction details Therefore, it would be a complex task to store all of them: a series which is also very time inefficient. In such a series of data, it becomes reall cumbersome to frid out a particular transaction. This is where the Merkle tree comes into t action. Using a Merkle tree, we can easily identify if that particular transaction belongs block or not. 4 . oc bernare 4 ey ae pairs of nodes until there is only one hash lef merkle hash. Merkle tree is constructed from bottom up from hashes of individual transactions, © Merkel root : The culmination of all hashes in the Merkle tree is a Merkl The rkle root. The fit hash, known as the Merkle root, i , is created by i Merkle tree. y adding the hashes of every transaction if TE( ‘CANICAL PUBLICATIONS® «an uaanorye rency and Bloc Tochnor Technologie: ; nologies 1-29 complete and nda - _ —ntreduation to Blockchain omaged, NM _ juction to Blockchain zed. Merkle + cryptocurtencies, H¢ OOK 8 req wever Wired for the computation to maintai 5 a intain there ca Merkle root is allowe can be syn d per block + Fig. 18.1 and Fig, 1.8.9 ichroni. tion in historical data and only one shows Me; Shows Merkle tree and Us working i=) Hash 374 Hash T4172 Hash fash of T1 Hash of 12 Hash of T3 Hash of T4 T Transaction Transaction Transaction T2- 13 14 Fig. 1.8.1 Merkle tree Transaction 1 HO) RG) f t ¥ [ap ag | [ap AQ HO) AG) BO) HG) \ i \ (data)| | (data)| (data)| || | (datay) ||} (data) oo] Gata)| | (¢ata) Fig. 1.8.2 Working of Merkle tree *® Merkle root is the hash of all the hashes of all the transactions in the block. The Merkle root is a part of the block header. With this scheme, it is possible to securely verify that a transaction has been accepted by the network by downloading just the small block headers TECHNICAL PUBLICATIONS® - an up-thrust for knowledge

You might also like