An introduction to Blockchain – JAXenter

[ad_2][ad_1]

The following is an excerpt from the book, Blockchain through Oracle of Robert van Mölken and published by Packt. Blockchain across Oracle offers you the professional orientation for Blockchain you need as an Oracle developer in today's changing world.

This article serves as an introduction to the blockchain. In this article, I will explain that what is blockchain technology at a more architectural level. When you ask 10 people what they think the term blockchain it means that you may not be surprised to get 10 different and contrasting answers, as the use of the term blockchain can be a little confusing. Many people link it to bitcoins or other virtual (cryptographic) currencies. Some speak of the Ethereum application platform, some of the smart contracts (executable code), but most of the time the blockchain is explained as a distributed and shared ledger.

In essence, a blockchain is a system of keeping digitally distributed books in a way that allows individuals who do not fully trust one another to agree on updates of the shared ledger. Blockchains use peer-to-peer protocols rather than a central authority or third party to deploy and verify transactions between entities. There is no single point of error, so entities can appear, disappear or function badly without affecting the group.

What is a blockchain?

When we talk about blockchain, we always refer to it as a distributed ledger technology (DLT) that has formed the underlying and open source technology behind bitcoin. A blockchain is a digital system of recording the transactions of resources in a list that is replicated among the nodes available in a network, rather than being stored in a central data store, as in the case of traditional databases.

In a ledger distributed as a blockchain, data is distributed to all nodes reliably (ie without a trusted third party such as VISA, MasterCard or your bank) using a peer-to-peer protocol in near real-time. Each node processes and monitors each transaction in a redundant way, groups the transactions verified in a block and transmits them to all the other nodes of the network. Through a consent mechanism, the blocking of transactions is validated by other nodes where the majority must approve the block before it becomes definitive and is added to the blockchain.

The blockchain uses a combination of digital signatures and cryptography to prove your identity and authenticity and to impose read / write and execute permissions (access rights). This allows you to allow write access for certain participants and read access to other participants or even to a wider audience; that is, everyone. If you compare a blockchain with a traditional database freely, a blockchain is a system that contains an ordinary database and some additional software that validates submitted records that conform to previously agreed rules before adding new records to the database. This additional software listens and transmits new records to all nodes, or Colleagues, participating in the network, ensuring that each peer has the same data in its database.

The following diagram is an overview of the features that make up the blockchain technology:

blockchain

The main technologies used by the blockchain are divided into five groups, each of which represents a different level in architecture.

Technically, a blockchain is a new method of storing data. In reality it is just a file with a predefined data structure (that is, how the data are put together logically). Can be compared to other data structures, such as relational databases (tables, columns and rows), XML files, values ​​separated by commas (csv), Excel database files and binary files (images and videos). An analogy I often use is that the blocks in a chain are the same as the pages of a book. Each page in a book like the following has a bunch of text structured in paragraphs, is information about his context (also called metadata), such as article number, article title and page number.

SEE ALSO: Takechain of Blockchain technology: 3 triggers for blockchain adoption [UPDATE]

Similarly, in a blockchain, each block consists of a collection of content, such as a list of transactions and a header, which contains technical information about the block, a reference to the previous block and a digital signature. (hash) of the data block contained in the block. A blockchain, in which the blocks are connected to one another to form a chain, is analogous to the pages of a book. The pages use sequential numbering that facilitates the knowledge of their order. If the pages were to be pulled out of the book and thrown into a pile, it would be easy to put them back in order. A blockchain, however, is smarter.

The following diagram shows that each block connects to the previous block via the block's fingerprint. The fingerprint is determined by the content of the individual block and the fingerprint of the previous block:

blockchain

Each block in the chain refers to its previous block, like page numbers in a book.

SEE ALSO: Glossary blockchain: lesson n. 1 – Blockchain ≠ distributed ledger technology

In a book, the ordering of pages is implicitly constructed on a page whose number is one less; that is, page 13 follows page 12 (13 – 1), while the blocks are represented by fingerprints or hashes that are built on each other. For example, block 3 with the 8ec6cc0 hash is determined by performing the hashing of the data along with the hash 9a59c5f of the previous block. Using a fingerprint determined based on the previous one, can be used to validate the internal consistency of the data. This scenario is shown in the following screenshot:

blockchain

Two blocks are connected to each other through fingerprints with hashes. The fingerprint of the block n. 2 is based on data and fingerprint of block n.

You can check whether the data is consistent within a block generating the fingerprint and comparing it with the one that is part of the block header. If someone wants to change the information stored in one of the previous blocks, he needs to regenerate all the fingerprints from that point to the end of the chain. However, it will appear that the blockchain is altered and immediately visible to others.

