Unit-1

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 21

UNIT-1

INTRODUCTION AND OVERVIEW OF BLOCKCHAIN

What is Blockchain?

A blockchain is a constantly growing ledger which keeps a permanent record of all the
transactions that have taken place in a secure, chronological, and immutable way.

Let's breakdown the definition,

o Ledger: It is a file that is constantly growing.


o Permanent: It means once the transaction goes inside a blockchain, you can put up it
permanently in the ledger.
o Secure: Blockchain placed information in a secure way. It uses very advanced
cryptography to make sure that the information is locked inside the blockchain.
o Chronological: Chronological means every transaction happens after the previous one.
o 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.

Note: A blockchain can be used for the secure transfer of money, property, contracts, etc.
without requiring a third-party intermediary like bank or government. Blockchain is a software
protocol, but it could not be run without the Internet (like SMTP used in email).
Who uses the blockchain?
Blockchain technology can be integrated into multiple areas. The primary use of blockchains is
as a distributed ledger for cryptocurrencies. It shows great promise across a wide range of
business applications like Banking, Finance, Government, Healthcare, Insurance, Media and
Entertainment, Retail, etc.

Need of Blockchain

Blockchain technology has become popular because of the following.

o 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.
o 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.
o Reliability: Blockchain certifies and verifies the identities of each interested parties. This
removes double records, reducing rates and accelerates transactions.
o 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.
o Collaboration: It allows each party to transact directly with each other without requiring
a third-party intermediary.
o 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.

Why Blockchain?

Blockchain helps in the verification and traceability of multistep transactions needing


verification and traceability. It can provide secure transactions, reduce compliance costs, and
speed up data transfer processing. Blockchain technology can help contract management and
audit the origin of a product. It also can be used in voting platforms and managing titles and
deeds.

o
o Note: The data is recorded in chronological order. Also, once the data is recorded, it
cannot be changed.

What Are the Benefits of Blockchain Technology?

Here's a list of key benefits you can expect to achieve when adopting Blockchain technology into
your business:

 It is an immutable public digital ledger, which means when a transaction is recorded, it cannot
be modified

 Due to the encryption feature, Blockchain is always secure


 The transactions are done instantly and transparently, as the ledger is updated automatically

 As it is a decentralized system, no intermediary fee is required

 The authenticity of a transaction is verified and confirmed by participants

What are Future opportunities of blockchain?

Several industries like Unilever, Walmart, Visa, etc. use blockchain technology and have gained
benefits in transparency, security, and traceability. Considering the benefits blockchain offers, it
will revolutionize and redefine many sectors.

Here are the top 5 prominent industries that will be disrupted by blockchain technology in the
near future:

1. Banking

2. Cyber Security

3. Supply Chain Management

4. Healthcare

5. Government

1. Banking

Before Blockchain

Banking has transfer fees, which can be both expensive and time-consuming for people. Also,
sending money overseas becomes even more difficult due to the exchange rate and other hidden
costs.

After Blockchain

Blockchain eliminates the need for a middleman. Blockchain is disrupting the banking system by
providing a peer-to-peer payment system with the highest security and low fees.

 Blockchain technology provides instant and borderless payments across the globe

 Cryptocurrencies (like Ethereum, bitcoin) remove the requirement for a third party to perform
transactions
 Blockchain records all the transactions in a public ledger which is globally accessible by
bitcoin users

Let’s consider an example of ABRA

 Abra is a financial cryptocurrency application which helps in performing peer-to-peer money


transfers

 With this application, cryptocurrency users can save, send and receive their digital money on
their electronic devices

2. Cyber Security

Before Blockchain

Earlier, cyberattacks were a significant threat to the public. Several organizations were
developing an effective solution to secure the data against unauthorized access and tampering.

After Blockchain

 Blockchain quickly identifies malicious attack due to the peer-to-peer connections where data
cannot be tampered with

 Every single piece of data stored on the blockchain network is verified and encrypted using
a cryptographic algorithm

 By eliminating the centralized system, blockchain provides a transparent and secure way of
recording transactions (without disclosing your private information to anyone)

