The Blockchain.
SHUBHAM SHANKAR
Generative AI | Machine Learning | LLM | Software Developer | AWS Certified Solution Architect | Aspiring Architect | MS in Computer Science.
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.
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.
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.
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.
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.
To be cryptographically secure and useful, a hash function should have the following properties:
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.
Types of Cryptographic Hash Functions
There are several different classes of hash functions. Some of the popular classes are:
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.
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.
领英推荐
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.
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:
Characteristics of Blockchain
Blockchain Applications
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
Senior Manager Hardware development at Infinera
2 年Very good Presentation Shubham..