Depending on the consensus method used, the creation of these fingerprints can be a very difficult and slow process, which makes it very problematic to rewrite the blockchain. Furthermore, the number of blocks already present in the blockchain can be enormous, for example for bitcoins (06.03.2018: 512253 blocks with a size of 156 GB). The following screen shows that when data is changed, the hash is also changed and the block is no longer valid:

blockchain

Data in block n. 2 are modified and generate a different fingerprint than before.

SEE ALSO: Blockchain should be used to increase certain business processes, * not * to replace them

How does a blockchain work?

The technology (ie architecture, mechanisms, security and so on) behind the blockchain can be seen both as the backbone for future accounting and as an engine for a modern message transport system. So, how does a blockchain actually work during runtime?

The following diagram shows how blockchain systems must follow a specific flow of actions in order to consistently maintain a distributed record of facts (a key-value database with the current state of resources) and a separate history of updates (transaction log) distributed). Transactions submitted are archived and verified without the involvement of a central government authority that uses advanced mathematics and computer science, ie cryptographic hash functions. The blockchain not only protects these transactions but also protects their integrity (and anonymity).

blockchain

The flow that a transaction follows from being sent to be verified by most of the network.

Now let's take a closer look at the previous figure that describes the flow of transactions in a blockchain. When you want to exchange data with someone else on the blockchain, you do so by submitting a transaction where you propose your changes. A Transaction usually contains the context (action) in which it should be performed and any resources that can be described in digital form, such as currency, contracts, incidents and medical records. The data structure of proposed changes to a resource can be either structured or unstructured, but is often represented as JSON (JavaScript object notation), which is a readable text format for data objects.

A typical blockchain provides the client APIs with the transaction, but generally uses a web application that calls the API with which the transaction will be sent to one of the active nodes (peers) in the network. . Depending on the capabilities of the network, the transaction can be validated locally or directly transmission to all active nodes in the network using the peer to peer (P2P) Network. When validated locally, the transaction is transmitted only after validation based on a set of network rules. Each node that receives the transaction, depending on the network rules, will immediately check it or write it to a secure record and place it in a pending transaction queue. In this case, the nodes; that is, the participating computers or servers in the network, to verify if the transaction is valid based on a set of rules to which the network has agreed. For example, the transaction can activate participant nodes to execute business logic (such as an intelligent contract) and follow the consent protocol to verify the results.

SEE ALSO: "Because blockchain is really successful, we must understand where and why to distribute it"

Some consent protocols require payment of a transaction fee to verify the transaction. The amount you pay is part of your transaction and determines the time needed to be verified. Some blocking nodes only verify transactions with a higher reward. Depending on the rules defined by the network protocol, the validation nodes combine transactions in a block and digitally fingerprint the result so that they can be validated by other nodes in the network. Just like transactions, the blocks are transmitted to all active nodes via the peer-to-peer network.

When consent is reached, depending on network rules, the participant nodes execute the transaction batches and store the results as an immutable cryptographically protected data block or take the approved block and add it to the ledger. Consent protocols can include a reward system for nodes that create a block or require you to pay a transaction fee to distribute the currency to the legitimate recipient.

By following the consent mechanisms and network rules, several blocks may be necessary until you are sure that the transaction is verified and not part of an orphaned chain. It is possible for multiple peers to create a block at the same time or just a few seconds from each other. This can produce a fork in the chain. Both blocks are initially accepted by most of the network, creating two chains. For each transaction block, however, there is only one way for the genesis block (that is, initially created in the chain) and the blocks that are part of the smaller chain are eventually rejected.

In the following diagram, you can see that the longest chain survives and that the smaller chains are rejected:

blockchain

The genesis block is shown in green. The main chain is shown in black and the orphan / rejected chain appears in red.

Those transactions that are part of the rejected blocks are added to the queued transaction pool and will eventually be included in another block. With blockchains using an incentive model, the reward someone receives to solve an orphan block is virtually lost.

SEE ALSO: "If you make the right choices, blockchain will help you, otherwise it will become a nightmare to manage"

Summary

This article served as an introduction to the technology behind the blockchain. The article began by explaining that a blockchain is a digital system of recording the transactions of resources in a list that is replicated among the nodes available in the network. A block in the chain is somewhat similar to the pages of a book.

The article continued by answering the question of how a blockchain works and described the flow of data in a blockchain once a transaction was presented, from the transmission of transactions to all other nodes using a peer-to-peer network. peer to the verification phases in the consent protocol. I have examined each step in the data flow, its purpose and the changes that occur to the data.

You just read an excerpt from the book, Blockchain through Oracle from Oracle Developer Champion Robert van Mölken and published by Packt. This book helps you learn about the details of the Blockchain: key concepts, how to implement Oracles Blockchain Cloud Service, the industrial implications for Blockchain and how the blockchain will affect your Oracle customers.

[ad_2]Source link