For example, a software security company called Guardtime offers blockchain-based products
and services.

Rather than following the centralized system, the company utilizes blockchain technology and
distributes data to its nodes.

3. Supply Chain Management

Before Blockchain

Due to the lack of transparency, supply chain management often had its challenges like service
redundancy, lack of coordination between various departments, and lack of reliability.
After Blockchain

Tracking of a product can be done with blockchain technology, by facilitating traceability across
the entire Supply chain.

Blockchain gives the facility to verify and audit transactions by multiple supply chain partners
involved in the supply chain management system.

 Blockchain records transaction (history, timestamp, date, etc.) of a product in a decentralized


distributed ledger

 Each transaction is recorded into a block

 With blockchain, anyone can verify the authenticity or status of a product being delivered

Let’s consider an example of the Pacific Tuna project.

Here, blockchain supply chain management provides a step-by-step verification process to track
tuna fish. The process results in preventing illegal fishing.

4. Healthcare

Before Blockchain

In the healthcare system, patients can connect to other hospitals and collect their medical data
immediately. Apart from the delay, there are high data corruption chances since the information
is stored in a physical memory system.

After Blockchain

 Blockchain removes a central authority, which results in instant access to data

 Here, each block is linked to another block and distributed across the computer node. This
becomes difficult for a hacker to corrupt the data

For example, United Healthcare is an American healthcare company that has enhanced its
privacy, security, and medical records' interoperability using Blockchain.
5. Government

Before Blockchain

Rigged votes is an illegal activity that occurs during most traditional voting systems. Also,
citizens who want to vote to wait a little longer in a queue and cast their votes to a local
authority, which is a very time-consuming process.

After Blockchain

 Voters are allowed to vote without the need of disclosing their identity in public

 The votes are counted with high accuracy by the officials knowing that each ID can be
attributed to just one vote

 As soon the vote is added to the public ledger, the information can never be erased

What are scope and importance of the technology?

 Its scope includes a wide range of applications in various industries, including finance,
healthcare, supply chain management, and more.
 The importance of block chain lies in its ability to provide security, transparency, and
efficiency in digital transactions, while eliminating the need for intermediaries. It can
improve trust, reduce costs, and streamline processes, leading to increased productivity
and better outcomes for businesses and individuals alike. Additionally, block chain
technology has the potential to enable new business models and disrupt traditional
industries.

Advantage using block chain :


1. It provides greater trust among users.
2. It provides greater security among data.
3. Reduce the cost of production.
4. Improve Speed.
5. Invocation and tokenization.
6. It provides immutable records.
7. Smart contracts
Disadvantages using blockchain :
1. Data modification is not possible.
2. It requires large storage for a large database.
3. The owner cannot access the private key again if they forget or lose it.

Real life application of blockchain :


Here is a list of real world problem where we can use blockchain :
1. In a secure and full-proof voting management system.
2. To supply chain management.
3. In healthcare management.
4. Real estate project.
5. NFT marketplace.
6. Avoid copyright and original content creation.
7. In the personal identity system
8. To make an immutable data backup.
9. Internet of Things

Types of Blockchain
There are 4 types of blockchain:
Public Blockchain.
Private Blockchain.
Hybrid Blockchain.
Consortium Blockchain.
Types of Blockchain

1. Public Blockchain
These blockchains are completely open to following the idea of decentralization. They don’t
have any restrictions, anyone having a computer and internet can participate in the network.

 As the name is public this blockchain is open to the public, which means it is not owned
by anyone.
 Anyone having internet and a computer with good hardware can participate in this public
blockchain.
 All the computer in the network hold the copy of other nodes or block present in the
network
 In this public blockchain, we can also perform verification of transactions or records
Advantages:
1. Trustable: There are algorithms to detect no fraud. Participants need not worry about the
other nodes in the network
2. Secure: This blockchain is large in size as it is open to the public. In a large size, there is
greater distribution of records
3. Anonymous Nature: It is a secure platform to make your transaction properly at the same
time, you are not required to reveal your name and identity in order to participate.
4. Decentralized: There is no single platform that maintains the network, instead every user
has a copy of the ledger.
Disadvantages:
 Processing: The rate of the transaction process is very slow, due to its large size.
