0% found this document useful (0 votes)
61 views13 pages

Bitcoin

Uploaded by

afni8123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views13 pages

Bitcoin

Uploaded by

afni8123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Blockchain:

● Blockchain is a technology that allows digital information (the


"blocks") to be stored in a public database (the "chain") in a
secure, transparent, and decentralised manner.
● Each block contains a unique cryptographic hash, timestamp, and
transaction data. These blocks are linked together in a chain using
cryptographic principles, making the data tamper-proof and
secure.
● Blockchain is known for its key features like decentralization,
transparency, immutability, security, smart contracts, and
consensus mechanisms. It's used in various industries for
applications such as cryptocurrencies, supply chain management,
voting systems, and more.

Concepts of blockchain:
Blockchain is a combination of 5 major concepts which
allow the creation of a fair digital world.

1. Consensus algorithm: As the heart of a Blockchain network,


Consensus algorithm is responsible for reaching a mutual decision
among the network participants. The decision can represent anything
from a simple transaction to any data entry on the Blockchain. Proof of
work and Proof of stake are the widely used consensus algorithms.

2. Distributed ledger: Ensuring that the digital ecosystem is robust, the


Blockchain network participants share a copy of a ledger containing all
transactional information. Even the smallest action on the network is
recorded in the ledger and then distributed to all participants.

3. Decentralised: No one owns the Blockchain network but rather every


participant who maintains the distributed ledger becomes a key
component of the network. The whole ecosystem works on a majority
rule wherein if the majority agrees to any change or modification, the
network accepts it, creating a true democratic environment.
4. Encryption: As a unique value addition, the use of hashing algorithms
and various encryption methods allows the Blockchain network to
provide anonymity to the people. Through concepts like public key and
private key, users can access their data without revealing their identity.
Further, hashing is used in such a way that the decentralised ledger
becomes immutable.

Features of blockchain:

1. **Decentralization**: This means there is no central authority


controlling the blockchain network. Instead, data is stored and managed
by a distributed network of computers (nodes). Decentralization
enhances security, reduces the risk of a single point of failure, and
promotes trust among participants.

2. **Transparency**: Blockchain provides a transparent system where


all participants can view the data on the network. This transparency
helps in verifying transactions, ensuring accountability, and building trust
within the network.

3. **Immutability**: Once data is recorded on the blockchain, it cannot


be altered or deleted. This immutability ensures the integrity of the
information stored on the blockchain and prevents unauthorized
changes, making the data tamper-proof.

4. **Security**: Blockchain uses cryptographic techniques to secure


data and transactions on the network. Each block is linked to the
previous one using cryptographic hashes, creating a secure chain of
blocks. This security feature protects the data from unauthorized access
and ensures the authenticity of transactions.

5. **Consensus Mechanisms**: Consensus mechanisms are protocols


used to achieve agreement among network participants on the validity of
transactions and the state of the blockchain. Popular consensus
algorithms include Proof of Work (PoW) and Proof of Stake (PoS), which
ensure that all nodes in the network agree on the order and validity of
transactions.
6.**Smart Contracts**: Blockchain supports smart contracts, which are
self-executing contracts with the terms directly written into code. Smart
contracts automatically execute and enforce agreements when
predefined conditions are met, reducing the need for intermediaries.

block in a blockchain:
A block in a blockchain is like a container that holds data. It consists of
three main components:

1. **Data**: This is the actual information stored in the block, such as


transaction details, records, or any other relevant data.

2. **Hash**: A hash is a unique identifier for the block. It's like a


fingerprint that distinguishes one block from another. The hash is created
using a cryptographic hash function and is crucial for maintaining the
integrity of the block.

3. **Previous Block's Hash**: Each block contains the hash of the


previous block in the chain. This linking of blocks using their hashes
creates a secure and tamper-resistant chain of blocks.

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 blockchain, a block has a specific structure that includes different


components. Each block typically consists of:

1. **Block Number or Height**: This indicates the position of the block


within the blockchain, starting from the genesis block (the first block) as
0 and incrementing with each new block added.
2. **Timestamp**: The timestamp records the time when the block was
created or added to the blockchain.

3. **Data**: This section contains the actual information stored in the


block, like transaction details, smart contract code, or any other data
relevant to the specific blockchain application.

4. **Nonce**: The nonce is a number used in the mining process to find


a valid hash for the block.

5. **Previous Block's Hash**: This is the hash of the previous block in


the blockchain, linking the current block to the previous one and creating
the chain structure.

6. **Block's Hash**: The hash of the current block, which is generated


based on the block's data, nonce, and the previous block's hash. This
hash uniquely identifies the block and ensures its integrity.

By including these components in each block and linking them together


using cryptographic hashes, the blockchain maintains its security,
transparency, and immutability. If you have any more questions or need
further details, feel free to ask!
Permissioned blockchain model:
In a permissioned blockchain model, access to the blockchain network is
restricted to a certain group of participants. Unlike public blockchains like
Bitcoin or Ethereum where anyone can join the network, permissioned
blockchains require users to have specific permissions to participate.

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.

2. **Identity Management**: Users in a permissioned blockchain are


often required to verify their identities before being granted access. This
helps maintain accountability and traceability within the network.

3. **Scalability and Performance**: Permissioned blockchains can often


achieve higher transaction speeds and scalability compared to public
blockchains due to the controlled environment and fewer participants.

4. **Confidentiality**: Since access is restricted, permissioned


blockchains can implement privacy measures to protect sensitive
information shared on the network. This feature is crucial for enterprise
applications where data confidentiality is a priority.

5. **Governance**: In a permissioned blockchain, governance structures


are typically in place to manage decision-making processes, updates,
and changes to the network. This allows for more centralized control
compared to public blockchains.

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:

