The Blockchain.
Image: https://www.visiott.com/blog/blockchain-traceability/

The Blockchain.

Instead of putting the taxi driver out of a job, blockchain puts Uber out of a job and lets the taxi drivers work with the customer directly."?- Vitalik Buterin.

What Is a Blockchain?

A blockchain is a decentralized, peer-to-peer (P2P) type of distributed ledger technology (DLT) that consists of a growing list of records, called blocks, that are securely linked together using cryptography, where nodes collectively adhere to a consensus algorithm protocol to add and validate new transaction blocks.

No alt text provided for this image

Blockchain was created by a person (or group of people) using the pseudonym Satoshi Nakamoto in 2008, to serve as the public distributed ledger for bitcoin cryptocurrency transactions, based on previous work by Stuart Haber, W. Scott Stornetta, and Dave Bayer.

No alt text provided for this image

What is Block in Blockchain?

A block is a container data structure that aggregates transactions to be added to the public ledger, the blockchain. The block is made of a header, containing metadata, followed by a long list of transactions that make up the majority of the block's size.

No alt text provided for this image

Each block header contains the previous block hash, current block hash, nonce, and the Merkle root. The Merkle root is the root hash of a Merkle tree, which is stored in the block body.

No alt text provided for this image

The Genesis Block

The first block in the blockchain is called the genesis block. It is the common ancestor of all the blocks in the blockchain, meaning that if you start at any block and follow the chain backward in time, you will eventually arrive at the genesis block.

Every node always “knows” the genesis block’s hash and structure, the fixed time it was created, and even the single transaction within. Thus, every node has the starting point for the blockchain, a secure “root” from which to build a trusted blockchain.

Example: Using the Bitcoin Core reference client on the command line:

$ bitcoind getblock 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f        


{
?? ?"hash" : "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
?? ?"confirmations" : 308321,
?? ?"size" : 285,
?? ?"height" : 0,
?? ?"version" : 1,
?? ?"merkleroot" : "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
?? ?"tx" : [
?????? ?"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"
?? ?],
?? ?"time" : 1231006505,
?? ?"nonce" : 2083236893,
?? ?"bits" : "1d00ffff",
?? ?"difficulty" : 1.00000000,
?? ?"nextblockhash" : "00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048"
}        

What are Hash Functions?

A hash function is a mathematical function that converts an input string of any length into an output string of a fixed length. The fixed-length output is known as the hash value. It is a one-way function, meaning that it is almost impossible to invert or reverse the computation for this function.

No alt text provided for this image

To be cryptographically secure and useful, a hash function should have the following properties:

  • Avalanche Effect,
  • Deterministic,
  • Puzzle-Friendly,
  • Large Output Space,
  • Second Preimage Resistance,
  • Collision Resistance, and
  • Fixed-Length Mapping.

How do Hash Functions work?

The hash function receives variable-length inputs and produces fixed-length outputs. Transactions are used as inputs in cryptographic hash functions, and the hash method produces an output with a fixed size.

No alt text provided for this image

Types of Cryptographic Hash Functions

There are several different classes of hash functions. Some of the popular classes are:

  1. RACE Integrity Primitives Evaluation Message Digest (RIPEMD): This set includes RIPEMD, RIPEMD-128, RIPEMD-160, RIPEMD-256, RIPEMD-320.
  2. Message-Digest Algorithm: This family comprises hash functions MD2, MD4, MD5, and MD6.
  3. Secure Hashing Algorithm:?The family of SHA comprises four SHA algorithms: SHA-0, SHA-1, SHA-2, and SHA-3.

as well as BLAKE2, BLAKE3, Whirlpool, and many others.

Distributed Peer-to-Peer (P2P) Networks

P2P is based on a very simple principle, and that is the concept of decentralization.

In a peer-to-peer (P2P) network, two peers, also known as nodes, can communicate with one another without the need for a centralized server. The underlying blockchain technology leverages the power of P2P networks and provides a shared and trusted ledger of transactions.

No alt text provided for this image