Verification of each node is a very time-consuming process.
 Energy Consumption: Proof of work is high energy-consuming. It requires good
computer hardware to participate in the network
 Acceptance: No central authority is there so governments are facing the issue to
implement the technology faster.
 Use Cases: Public Blockchain is secured with proof of work or proof of stake they can be
used to displace traditional financial systems. The more advanced side of this blockchain
is the smart contract that enabled this blockchain to support decentralization. Examples of
public blockchain are Bitcoin, Ethereum.

2. Private Blockchain
These blockchains are not as decentralized as the public blockchain only selected nodes can
participate in the process, making it more secure than the others.
 These are not as open as a public blockchain.
 They are open to some authorized users only.
 These blockchains are operated in a closed network.
 In this few people are allowed to participate in a network within a company/organization.
Advantages:
 Speed: The rate of the transaction is high, due to its small size. Verification of each node is
less time-consuming.
 Scalability: We can modify the scalability. The size of the network can be decided manually.
 Privacy: It has increased the level of privacy for confidentiality reasons as the businesses
required.
 Balanced: It is more balanced as only some user has the access to the transaction which
improves the performance of the network.
Disadvantages:
 Security- The number of nodes in this type is limited so chances of manipulation are there.
These blockchains are more vulnerable.
 Centralized- Trust building is one of the main disadvantages due to its central nature.
Organizations can use this for malpractices.
 Count- Since there are few nodes if nodes go offline the entire system of blockchain can be
endangered.

Use Cases: With proper security and maintenance, this blockchain is a great asset to secure
information without exposing it to the public eye. Therefore companies use them for internal
auditing, voting, and asset management. An example of private blockchains is Hyperledger,
Corda.

3. Hybrid Blockchain
It is the mixed content of the private and public blockchain, where some part is controlled by
some organization and other makes are made visible as a public blockchain.
 It is a combination of both public and private blockchain.
 Permission-based and permissionless systems are used.
 User access information via smart contracts
 Even a primary entity owns a hybrid blockchain it cannot alter the transaction
Advantages:
 Ecosystem: Most advantageous thing about this blockchain is its hybrid nature. It cannot be
hacked as 51% of users don’t have access to the network
 Cost: Transactions are cheap as only a few nodes verify the transaction. All the nodes don’t
carry the verification hence less computational cost.
 Architecture: It is highly customizable and still maintains integrity, security, and
transparency.
 Operations: It can choose the participants in the blockchain and decide which transaction
can be made public.
Disadvantages:
 Efficiency: Not everyone is in the position to implement a hybrid Blockchain. The
organization also faces some difficulty in terms of efficiency in maintenance.
 Transparency: There is a possibility that someone can hide information from the user. If
someone wants to get access through a hybrid blockchain it depends on the organization
whether they will give or not.
 Ecosystem: Due to its closed ecosystem this blockchain lacks the incentives for network
participation.
Use Case: It provides a greater solution to the health care industry, government, real estate, and
financial companies. It provides a remedy where data is to be accessed publicly but needs to be
shielded privately. Examples of Hybrid Blockchain are Ripple network and XRP token.

4. Consortium Blockchain

It is a creative approach that solves the needs of the organization. This blockchain validates the
transaction and also initiates or receives transactions.
 Also known as Federated Blockchain.
 This is an innovative method to solve the organization’s needs.
 Some part is public and some part is private.
 In this type, more than one organization manages the blockchain.
Advantages:
 Speed: A limited number of users make verification fast. The high speed makes this more
usable for organizations.
 Authority: Multiple organizations can take part and make it decentralized at every level.
Decentralized authority, makes it more secure.
 Privacy: The information of the checked blocks is unknown to the public view. but any
member belonging to the blockchain can access it.
 Flexible: There is much divergence in the flexibility of the blockchain. Since it is not a very
large decision can be taken faster.
Disadvantages:
 Approval: All the members approve the protocol making it less flexible. Since one or more
