Blockchain 1
Blockchain 1
*Blockchain: Blockchain is a constantly growing ledger that keeps a permanent record of all the transactions that
have taken place in a secure, chronological, and immutable way.
It can be used for the secure transfer of money, property, contracts, etc. without requiring a third-party intermediary
such as bank or government.
Blockchain is a software protocol, but it could not be run without the Internet (like SMTP is for email).
*Characteristics of Blockchain:
• Ledger: It is a file that is constantly growing.
• Permanent: It means once the transaction goes inside a blockchain, you can put up it permanently in the
ledger.
• Secure: Blockchain placed information in a secure way. It uses very advanced cryptography to make sure that
the information is locked inside the blockchain.
• Chronological: Chronological means every transaction happens after the previous one.
• Immutable: It means as you build all the transaction onto the blockchain, this ledger can never be changed.
A blockchain is a chain of blocks which contain information. Each block records all of the recent transactions, and
once completed goes into the blockchain as a permanent database. Each time a block gets completed, a new block is
generated.
*Advantages of Blockchain:
• Time reduction: In the financial industry, blockchain can allow the quicker settlement of trades. It does not
take a lengthy process for verification, settlement, and clearance. It is because of a single version of agreed-
upon data available between all stakeholders.
• Unchangeable transactions: Blockchain register transactions in a chronological order which certifies the
unalterability of all operations, means when a new block is added to the chain of ledgers, it cannot be
removed or modified.
• Reliability: Blockchain certifies and verifies the identities of each interested parties. This removes double
records, reducing rates and accelerates transactions.
• Security: Blockchain uses very advanced cryptography to make sure that the information is locked inside the
blockchain. It uses Distributed Ledger Technology where each party holds a copy of the original chain, so the
system remains operative, even the large number of other nodes fall.
• Collaboration: It allows each party to transact directly with each other without requiring a third-party
intermediary.
• Decentralized: It is decentralized because there is no central authority supervising anything. There are
standards rules on how every node exchanges the blockchain information. This method ensures that all
transactions are validated, and all valid transactions are added one by one.
*Bitcoin:
Satoshi Nakamoto introduced the bitcoin in the year 31st Oct. 2008.
Bitcoin is a cryptocurrency (virtual currency), or a digital currency that uses rules of cryptography for regulation and
generation of units of currency.
A Bitcoin fell under the scope of cryptocurrency and became the first and most valuable among them. It is commonly
called decentralized digital currency.
A bitcoin is a type of digital assets which can be bought, sold, and transfer between the two parties securely over the
internet.
Bitcoin can be used to store values much like fine gold, silver, and some other type of investments.
We can also use bitcoin to buy products and services as well as make payments and exchange values electronically.
A bitcoin is different from other traditional currencies such as Dollar, Pound, and Euro, which can also be used to buy
things and exchange values electronically.
There are no physical coins for bitcoins or paper bills.
When you send bitcoin to someone or used bitcoin to buy anything, you dont need to use a bank, a credit card, or any
other third-party. Instead, you can simply send bitcoin directly to another party over the internet with securely and
almost instantly.
*Smart Contracts:
Smart contracts are simply programs stored on a blockchain that run when predetermined conditions are met. They
typically are used to automate the execution of an agreement so that all participants can be immediately certain of
the outcome, without any intermediary’s involvement or time loss. They can also automate a workflow, triggering the
next action when conditions are met.
How smart contracts work:
Smart contracts work by following simple “if/when…then…” statements that are written into code on a blockchain. A
network of computers executes the actions when predetermined conditions have been met and verified. These
actions could include releasing funds to the appropriate parties, registering a vehicle, sending notifications, or issuing
a ticket. The blockchain is then updated when the transaction is completed. That means the transaction cannot be
changed, and only parties who have been granted permission can see the results.
Benefits of Smart Contract:
• Speed, efficiency and accuracy:
Once a condition is met, the contract is executed immediately. Because smart contracts are digital and automated,
there’s no paperwork to process and no time spent reconciling errors that often result from manually filling in
documents.
• Trust and transparency:
Because there’s no third party involved, and because encrypted records of transactions are shared across participants,
there’s no need to question whether information has been altered for personal benefit.
• Security:
Blockchain transaction records are encrypted, which makes them very hard to hack. Moreover, because each record is
connected to the previous and subsequent records on a distributed ledger, hackers would have to alter the entire
chain to change a single record.
• Savings:
Smart contracts remove the need for intermediaries to handle transactions and, by extension, their associated time
delays and fees.
*Understanding Cryptocurrency to Blockchain:
Cryptocurrency is a type of digital asset which is used to exchange value between parties.
It uses strong cryptography to secure financial transactions and control the creation of new units of that currency and
verify the transfer of assets.
Cryptocurrency does not exist physically.
We know that the government prints the government currencies like fiat currency such as Dollar, Yen or Yuan itself.
It means there is a centralized institution exists which can create thousands or millions or billions more of that
currency.
Unlike government currencies like bitcoin, these type of currencies is created by the same mathematical formulas
that make the cryptocurrency work.
Thus, cryptocurrencies use decentralized control, which works through distributed ledger technology that serves as a
public financial transaction database.
Today, many different types of cryptocurrencies are available. Some of them are given below:
• Bitcoin
• Litecoin
• Z-cash
• Monero
• Dash
Bitcoin:
Bitcoin is generally known as the first decentralized cryptocurrencies. It is created by the network of thousands of
specific nodes called miners. The miners can process the bitcoin transactions in the blockchain network. Since the
release of bitcoin, more than 4000 alternative variants of bitcoin are available now.
Litecoin:
Litecoin cryptocurrency worked very similar to Bitcoin. We know that bitcoin wait ten minutes for a transaction block
to be processed, but Litecoin can do this in maximum two and a half minutes. Litecoin doesn't have a big market cap.
The price of Litecoin is lower than Bitcoin, but it's a very effective process and also has some variations from Bitcoin.
Z-Cash:
Z-Cash is a privacy-protecting digital currency which is built-on strong science in cryptography. It provides enhanced
privacy for its users as compared to other cryptocurrencies such as bitcoin. Here, transaction data is kept confidential,
which is made possible through zero-knowledge proofs. It allows transactions to be verified without any information
about the sender, receiver, and the amount transacted.
Z-Cash features known as viewing keys and payment disclosure makes it possible to disclose some of the user's
transaction data. It makes the transactions on Z-Cash auditable and regulation-compliant.
Monero:
Monero is an open-source cryptocurrency which focuses on untraceable, privacy and decentralization. It is fast,
private, and secure digital cash, which is operated by a network of users. We can use it to buy and sell things and can
exchange for other coins or tokens.
It uses a special kind of cryptography which ensures that the transactions remain 100% untraceable. It focuses on
anonymity, which is harder to track, whereas Bitcoin is pseudonymous, which transactions are still traceable.
Dash:
Dash is a short form of Digital Cash. It is an open-source cryptocurrency and is a form of a decentralized autonomous
organization which is run by a subset of users, called master nodes. It is one of the most promising alternative coins to
bitcoin. It permits very fast transactions, which are untraceable.
*Public Ledgers:
It is a file that is constantly growing.
The public ledger is used as a record-keeping system that maintains participants’ identities in secure and
(pseudo-)anonymous form, their respective cryptocurrency balances, and a record book of all the genuine
transactions executed between network participants .
*Block in a Blockchain:
A block is a place in a blockchain where information is stored and encrypted. Blocks are identified by long numbers
that include encrypted transaction information from previous blocks and new transaction information. Blocks and the
information within them must be verified by a network before new blocks can be created.
How does a block work?
In any cryptocurrency, there are a huge number of transactions occurring every day throughout the world. It is
important for the users to keep track of these transactions, and they can do it with the help of blocks. A block
contains the recent data and every time the block is completed, it becomes a part of the past and makes room for a
new block on the blockchain.
The completed block is a permanent record of prior transactions, and new ones are recorded in the current one. As a
result, the entire system enters into a loop that permanently saves all data.
*Types of Block:
1:Genesis Block:
Genesis means ‘origin’, genesis block is the first block of a blockchain. The first genesis block was mined by Satoshi
Nakamoto in creating bitcoin and released the idea in public in 2009.Every blockchain has a genesis block.
2:Valid blocks:
Valid blocks are all such blocks that have been mined and added to the blockchain. To get a valid block, each mined
block must get network permission and report as a block that has solved the given cryptographic puzzle.
When the network reaches consensus, the block is added to the blockchain and distributed to all nodes. As a result,
every node in the network has a new block and acts as a verification point for it. All the operations and transactions
that are happening in any cryptocurrency are allowed by these blocks.
Each valid block contains a sequence of transactions that are validated together with the block.
3:Orphan blocks:
Orphan blocks are not part of the blockchain network. These are generally generated by two miners mixing blocks at
almost the same time, but they can also be caused by an attacker with enough computational power with the
intention of reversing any transaction. The network consensus procedure is invoked at this point to determine which
blocks will be verified (included in the chain) and which will be orphaned. Usually, the longest blockchain that
contains the most amounts of transactions and information will generally be decided on. Hence, making the security
process very simple.
*Transaction:
Transactions are the most important part of the bitcoin system.
Everything else in bitcoin is designed to ensure that transactions can be created, propagated on the network, validated,
and finally added to the global ledger of transactions (the blockchain).
Transactions are data structures that encode the transfer of value between participants in the bitcoin system.
A transaction’s lifecycle starts with the transaction’s creation, also known as origination.
The transaction is then signed with one or more signatures indicating the authorization to spend the funds referenced by
the transaction.
The transaction is then broadcast on the bitcoin network, where each network node (participant) validates and
propagates the transaction until it reaches (almost) every node in the network.
Finally, the transaction is verified by a mining node and included in a block of transactions that is recorded on the
blockchain.
Once recorded on the blockchain and confirmed by sufficient subsequent blocks (confirmations), the transaction is a
permanent part of the bitcoin ledger and is accepted as valid by all participants.
The funds allocated to a new owner by the transaction can then be spent in a new transaction, extending the chain of
ownership and beginning the lifecycle of a transaction again.
*Distributed Consensus:
A number of processes in a network decide to elect a leader. Each process begins with a bid for leadership. In
traditional or conventional distributed systems, we apply consensus to ensure reliability and fault tolerance. It means,
in a decentralized environment when you have multiple individual parties, and they can make their own decision,
then it may happen that some node or some parties are working maliciously or working as a faulty individual. So in
those particular cases, it is important to come to a decision or common point of view. So having a common point of
view in an environment where people can behave maliciously or people can crash the work in a faulty way, is the
main difficulty. So under this kind of distributed environment, our objective is to ensure reliability which means to
ensure correct operation in the presence of faulty individuals.
Features :
• It ensures reliability and fault tolerance in distributed systems.
• In the presence of faulty individuals, it is Ensure correct operations.
*Private Blockchain:
A private blockchain is managed by a network administrator and participants need consent to join the network i.e., a
private blockchain is a permissioned blockchain.
There are one or more entities which control the network and this leads to reliance on third-parties to transact.
In this type of blockchain only entity participating in the transaction have knowledge about the transaction performed
whereas others will not able to access it i.e. transactions are private.
Some of the features of private blockchain are:
• Full Privacy:
It focuses on privacy concerns.
Private Blockchain is more centralized.
• High Efficiency and Faster Transactions:
When you distribute the nodes locally, but also have much less nodes to participate in the ledger, the performance is
faster.
• Better Scalability:
Being able to add nodes and services on demand can provide a great advantage to the enterprise.
*Permissioned Blockchain:
A permissioned blockchain is a distributed ledger that is not publicly accessible.
It can only be accessed by users with permissions.
The users can only perform specific actions granted to them by the ledger administrators and are required to identify
themselves through certificates or other digital means.
You might consider the addition of permissioned users as an extra blockchain security system.
Administrators maintain an access control layer to allow certain actions to be performed only by certain identifiable
participants.
Records are kept within the blockchain of who is involved in the transactions. This makes permissioned blockchains
different from public blockchains.
Permissioned blockchains provide an additional level of security over typical blockchain systems like Bitcoin, as they
require an access control layer.
These blockchains are favored by entities who require security, identity, and role definition within the blockchain.
Permissioned blockchains are becoming more common as businesses realize their benefits.
Understanding Permissioned Blockchains
A blockchain can be built and accessed in multiple ways. Some blockchains need special permissions to read, access,
and write information.
Others only require that you have the ability to connect and can conduct work for the network.
The intrinsic configuration of each blockchain controls the participants' transactions and defines their roles in which
each participant can access and contribute to the blockchain.
It may also include maintaining the identity of each blockchain participant on the network. Such blockchains are called
permissioned blockchains.
Markle tree:
Merkle tree is a fundamental part of blockchain technology. It is a mathematical data structure composed of hashes
of different blocks of data, and which serves as a summary of all the transactions in a block. It also allows for efficient
and secure verification of content in a large body of data. It also helps to verify the consistency and content of the
data. Both Bitcoin and Ethereum use Merkle Trees structure. Merkle Tree is also known as Hash Tree.
The concept of Merkle Tree is named after Ralph Merkle, who patented the idea in 1979. Fundamentally, it is a data
structure tree in which every leaf node labeled with the hash of a data block, and the non-leaf node labeled with the
cryptographic hash of the labels of its child nodes. The leaf nodes are the lowest node in the tree.
The above example is the most common and simple form of a Merkle tree, i.e., Binary Merkle Tree. There are four
transactions in a block: TX1, TX2, TX3, and TX4. Here you can see, there is a top hash which is the hash of the entire
tree, known as the Root Hash, or the Merkle Root. Each of these is repeatedly hashed, and stored in each leaf node,
resulting in Hash 0, 1, 2, and 3. Consecutive pairs of leaf nodes are then summarized in a parent node by hashing
Hash0 and Hash1, resulting in Hash01, and separately hashing Hash2 and Hash3, resulting in Hash23. The two hashes
(Hash01 and Hash23) are then hashed again to produce the Root Hash or the Merkle Root.
Merkle Root is stored in the block header. The block header is the part of the bitcoin block which gets hash in the
process of mining. It contains the hash of the last block, a Nonce, and the Root Hash of all the transactions in the
current block in a Merkle Tree. So having the Merkle root in block header makes the transaction tamper-proof. As this
Root Hash includes the hashes of all the transactions within the block, these transactions may result in saving the disk
space.
The Merkle Tree maintains the integrity of the data. If any single detail of transactions or order of the transaction's
changes, then these changes reflected in the hash of that transaction. This change would cascade up the Merkle Tree
to the Merkle Root, changing the value of the Merkle root and thus invalidating the block. So everyone can see that
Merkle tree allows for a quick and simple test of whether a specific transaction is included in the set or not.
Merkle trees have three benefits:
• It provides a means to maintain the integrity and validity of data.
• It helps in saving the memory or disk space as the proofs, computationally easy and fast.
• Their proofs and management require tiny amounts of information to be transmitted across networks.