As a distributed ledger technology, blockchain records transactions as an immutable timestamped digital block that indicates senders and receivers. No centralized authority manages the blockchain networks and only the participants can validate transactions among each other.

The technology allows people and institutions to trust the output without trusting the participants. This new form of distributed data storage and management acts as a digital ledger that publicly records all transactions and activities.

Blockchain mining

The term "Blockchain mining" is used to describe the process of adding transaction records to the blockchain. There are different consensus mechanisms used to verify transactions and add new blocks to a blockchain.

No alt text provided for this image

Here's an example of how a bitcoin transaction would take place:

Say User A wants to send 1 bitcoin (BTC) to User B.

When User A initiates a transaction, information about the sender and receiver is packaged and timestamped on a block and sent to a queue called a mempool (short for memory pool) where it will wait to be validated and added to the blockchain.

Miners that have successfully discovered blocks will take batches of transactions and verify that all of the information, including digital signatures, messages, and public keys, are legitimate.

Once the information is verified, the block is broadcasted to all the nodes in the network, who must check and agree that the block is valid before adding that block to the official chain. The average time it takes to confirm a Bitcoin transaction is about 10 minutes.

When the process is complete, User B will have received 1 BTC sent to them by User A, all nodes on the network will have agreed to the transaction using the chosen consensus model, and a bitcoin miner will have earned a reward for verifying a successful transaction. New blocks of information about that transaction are now linked to each other as part of an infinite and public chain.

No alt text provided for this image

Consensus Mechanism

A collection of peers, or nodes, in a network determines which blockchain transactions are valid and which are not through a consensus mechanism. These sets of guidelines aid in protecting networks from malicious behavior and hacking attacks.

The following are a few of the most well-known kinds of consensus mechanisms utilized by distributed systems to obtain consensus:

No alt text provided for this image

  1. Proof of Work (PoW): In PoW, miners essentially compete against one another to solve extremely complex computational puzzles using high-powered computers. The first to come up with the 64-digit hexadecimal number (‘hash’) earns the right to form the new block and confirm the transactions.?Additionally, the successful miner receives a "block reward," which is a fixed amount of cryptocurrency.?
  2. Proof of Stake (PoS):?In a proof of stake (PoS) system, miners are required to pledge a ‘stake’ of digital currency for a chance to be randomly chosen as a validator.
  3. Proof of Authority (PoA): In PoA, validators don’t stake coins. Instead, they must put their reputations on the line for the right to validate blocks.
  4. Proof of Burn (PoB): In PoB, miners gain the power to mine a block by ‘burning’ (destroying) a predetermined amount of tokens in a verifiable manner.
  5. Proof of Space (PoS): bases its mining algorithm on the amount of space available in a miner’s hard drive.
  6. Proof of Elapsed Time (PoET): Usually used on permissioned blockchain networks (those that require participants to identify themselves), proof of elapsed time (PoET) leverages trusted computing to enforce random waiting times for block construction.

Characteristics of Blockchain