organizations are involved there can be differences in the vision of interest.
 Transparency: It can be hacked if the organization becomes corrupt. Organizations may
hide information from the users.
 Vulnerability: If few nodes are getting compromised there is a greater chance of
vulnerability in this blockchain
Use Cases: It has high potential in businesses, banks, and other payment processors. Food
tracking of the organizations frequently collaborates with their sectors making it a federated
solution ideal for their use. Examples of consortium Blockchain are Tendermint and Multichain.

What are blockchain platforms?


 Blockchain platform technology is a decentralized solution to tracking, documenting, and
facilitating transactions. These tools create a public ledger relying on globally distributed
historical transactions to prevent tampering and fraud. Each interaction is documented in
a database that relies on each previous, time-stamped transaction to verify and execute an
exchange

 There are many blockchain platforms, each with its own unique features and use cases.
Some of the most well-known blockchain platforms include Bitcoin, Ethereum, Ripple,
Litecoin, and Stellar. Other notable blockchain platforms include EOS, Cardano, Tron,
and Binance Smart Chain.
 Each of these platforms has its own unique consensus mechanisms, programming
languages, and smart contract capabilities, making them suited for different types of
decentralized applications and use cases.
What are Miners?

 Miners are an essential part of the blockchain network. They are responsible for verifying
transactions and adding them to the blockchain. Miners use powerful computers to solve
complex mathematical problems that allow them to validate transactions.
 In order to add a transaction to the blockchain, a miner must first verify that the
transaction is valid. This involves checking that the sender has enough funds to complete
the transaction and that the transaction has not already been recorded on the blockchain.

Why are Miners Important?

Miners play a crucial role in the blockchain ecosystem. Without miners, the blockchain would
not be able to function. Here are some of the reasons why miners are so important:

Security

One of the key benefits of blockchain technology is its security. The blockchain is designed to be
tamper-proof, meaning that once a transaction is recorded on the blockchain, it cannot be altered
or deleted.

Miners help to maintain the security of the blockchain by verifying transactions and adding them
to the ledger. This ensures that the ledger remains accurate and up-to-date, and that fraudulent
transactions are not recorded.

Decentralization

Another important aspect of the blockchain is its decentralized nature. Unlike traditional
centralized systems, where a single entity controls the data, the blockchain is maintained by a
network of nodes that work together to ensure the integrity of the ledger.
Miners play a key role in maintaining the decentralization of the blockchain. Because mining is
open to anyone with the right equipment, it ensures that no single entity has control over the
network.

Incentivization

Finally, miners are incentivized to maintain the security and decentralization of the blockchain
through a reward system. When a miner successfully adds a block to the blockchain, they are
rewarded with a certain amount of cryptocurrency.

This reward system encourages miners to continue to validate transactions and add them to the
blockchain. It also ensures that the blockchain remains secure and decentralized, as miners have
a financial incentive to act in the best interests of the network.

What is a nonce?

 The word nonce is short for 'number used only once.' It may sound like a simple concept, but
its use cases range from small transactions to space stations. In finance and cryptography, a
nonce refers to a randomly generated number, and it is used to verify transactions or perform
security checks.
 For example, the captchas we often find on websites are nonces (albeit with letters included)
as they are used just once. In a much simpler case, even the OTPs sent to verify transactions
are nonces that have the singular use of verifying something for a limited period of time.

What is the use of a nonce in blockchain?

 Within several proof-of-work blockchains, including Bitcoin, a nonce is a random 32-bit


number that miners use as a base for their hash calculations. Miners compete with each other,
trying to guess a valid nonce as they attempt to calculate a block hash.
 A block hash is like a reference number for a block in the blockchain. This reference number
needs to meet certain requirements, i.e., it needs to begin with a specific number of zeroes.
Bitcoin miners perform a maddening number of hash functions with many different nonce
values until a valid output is produced.
 The first miner to find a nonce that results in a valid block hash gets to add the next block to
the blockchain and is rewarded for doing so.
 Miners employ a trial-and-error approach, in which every calculation takes a new nonce value.
