Introduction to Blockchain Technology. Tiana Laurence. Читать онлайн. Newlib. NEWLIB.NET

Автор: Tiana Laurence
Издательство: Ingram
Серия:
Жанр произведения: Учебная литература
Год издания: 0
isbn: 9789401805049
Скачать книгу
and contain a hash of the previous block. All of this data adds up and takes up a lot of room. The Bitcoin blockchain is hundreds of gigabytes in size and growing every day.

      However, there is a way to connect to a blockchain, without committing as many resources to the network. This is called a lightweight node or client. Lightweight nodes verify transactions by piggybacking on the work of full nodes. They only download the headers of all blocks and then check transactions utilizing a system called Simplified Payment Verification (SPV). As you may remember, the block headers contain hashes that prove that each block is in order and has all its transactions.

      Operating a lightweight node may seem appealing. However, they are vulnerable to being tricked by bad actors. Because the SVP method is only checking the blockchain header, the lightweight node may accept transactions or blocks that are not valid. If you think you have received some bitcoin for example, but in reality you have not, this could cause financial issues. Full nodes provide the highest protection from fraud related to the transfer of cryptocurrency.

      Another common way to connect to a blockchain network is to mine. A miner is a type of node that is adding transactions to new blocks. Miners compete to win the right to create a new complete block by solving a complex mathematical problem. Each miner will write their answer in the block header and if they are correct, they are then rewarded with cryptocurrency. The problem that miners are trying to solve is to guess a number that, when combined with the hashed transaction data from the block, returns an answer that is within a specific range called a “nonce”. For Bitcoin, a nonce is a number between 0 and 4,294,967,296.

      The first miner to get a hash within the desired range broadcasts the winning number to the rest of the network. All the other miners promptly stop their work on that block and start guessing the nonce for the next block. At that point the competition for the next new block begins.

      Miners opt into the ruleset by accepting the software upgrades. The network has available upgrades that users elect to adopt by updating their software. You can think of the upgrades as software patches. The upgrades are only as good as the acceptance and use by the miners.

      There are three critical distinctions in blockchain nodes that are worth understanding as these affect the assumptions that are made around fairness, censorship, and permanence of data.

       Public blockchain nodes

      Public blockchains are open to anyone in the world to participate in the functions of the network, only limited by their access to the internet, hardware, and electricity. This means that you can be a miner earning cryptocurrency as your secure blocks, a full node checking transactions, or a lightweight node sending and receiving messages on the network. There are no gating mechanisms, no one to ask permission and no licensing fee. The software is held in an open license such as the Apache or MIT license. Prominent examples of this type of network include Bitcoin and Ethereum.

       Permissioned blockchain nodes

      Permissioned blockchains are private networks that utilize some blockchain technology but not all. Most don’t incorporate any kind of mining and so do not have a native cryptocurrency. This means that there are no disinterested third parties securing blocks, the blocks and transactions are all processed by known participants. The participants all have a vested interest in the integrity of the records. Often these networks are built by for-profit companies and are operated by consortiums such as R3.

       Nodes on a Corda network

      R3 (www.r3cev.com) built a consortium with more than 100 of the world’s leading banks and insurance companies. They work to streamline redundant business processes by integrating blockchain technology.

      Corda is the blockchain protocol behind R3. It is a distributed ledger platform, often referred to as “DLT” (distributed ledger technology). Breaking down the jargon, a “ledger” is a general term for describing records used to account for something and “distributed” means that the record is kept in more than one location. It is designed specifically to manage and synchronize financial agreements between regulated financial institutions.

      The R3 platform works very differently from public blockchains. There is no mining, and the transmission of data is not public in the same sense as it is on platforms such as Ethereum or Bitcoin. Unlike public blockchains that broadcast their transactions to the whole network, transactions execute in parallel on different nodes. Each node is unaware of the other’s transactions. The history of each network is on a need-to-know basis and cannot be viewed by the public.

      Key features of Corda include the following:

      ■ Controlled access to the network;

      ■ Observer node for regulators;

      ■ Transactions are validated only by the parties involved;

      ■ Compatible with multiple consensus mechanisms;

      ■ No mining and no cryptocurrency.

       Nodes on a Hyperledger Fabric network

      Nodes on Hyperledger Fabric (see also: https://www.hyperledger.org/projects/fabric) are called Peers and Orderers. Unlike public blockchains that have nodes validating transactions or mining, the nodes on Fabric host the ledger’s data and make sure it’s in order. The data they host may include smart contracts, orderers, policies, channels, applications, organizations, identities, and membership. Another important distinction is that a Fabric peer can host more than one blockchain ledger. This feature allows for flexible architecture in the design of your private blockchain system.

      Blockchain applications connect with peers on Fabric through APIs, application programming interfaces. The APIs allow you to invoke Fabric smart contracts in order to create transactions. Once you have submitted your transaction, they will be ordered and committed to Fabric. This does not just happen right away. The transaction must get approval from enough peers before the ledger is changed. It is possible to have two or more peers agree to cooperate privately. In Fabric this is called a channel. In the channel, the peers agree to collaborate to share and manage identical copies of the ledger associated with their channel.

      Otherwise, when you submit a transaction, there is a three-phase process. This process ensures all peers keep their ledgers consistent with each other, see figure 5. This is where orderer peers are important. Their job is to ensure that every peer’s ledger is kept consistent. Single peers cannot update the ledger by themselves.

      ■ Phase 1: an update to the ledger is requested by a blockchain application. Peers will endorse the transaction. Once a transaction has gained enough endorsements, the transaction will move to phase 2.

      ■ Phase 2: the endorsed transactions are collected together and packaged into blocks. The orderer is crucial to this process. Peer audit by an orderer ensures this is done correctly.

      Figure 5 The Fabric three-phase process.

      ■ Phase 3: the new block that was created is broadcast back to every peer so that they can update their blockchain record. Each transaction in the new block is then validated by the peer before being applied to its copy of the ledger.

       Federated blockchain nodes

      Federated blockchain nodes can exist in both public blockchains and private blockchains. Federation is when the system, or rather the user of a system, elect nodes to process transactions. Designating a few nodes to do most of the work of maintaining the blockchain records has its advantages and disadvantages.

      One of the main reasons why systems choose this type of architecture is because it can reduce the raw cost of processing transactions