No alt text provided for this image

  1. SECURITY: Blockchains have two primary security mechanisms: network structure and cryptography. In blockchain technology, cryptography is used extensively to sign data in order to prove that a transaction was approved by the owner of the funds. The decentralized structure of the network eliminates any central points of failure. To compromise an open blockchain network, a hacker would have to control a majority of the nodes at the same time. This makes a network attack very expensive and impractical.
  2. TRANSPARENCY: All transactions on a public blockchain, are viewable to anyone with an internet connection. Each transaction is assigned its own unique ID known as a transaction hash. These identifiers can be used to look up a public record of the transaction, also known as a transaction receipt. The addresses involved, the amount transferred, a timestamp, transfer fees, and other information are all included in a transaction receipt. All transaction records are accessible from any computer connected to the network, guaranteeing a high level of transparency. Many organizations, especially nonprofits, can use blockchains to establish confidence in their financial practices because of the transparency they give.
  3. IMMUTABILITY: The information stored on the blockchain cannot be altered or deleted after a block has been confirmed.?To be included in the chain, the following block needs to have the hash of the one before it. As a result, the blockchain is guaranteed to maintain its historical order, thereby making it tamper-proof.
  4. DISTRIBUTED: Each computer running the blockchain’s software has a copy of all the information contained in that blockchain. Instead of being processed by a central server, information is transferred and validated by nodes located at various points throughout the network. Every client must adhere to a strict set of rules in order for the network to operate properly; if blocks are broadcast to the network but do not comply with the validity standards, the block will be rejected. The network of a blockchain is distributed, enabling a transparent, peer-based network that can self-verify.
  5. CONSENSUS: Every node on the network contributes to consensus, the process by which the data is agreed upon and becomes the truth on the network. However, certain nodes called miners play a very important role in this process. Nodes work together to verify the information being transmitted by other nodes without relying on a central server. Each consensus mechanism has its own set of rules and every blockchain must have a consensus algorithm otherwise it will lose its value.
  6. UNANIMOUS: All the network participants agree to the validity of the records before they can be added to the network. A node must receive a majority vote in order to add a block to the network; otherwise, the block cannot be added. Therefore, no change to the network can be done without the consent of the vast majority of nodes.

Blockchain Applications

No alt text provided for this image

  1. Non-fungible Tokens (NFTs): NFTs are frequently conceived of as a means of acquiring the rights to digital art. Placing an NFT on the blockchain ensures that only one copy of a work of digital art exists since the blockchain forbids data from existing in two locations.
  2. Insurance: Using blockchain-based smart contracts can give both customers and insurance companies more transparency.
  3. Autonomous Vehicle: The core features of blockchains, such as their decentralized nature, transparency, and immutability, making them perfectly suited to address the complex issues autonomous vehicle deal with on a regular basis.
  4. Government benefits: Another way to use digital identities stored on a blockchain is for the administration of government benefits such as welfare programs, Social Security, and Medicare.
  5. Logistics and supply chain tracking: Tracking goods as they move through a logistics or supply chain network can have various benefits. Blockchain technology can be used to do this.

Conclusion

Despite the fact that blockchain technology has only been available for a dozen years, businesses are continually exploring new ways to use it to assist their operations. As we utilize more and more digital data in our daily lives, there is an increasing demand for the data security, accessibility, transparency, and integrity that blockchain can offer. Blockchain may one day alter the world!

Presentation

https://youtu.be/rt32qIoYjYQ

Merkle Tree

https://www.dhirubhai.net/pulse/merkle-tree-blockchain-shubham-shankar

Reference

https://www.investopedia.com/terms/b/blockchain.asp

https://www.euromoney.com/learning/blockchain-explained/what-is-blockchain

https://www.dhirubhai.net/pulse/learning-blockchain-kiki-ahmadi/

https://dev.to/gmfcastro/my-best-shot-explaining-blockchain-4873

https://www.researchgate.net/figure/The-structure-of-a-Blockchain-A-block-is-composed-of-a-header-and-a-body-where-a-header_fig1_337306138

https://www.naukri.com/learning/articles/structure-of-a-block-in-blockchain/

https://en.wikipedia.org/wiki/Cryptographic_hash_function

https://www.brunobrito.net.br/seguranca-hash-em-senhas/

https://coinmarketcap.com/alexandria/article/what-is-peer-to-peer-p2p

https://coinsbench.com/how-blockchain-achieve-consensus-in-a-distributed-p2p-network-492cfa629e14

https://www.coindesk.com/learn/how-blocks-are-added-to-a-blockchain-explained-simply/

https://weteachblockchain.org/courses/blockchain-101/01/properties-of-a-blockchain#:~:text=A%20blockchain%20is%20a%20decentralized,decentralized%20network%20design%20for%20security.

https://www.geeksforgeeks.org/features-of-blockchain/

Prakash Rathod

Senior Manager Hardware development at Infinera

2 年

Very good Presentation Shubham..

要查看或添加评论,请登录

社区洞察

其他会员也浏览了