Blockchains employ this method as the probability of guessing a valid nonce is close to zero.
Therefore, miners must possess advanced computing systems to test and discard millions of
different nonce possibilities to calculate a valid block hash. The nonce that results in a valid
block hash is known as a golden nonce.
 Do note that, since it is a 32-bit number, a nonce can have more than 4 billion possibilities.
Moreover, the inclusion of an “extra nonce” creates space for a much longer number, one that
can have tens of billions of combinations.
 Of course, as the number of miners increase over time, the frequency of finding a nonce and
calculating a valid block hash is bound to increase. Therefore, mining difficulty is adjusted to
keep the block time consistent, which is around 10 minutes in the case of Bitcoin.
 To do this, the protocol will adjust the number of zeroes in the block hash, thereby changing
the nonce requirements and keeping mining machines on their toes. The process of trying
different nonces until a valid hash is found constitutes the 'work' in the proof-of-work
consensus mechanism.
What is Consensus Algorithm?
 A consensus algorithm is a procedure that allows each peer of the blockchain network to
set a shared agreement about the state of the decentralized ledger. In other words, The
consensus algorithm is a protocol using which all the nodes in the blockchain network
come to a common consensus (agreement) on the current data state in the ledger and can
trust unknown peers in the network.
 The consensus algorithm or mechanism is designed to acquire reliability in a network that
consists of nodes or multiple users. So, consensus algorithms allow blockchain to achieve
reliability and trust among nodes while ensuring security in the network environment. It
is useful when it comes to record-keeping.
 In short, the consensus algorithm acts as the backbone of the blockchain that helps verify
transactions from different nodes in the network using cryptographic hashes (generates
unique values for unique input).
 Some of the common objectives of the consensus mechanism for blockchain are
collaboration, equal rights to each node, coming to an agreement, cooperation, and
mandatory participation of every node.
Types of Consensus Algorithms:
Consensus algorithms have different types working on different principles. So, let’s understand
each of these algorithms and how they work.

Blockchain Proof of work?

 Proof of Work(PoW) is the original consensus algorithm in a blockchain network. The


algorithm is used to confirm the transaction and creates a new block to the chain. In this
algorithm, minors (a group of people) compete against each other to complete the
transaction on the network.

 The process of competing against each other is called mining. As soon as miners
successfully created a valid block, he gets rewarded. The most famous application of
Proof of Work(PoW) is Bitcoin.

 Producing proof of work can be a random process with low probability. In this, a lot
of trial and error is required before a valid proof of work is generated. The main
working principle of proof of work is a mathematical puzzle which can easily prove the
solution. Proof of work can be implemented in a blockchain by the Hashcash proof of
work system.

 In the below image, you can see that this block is composed of a block number, data
field, cryptographic hash associated with it and a nonce. The nonce is responsible for
making the block valid.

In the puzzle game, bitcoin software creates a challenge, and there is a game begins. This game
involves all miners competing against each other to solve the challenges, and this challenge will
take approximately 10 minutes to be completed. Every single miner starts trying to find the
solution to that one Nonce that will satisfy the hash for the block. At some specific point, one of
those miners in the global community with higher speed and great hardware specs will solve the
cryptography challenge and be the winner of the game. Now, the rest of the community will start
verifying that block which is mined by the winner. If the nonce is correct, it will end up with the
new block that will be added to the blockchain. The concept of generating a block provides a
clear explanation of proof of work(PoW).

Proof of Stake (PoS)