● A cryptographic hash function is a mathematical function used in


cryptography. Typical hash functions take inputs of variable lengths
to return outputs of a fixed length.
● A cryptographic hash function combines the message-passing
capabilities of hash functions with security properties.
● Hash functions are mathematical functions that transform or "map"
a given data set into a bit string of fixed size, also known as the
"hash value."
● Hash functions are used in cryptography and have variable levels
of complexity and difficulty.
● Hash functions are used for cryptocurrency, password security,
and message security.

Characteristics of cryptographic hash functions:

1. **Deterministic**: For the same input, a cryptographic hash function


will always produce the same output. This property ensures consistency
and reliability in the hashing process.

2. **Fast Computation**: Hash functions are designed to be


computationally efficient, allowing for quick hashing of data, even for
large amounts of information.

3. **Pre-image Resistance**: It should be computationally infeasible to


reverse the hash function to determine the original input data. This
property ensures the security of the hashed information.

4. **Collision Resistance**: A good cryptographic hash function should


make it extremely difficult to find two different inputs that produce the
same hash value. This property helps maintain the integrity of the data.

5. **Small Changes in Input Produce Unpredictable Changes in


Output**: Even a tiny change in the input data should result in a
significantly different hash value. This property is crucial for detecting
any alterations or tampering with the data.

6. **Fixed Output Size**: Cryptographic hash functions produce a


fixed-size output, regardless of the input data size. This feature is
important for consistency and compatibility in various applications.

7. **Pseudorandomness**: The hash values generated by


cryptographic hash functions should appear random and evenly
distributed. This property adds a layer of security to the hashed data.

Properties of hash functions:

● They are "collision-free." This means that no different inputs should


map to the same output hash.
● They can be hidden. It should be difficult to guess the input value
for a hash function from its output.
● They should be puzzle-friendly. It should be difficult to select an
input that provides a pre-defined output. Thus, the input should be
selected from a distribution that's as wide as possible.
● H can be applied to a block of data of any size.
● H produces a fixed length output.
● H(x) is relatively easy to compute for any given x, making both
hardware and software implementations practical.
● For any given value h, it is computationally infeasible to find x such
that H(x) = h. This is called one-way property.
● For any given block x, it is computationally infeasible to find y≠x
such that H(y) = H(x). This is called weak collision resistance.
● It is computationally infeasible to find any pair (x, y) such that
H(x)= H(y). This is called strong collision resistance.
Merkle tree:
Merkel tree is a kind of data structure that is used for the purpose of
data synchronisation and verification . it is also widely referred to as the
hash tree.

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.

Merkle trees store transaction data efficiently in blockchains. The root


hash is committed, reducing blockchain size. Merkle proofs verify data
efficiently. They are space and computationally efficient, good for
scalability and decentralisation.

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.

Merkle tree is created by repeatedly hashing pairs of nodes until there is


only one hash left. This last hash is called the root hash or the merkle
hash. Merkle tree is constructed from the bottom up from hashes of
individual transactions.
Structure of Merkel tree:

● 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.

Here's how a Merkle tree works in the context of a blockchain:

1. **Data Organization**: In a blockchain, transactions are grouped together in


blocks. To create a Merkle tree, these transactions are arranged in a hierarchical
structure with each transaction as a leaf node.

2. **Hash Calculation**: Starting from the bottom, each transaction is hashed


individually using a cryptographic hash function like SHA-256. Then, pairs of these
transaction hashes are combined and hashed together to create a parent node. This
process continues until there is only one hash left, known as the Merkle root.
3. **Merkle Root**: The Merkle root is the topmost hash in the tree and represents a
condensed version of all the transactions in the block. It's like a unique fingerprint for
all the transactions in that block.

4. **Verification**: To verify the integrity of a specific transaction in the block, nodes


in the blockchain network only need to have the block header (which includes the
Merkle root) and the specific transaction's position in the tree. By tracing the path
from the transaction hash to the Merkle root and recalculating the hashes along that
path, nodes can ensure that the transaction is included in the block and hasn't been
altered.

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-

Step 1: The hash of each transaction is computed.

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.

H12 = Hash(H1 + H2)

H34 = Hash(H3 + H4)

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.

H1234 = Hash(H12 + H34)

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.

● It helps in saving the memory or disk space as the proofs, computationally


easy and fast.

● It requires tiny amounts of information to be transmitted across networks.

● Efficient verification: The data format is efficient and verifying the data's
integrity takes only a few moments.

● Merkle trees are used by Apache Cassandra in order to locate inconsistencies


that exist across all of the database replicas. They make it difficult for
attackers to tamper with data in a blockchain network and they improve the
scalability of the network by reducing the amount of data that needs to be
transmitted and stored.

● 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:

1. **Hardware Infrastructure Layer**: This layer consists of the physical components


that support the blockchain network, such as servers, nodes, and mining equipment.
The hardware infrastructure provides the computational power needed to process
transactions and maintain the blockchain.

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.

3. **Network Layer**: The network layer facilitates communication between nodes in


the blockchain network. It manages the peer-to-peer connections, data transmission,
and synchronization of information across the network to maintain a consistent and
up-to-date ledger.

4. **Consensus Layer**: The consensus layer is responsible for achieving


agreement among network participants on the validity of transactions and the order
in which they are added to the blockchain. Different consensus algorithms govern
how consensus is reached, ensuring the network's security and integrity.

5. **Application Layer**: The application layer is where decentralized applications


(DApps) are developed and deployed on top of the blockchain network. DApps
interact with the underlying blockchain layers to provide various services, such as
financial transactions, supply chain management, or voting systems.

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!

You might also like