Bitcoin
Bitcoin
Concepts of blockchain:
Blockchain is a combination of 5 major concepts which
allow the creation of a fair digital world.
Features of blockchain:
block in a blockchain:
A block in a blockchain is like a container that holds data. It consists of
three main components:
When a new block is added to the blockchain, it contains its own data, a
hash generated based on that data, and the hash of the previous block.
This structure ensures that any attempt to alter the data in a block would
require changing the data in all subsequent blocks, making it extremely
difficult to tamper with the information stored in the blockchain.
In a permissioned blockchain:
1. **Access Control**: Participants are required to have permission to
read, write, or validate transactions on the blockchain. This control
allows organizations to define who can join the network and what actions
they can perform.
Example #1
Suppose a small manufacturing group has three member companies:
Apex Ltd., DreamZone Company, and FastRush Ltd. They decided to
implement a blockchain to streamline their supply chain. Each company
in this group maintains a node on the blockchain. When Apex Ltd.
produces a product, they record it on the blockchain and
specify its quality and quantity.
DreamZone Company, which assembles the final product, can access
this information, which ensures they have the right components at the
right time. Once the assembly is complete, DreamZone Company
records it on the blockchain. FastRush Ltd. is responsible for distribution
and checks the blockchain to confirm the product is ready for shipment.
This transparent, permissioned system ensures all parties can access
the supply chain data while maintaining privacy and security.
Example #2
Hong Kong is intensifying its attempts to create its digital currency this
year. However, the regulator has left it up to the banks to decide whether
the ledger will be centralized or decentralized. At least one of the
significant banks is considering creating an e-HKD on a blockchain.
The central government has not dictated the design of Hong Kong’s
central bank digital currency (CBDC), as revealed by a bank official who
was not authorized to discuss the matter publicly. There are significant
security and privacy implications depending on whether the e-HKD will
be issued on a permissioned or permissionless chain. This is another
permissioned blockchain example.
Cryptographic Hash Functions:
Merkle trees are often used with peer-to-peer (P2P) networks because
of the need to have information shared and independently validated.
Merkle tree is designed to ensure blocks of data can receive from other
peers in a peer to peer network. In most cases, a Merkle tree comprises
of two child nodes under each node on the network.
We know that blockchain has blocks linked to each other logically. Each
block would have thousands of transaction details. Therefore, it would be
a complex task to store all of them as a series which is also very time
inefficient. In such a series of data, it becomes really cumbersome to find
out a particular transaction. This is where the Merkle tree comes into the
action. Using a Merkle tree, we can easily identify if that particular
transaction belongs to a block or not.
● Root node: The root of the Merkle tree is known as the Merkle root and this
Merkle root is stored in the header of the block.
● Leaf node: The leaf nodes contain the hash values of transaction data.
Each transaction in the block has its data hashed and then this hash value
(also known as transaction ID) is stored in leaf nodes.
● Non-leaf node: The non-leaf nodes contain the hash value of their
respective children. These are also called intermediate nodes because they
contain the intermediate hash values and the hash process continues till the
root of the tree.
● Merkel root: The Merkle root is a single hash that represents the entire set
of transactions in a block in blockchain technology. It is calculated by
recursively hashing pairs of transaction hashes until a single hash, the
Merkle root, is obtained.
How it works:
In blockchain, a Merkle tree is a fundamental data structure that helps efficiently
summarize and verify the integrity of large sets of data. It's named after Ralph
Merkle, a computer scientist who first proposed the concept.
Example: Consider a block having 4 transactions- T1, T2, T3, T4. These four
transactions have to be stored in the Merkle tree and this is done by the following
steps-
H1 = Hash(T1).
Step 2: The hashes computed are stored in leaf nodes of the Merkle tree.
Step 3: Now non-leaf nodes will be formed. In order to form these nodes, leaf nodes
will be paired together from left to right, and the hash of these pairs will be
calculated. Firstly hash of H1 and H2 will be computed to form H12. Similarly, H34 is
computed. Values H12 and H34 are parent nodes of H1, H2, and H3, H4
respectively. These are non-leaf nodes.
Step 4: Finally H1234 is computed by pairing H12 and H34. H1234 is the only hash
remaining. This means we have reached the root node and therefore H1234 is the
Merkle root.
Merkle tree works by hashing child nodes again and again till only one hash remains.
Benefits of Merkle Tree
● Validate the data's integrity: It can be used to validate the data's integrity
effectively.
● Efficient verification: The data format is efficient and verifying the data's
integrity takes only a few moments.
● Merkle trees can be used in smart contracts to enable more complex and
secure transactions.
In a hybrid blockchain, both public and private elements work together to create a
versatile network. The public part allows for transparency and decentralized
consensus, while the private side offers controlled access and privacy for certain
transactions or data. This combination enables organizations to leverage the benefits
of blockchain technology while tailoring the network to their specific needs. Overall,
hybrid blockchains provide a flexible and efficient solution for various use cases.
In a consortium blockchain, a group of organizations come together to control the
consensus process. This type of blockchain is permissioned, meaning that
participants are predetermined and have specific roles within the network.
Consortium blockchains offer benefits such as increased efficiency, scalability, and
trust among the participating organizations. By working collaboratively, the
consortium members maintain the blockchain network, validate transactions, and
ensure the integrity of the data.
In blockchain, the different layers play crucial roles in ensuring the network's
functionality and security:
2. **Data Layer**: The data layer stores all the information related to transactions,
blocks, and smart contracts on the blockchain. It ensures data integrity, security, and
accessibility for network participants.
These layers work together to create a secure, transparent, and efficient blockchain
ecosystem. If you have any more questions or need further details about any specific
layer, feel free to ask!