Proof of Stake (PoS) is a greener PoW substitute that requires fewer CPU computations for
mining. Although the purpose of PoS is similar to PoW, the process differs. That being said,
while a miner has to solve mathematical puzzles and create a new block in PoW; the new block
creator is chosen according to its wealth in a deterministic manner, also known as Stake in PoS.
Moreover, PoS saves both energy and time. But, to become a validator, participants need to
invest some stake (money). And, the miners also get the opportunity to take their transaction fees
as there are no rewards for them in the system.
In simple terms, instead of investing in costly hardware to solve complex puzzles, validators will
invest in the system coins and lock some of them as stakes. By doing that, the validators will
validate the blocks by placing a bet on them if they find a block that can be added to the
network.
There are two popular types of PoS: DPoS and LPoS.
Delegated Proof of Stake (DPoS)
In DPoS, the miners stake their coin and vote for a particular amount of delegates, in a way that,
the more they invest, the more precedence they receive. They get rewards in terms of coins or
transaction fees.
In DPoS, there are 21-100 delegates charged periodically and assigned to deliver their blocks.
Having fewer delegates allows for an efficient organization to design time slots for publishing
blocks in the network. In case of, insufficient, invalid, or missing block publishing, the miners
vote them out to be replaced with other selected delegates.
As DPoS works on the stake-weighted voting system, it has become one of the fastest growing
and adapted blockchain consensus models.
Leased Proof of Stake (LPoS)
LPoS operates on Waves' blockchain platform and is an advanced version of PoS.
In LPoS, users lease crypto tokens to the node that wants to act as a block producer for the
network. A node with the maximum number of staked tokens is more likely to be selected for the
next block generation as well as receive rewards.
It also helps users with smaller tokens who might not have been eligible for participating as the
blockchain creator in the traditional proof of Stake process in pooling their assets while
enhancing their chances of receiving network transaction fees’ share.
The leased proof of stake (LPoS) consensus algorithm is best for networks with high high-
technical requirements for operating full nodes capable of verifying and validating transactions
Transaction Life Cycle of Block chain

Blockchain technology is mostly about the transactions that we make digitally for ourselves.
Eventually, these transactions make their way to the various blocks that become part of the
Blockchain later on. So, it is important to understand the transaction life cycle in Blockchain
technology.
This lifecycle follows the journey of a single transaction as it makes its way through each stage
in the process of joining the blockchain. Transaction in simple words is the process of sending
money by the sender and the receiver receiving it. The Blockchain transaction is also quite
similar, but it is made digitally.
Let us understand the various stages in a blockchain transaction life cycle with the help of an
example.
Sourav and Suraj are two Bitcoin users. Sourav wants to send 1 bitcoin to Suraj.
1. First, Sourav gets Suraj’s wallet address (a wallet in the blockchain is a digital
wallet that allows users to manage their transactions). Using this information, he
creates a new transaction for 1 bitcoins from his wallet and includes a transaction
fee of 0.003 bitcoin.
2. Next, he verifies the information and sends the transaction. Each transaction that is
initiated is signed by a digital signature of the sender that is basically the private
key of the sender. This is done in order to make the transaction more secure and to
prevent any fraud.
3. Sourav’s wallet then starts the transaction signing algorithm which signs his
transaction using his private key.
4. The transaction is now broadcasted to the memory pool within the network.
5. This transaction is eventually accepted by the miners. These miners, group this
transaction into a block, find the Proof of Work, and assign this block a hash
value to be mapped into the blockchain.
6. This block is now placed on the Blockchain.
7. As this block gains confirmation, it is accepted as a valid transaction in the network.
8. Once this transaction is accepted, Suraj finally gets his bitcoin.
The below diagram is a pictorial representation of the various stages in a transaction life cycle
as discussed above.
Creation Of Block

Block mining process

To create a new block, miners must go through a process to solve a math problem. When finding
a valid solution for the network, a new block can be taken for granted that will be added to the
blockchain by consensus. And for which, the miner who found the solution, will receive a reward
for the new block. This reward is known as the block reward.

A new Bitcoin block is generated approximately every 10 minutes. So every time one is
found, it means the start of mining for another. Since these are mathematically related or chained
together. But let's see in more detail how this process is performed:

First stage: Transaction


The process of mining a new block starts when a user wants to send a certain amount of
cryptocurrency to another person. So send bliss transaction with the data from
your wallet, waiting for the network to do and confirm. They remain there until a block is mined
where they can be included and validated.

Second stage: Compilation


These pending transactions on the network are collected and grouped into a block of transactions
by mining nodes. Multiple miners are likely to collect the same transactions. And they will all
be unconfirmed until the block is mined.

Third stage: Training


Each miner will select the transactions they want to include and build their own block. If there
are transactions already validated and included in the previous block, they will be removed from
this one. This new block is known as a candidate, since it is not yet valid because it does not
have a valid proof of work.

In the formation of this new block, a header must be included that contains the hash from the
previous block, the merkle root and data for mining competition. I mean, the timestamp, the
objective of the algorithm of PoW for that block (the bits), the software version and the nuncio.

Stage Four: Proof of Work


Once each miner has formed their own transaction block, they will need to find a valid
signature for that block. In other words, carry out a proof of work. Each miner must carry out a
mathematical calculation process that is unique to each block they formed. So, although the
procedure is the same, the result will be totally different for each one. This complex calculation
involves a lot of computational power, and therefore, a large expenditure of electrical energy.
Which will also depend on the system difficulty for the time of mining.

The solution miners must find is known as hash. This function is very difficult to find, but once
found, it is easy to verify by others. nodes.. So that they can verify that the output hash comply
with the established system conditions.
To find a valid output hash, the miners perform the mathematical calculations repetitively over
and over again using a nuncio. Which is a random number that they use and constantly change
until they find an output signature or hash that is valid based on the condition. There is no way to
predict which nonce will solve the problem, so they must use as many as necessary. And we are
talking about billions of values! Incredible, right?

In the case of the Bitcoin network, the system determines that the output hash must contain a
certain number of zeros at the beginning of the hash.

Fifth stage: Transmission


When a mining node manages to find a valid output hash for a block, it transmits that block
together with the signature to the other nodes in the network so that they can validate it.

At this time, as long as the 21 million bitcoins have not been issued, the miner receives the
reward established for mining, putting new bitcoins into circulation. This is registered on its own
node, the other nodes on the network will do so in the next step.

In addition, regardless of whether all the bitcoins have been issued or not, the miner also receives
all the mining commissions that users have put in the transactions that make up this block.

Sixth stage: Verification


The other nodes in the network are in charge of validate and verify that the block and hash
meet the system conditions, verifying its legitimacy and if it actually contains the stated number
of zeros.

Here also the proof of work is confirmed, that is, the computational power spent to find the
solution, and it is noted that the miner who discovered the block can effectively make use of the
recently received bitcoins.

Seventh stage: Confirmation


Once the new block is added to the blockchain, all the others that are added on top of it will
count as a confirmation. At this point, we can come to think that since each miner started the
process with their own block, they can continue mining. But it's not like that. Once a block is
generated, all mining nodes must start the process by forming a new block of transactions. They
cannot continue mining the previous block because each block must add the output hash of
the block that precedes it.

This is why we know this technology as a chain of blocks or blockchain. Then, by the time the
miner gets a valid hash, another number of new blocks may have been mined. So the output hash
of your mined block will not match the output hash of the last added block in the chain. It will be
rejected.

In addition, it is very likely that all or most of the transactions included in that block have
already been added to others. Even if you succeed in mining the block most of your included
transactions will not be able to be validated or confirmed.
Characteristics of the mined blocks

The blocks mined in the Bitcoin system must meet certain characteristics and conditions to be
considered valid. Let's see what they are:

 Mined block header hash must be less than target. If it is greater, it will not be
considered as valid.
 Block size must be within acceptable limits. In Bitcoin, a block must have a maximum
size of 2 MB.
 La timestamp of the block should be less than two hours in the future.
 The first transaction added to the block will be the coinbase transaction. That will give
the mining node the reward of the network. And there will only be one coinbase
transaction per block.
 All transactions added to the block are valid.
 The header of each block will contain the hash of the previous block and the block
height thereof.

All of these features are checked to confirm a block. And each mining node independently
validates new blocks following exactly the same rules. So, makes sure that no mining node
can cheat. What provides robustness and security to the network. Once the block is validated,
the other nodes in the network will add it to their copy of the blockchain. And when this
happens, it cannot be modified or changed.

Now you know the creation process that each and every bitcoin in circulation has followed.
Each and every one of the bitcoins that exist have been issued following this process, to be later
used or sold by the miner to other people, until it reaches your hands.

You might also like