0% found this document useful (0 votes)
21 views88 pages

Module 1

The document outlines the syllabus for a Master of Computer Applications course focused on Blockchain Technologies, covering topics such as blockchain fundamentals, Hyperledger, Ethereum, and their applications in business. It details the structure of blockchain, including transaction processes, consensus mechanisms, and the role of cryptography. Additionally, it discusses the implications of blockchain for cybersecurity and identity management.

Uploaded by

testcreater007
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
0% found this document useful (0 votes)
21 views88 pages

Module 1

The document outlines the syllabus for a Master of Computer Applications course focused on Blockchain Technologies, covering topics such as blockchain fundamentals, Hyperledger, Ethereum, and their applications in business. It details the structure of blockchain, including transaction processes, consensus mechanisms, and the role of cryptography. Additionally, it discusses the implications of blockchain for cybersecurity and identity management.

Uploaded by

testcreater007
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.

Master of Computer Applications

23MCAIS304 – Block Chain Technologies

Module 1

Blockchain Hyperledger and


Ethereum for Business 1
Module No.-1

SYLLABUS

Module-1
Blockchain Hyperledger and Ethereum for Business
What is blockchain? - Internet versus blockchain - How
blockchain works - The building blocks of blockchain –
Ethereum Private versus public blockchain - Create a Block
Chain, Create Block Chain Network. Crypto currency Basics,
Wallets on the Block Chain, Crypto currency Transactions,
Creating a Crypto currency.

2
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1
SYLLABUS
Module-2
Hyperledger – Blockchain for Businesses
Technical requirements Hyperledger overview - Blockchain-as-a-
service (BaaS), Architecture and core components, Hyperledger
Fabric model, Hyperledger Fabric capabilities, Smart Contract
Basics, Creating a Smart contract
Module-3
Blockchain on the CIA Security Triad and Deploying PKI-
Based Identity
CIA security triad, understanding blockchain on confidentiality,
Blockchain on integrity - Understanding blockchain on availability,
PKI - Challenges of the existing PKI model, Role of blockchain in
implementing PKI

3
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1 SYLLABUS
Module-4
Two-Factor Authentication with Blockchain and DNS security
Platform
Two factor Authentication (2FA), Blockchain for
2FA – Installation of [Link], Turning up Ethereum - Turning up
the smart contract, Testing and verification - DNS, Understanding
DNS components - DNS structure and hierarchy, DNS topology for
large enterprises, Challenges with current DNS, Ethereum-based
secure DNS Infrastructure.
Module-5
Deploying Blockchain-Based DDoS Protection and Cyber
Security
DDoS attacks, Types of DDoS attacks, Challenges with current
DDoS solutions, Transformation of DDoS protection using
Blockchain. Facts about Blockchain and Cyber Security, Decision
path for blockchain - Challenges with blockchain, The future of
cybersecurity with blockchain

4
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1

TOPICS

MODULE-1
Blockchain Hyperledger and Ethereum for Business
What is blockchain? - Internet versus blockchain - How
blockchain works - The building blocks of blockchain –
Ethereum Private versus public blockchain - Create a Block
Chain, Create Block Chain Network. Crypto currency Basics,
Wallets on the Block Chain, Crypto currency Transactions,
Creating a Crypto currency.

5
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1

What is Blockchain?

•Blockchain is a concept that originated to avoid third-party


involvement in any financial transaction in a whitepaper
named Bitcoin: A Peer-to-Peer Electronic Cash System, by Satoshi
Nakamoto.
•Blockchain is a chronological ledger that records transactions of any
value or asset securely.
•The blockchain network provides the ability to transfer any type of
value or asset between independent parties using a peer-to-peer
network.
•The initial objective of the blockchain technology was to establish
trusted financial transactions between two independent parties
without any involvement of third-parties such as a bank
6
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1

• However, later, several industries adopted blockchain to streamline


their supply chain process, KYC system, data management, and so
on.
Why Blockchain?
• With the growing use of online services and a growing number of
online transactions,
 users have to trust and depend on third parties such as banks and
payment gateway providers.
 This led to the birth of the blockchain.
• In 2009, a whitepaper called Bitcoin: A Peer-to-Peer Electronic Cash
System was released by Satoshi Nakamoto to solve the existing
financial market challenges.
• Whitepaper focused on developing a platform to allow online
payments from one party to another without any central authority.

7
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1

Fundamentals of the blockchain


Blockchain is a decentralized database that keeps
records of all transactions secure and in an
append-only fashion.
Blockchain rapidly became popular among
numerous industries because of its decentralized
nature regarding its database.
For an organization that can't afford a single point
of failure, the blockchain database makes it
practically impossible for sensitive information to
be compromised by cyber criminals.

8
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1

• The following diagram is a graphical representation of the


blockchain network:

• Each internet-connected computer needs to have blockchain node


software and run an application specific to the blockchain
ecosystem.
• Depending on the use cases, the participation of these computers
can be restricted
• For example: Bankchain only permits banks to run the
bankchain node client application
9
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1

Who is using blockchain and how?


•In the current era of technology, blockchain has the
capability to enter any industry as a disrupter.
This could be to
 reduce operational expenditure
 overcome cybersecurity-related issues
 deliver identity and access management solutions
facilitate collaboration between private and public
institutions
enhance and simplify logistic and supply chain
management
allow a seamless insurance sales and management
system,
or
 deploy a better health record database system to
protect peopleMagainst any data
R Padma Priya Assistant Professor School of CS & IT
10
Module No.-1

Internet Vs. Blockchain


•The Internet is an information machine while the blockchain is a
truth machine.
•The blockchain’s data structure, along with a combination of
cryptography, timestamps and other technologies,
 ensures that once a piece of data is linked, it is not tampered
with or revoked, but is traceable.
 So blockchain is a truth machine compared to the Internet.
•Trust mechanism is the core difference: when the proportion of
digital economy and digital life becomes higher and higher, we may
no longer rely on the centralized trust mechanism to make a trust
endorsement in some environments and scenarios.
•Decentralized trust mechanism is more efficient and lower-cost.

11
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1

• Business applications on the Internet are centralized while the


ones on the blockchain are decentralized or called distributed.
• Evolution of computing

12
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1

IP Packet Vs. Block


•Everything we do over the internet goes through IP packets in the
TCP/IP model.
•An IP packet is the smallest unit of data that can be sent over the
internet.
•An IP packet has two components, an IP header and a payload.
•A block is the integral element for this process; it is chained together
to form a blockchain.
•A block also has two components, block header and block body.
•To send any type of value or transaction,
 it adds its own digital signature as the source identifier and public
key,
 which resembles the destination's identity in the peer-to-peer
network.

13
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1

Web app Vs. dApp


•A web app is simply a web-based application, which is widely
used in client-server models to serve users.
•However, a decentralized application (dApp) is an application
that runs on a peer-to-peer network of computers.
•The traditional web application uses CSS, HTML, and
JavaScript to render a frontend page.
•It fetches the data from a database through an API call.
•dApp's frontend uses the exact same technique to render the
page
•but instead of calling the API, dApp uses a smart contract
that connects to the blockchain.

14
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1

How Blockchain works

i) Transaction preparation:
At this stage, party A creates a transaction that includes information
including
 the public address of the receiver,
 a source digital signature, and
 a transaction message.
•Now, this transaction is made available to all of the nodes in the
blockchain.

15
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1
How Blockchain works (Contd…)
ii) Transaction Verification:
The blockchain nodes work in a trustless model,
 where each node (the machine running the blockchain client
software) receives this transaction, and
 verifies the digital signature with party A's public key.
After successful verification, this authenticated transaction is
parked in the ledger queue and
waits until all the nodes successfully verify the same transaction
iii) Block generation: The queued transactions are arranged together
and a block is created by one of the nodes in the network.
•In the Bitcoin blockchain, Bitcoins are rewarded when a Bitcoin
node, also known as a miner, creates a block by solving some
mathematically complex problem.
16
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1

How Blockchain works (Contd…)


iv) Block Validation:
After a successful block generation, nodes in the network are
processed for an iterative validation process where the majority of
the nodes have to acquire consensus.
There are four popular ways to achieve consensus,
 Proof of Work (PoW)
 Proof of Stack (PoS)
 Delegated Proof of Stack (DPoS) and
 Practical Byzantine Fault Tolerance (PBFT).
 Bitcoin uses PoW to achieve consensus; however, Ethereum uses
PoS for consensus.
 This mechanism impacts financial aspects and ensures the security
of all transaction operations.
17
M R Padma Priya Assistant Professor School of CS & IT
Module No.1

v) Block Chained: After a successful consensus mechanism, the blocks


are verified and are added to the blockchain.
States of blockchain

18
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1

The building Blocks of Blockchain


• Blockchain technology is built over a group of existing technologies
that have been widely used across the industry.
BLOCK
• A distributed ledger is stored in a database and updated by each
participant in the blockchain network.
• A ledger is represented in a series of units called blocks.
• The blockchain network consists of a network of several
independent machines named nodes.
• Blockchain nodes keep the copy of the entire database with an
administrative role.

19
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1

• Even if one node goes down, the information will remain


available for the other nodes, as shown in the following diagram:

20
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1

• The moment a node joins the blockchain network, it downloads


the updated blockchain ledger.
• Each node is responsible for managing and updating its ledger
with validated blocks.
• The node maintains the ledger and organizes it in the form of
blocks connected to the hashing algorithm, as shown in the
following diagram:

21
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1

• A block in a Bitcoin blockchain is generated every 10 minutes and


the size of each block is 1 MB,
• whereas a block in an Ethereum blockchain is generated every 12-
14 seconds, and the size of each block is 2 KB.

22
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1
BLOCK FORMAT
A block consists of a block header and a block body:
•Block header: A block header helps us identify a specific block in the
blockchain. It contains a set of metadata:
•Block body: This part of the block consists of a list of transactions. In
the Bitcoin world, one block consists of more than 500 transactions
on average.
Each transaction has to be digitally signed; otherwise, it is treated as
invalid.
To do that, a hashing function is used to apply the algorithm over an
actual transaction with a private key / secret key.
– Version: It's a 4-byte field that's used to track software or
protocol grades.
– Timestamp: This is a 4-byte field that indicates the creation time
of the block in seconds.
23
Module No.-1

– Hash of the previous block: This is a 32-byte field that indicates


the hash of the previous block in the chain.
– Nonce: This is a 4-byte field that's used to track the PoW
algorithm counter.
– Hash of Merkle root: This is a 32-byte field that is a hash of the
root of the Merkle tree of the block transaction.

24
Module No.-1

Cryptography – Digital signature and hashing algorithm


•Cryptographic hashing is a way to generate a fixed-length output
against any given length of input string.
•The output is named hash or message digest, and is designed to
protect the integrity of any kind of data, such as a file, media, or
text.
•A small change made to the input data results in a drastic
difference in the result,
 which makes it almost impossible to predict the data either in-

motion or at rest.
•The SHA-256 algorithm is used to produce a fixed-length 256-bit
hash or message digest against each block.

25
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1

• [Link]
.
• In blockchain, a node arranges the entire ledger in the form of
chronologically connected blocks.
• To ensure that the ledger remains tamper-proof, each block is
made dependable on the previous block.
• In other words, a new block can't be produced without having the
hash of a previous block.
• Before adding a new block in the ledger, this has to be approved
and verified by every node in the blockchain.
• This allows anyone to tamper or alter with the ledger except in the
case of a hacker, who is capable enough of infecting and
compromising all of the millions of nodes in the blockchain at the
same time.
26
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1

• Only the first block called the genesis block is produced itself and
points to itself.

27
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1

• Every block points to the hash of the previous hash block, and
this becomes the backbone of the blockchain's immutable system.
• Now, even if a block in between is altered or disturbed by any
means,
 a hacker can never achieve the same blockchain as a small
change in the block can result in a drastic change in the resulting
hash.

28
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1
Merkle Tree
•To avoid this complex work, a comprehensive hash tree has been
developed named the Merkle tree. The following diagram shows
the Merkle tree:

29
Module No.-1

• Digital signatures already work in the core of many organization's


security controls by proving the authenticity of transmitted data
and preventing forgery.
• Digital signatures ensure that transactions happen between two
validated and authenticated parties.
• In the physical world, everyone is identified by their unique and
permanent national identity number, such as a social security
number (SSN) in the US, a National Registration Identity
Card (NRIC) in Singapore, a National Insurance Number (NINO) in
the UK, a Unique Identification Authority of India (UIDAI) in India.
• In the digital world, digital signatures play a critical role in
guaranteeing transactions between two authenticated parties.

30
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1

31
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1
Consensus – the core of blockchain
•Consensus is an integral component of the blockchain system and is responsible
for achieving agreement in a distributed environment.
Four key methods
i) PoW: A new transaction is broadcast to all the nodes in the network, and
each node keeps listening to these transactions.
•Nodes that want to gain incentives through Bitcoin are known as miners, but
they don't just listen, they collect transactions.
•Miners have to solve some complex mathematical problems with a PoW
algorithm.
•Mathematical problem the process of achieving a desired hash with hashing
applied to a set of transactions and a nonce (a 32-bit random number)
•If the output results in a hash that is smaller than the target hash, the miner
wins the block and achieve the consensus.

32
Module No.-1 Etherum-Concept of Bitcoin Mining

Pr
ev
Ha
Da

sh
ta
No
nc
BLOCK

Ha

e
sh
The one who solves it first gets
rewarded with Bitcoin.
SHA-256
Finally, verified blocks are added Hashing
to the blockchain of every miner. Algorithm

Hash Value <


Puzzle Predefined
Keep on increasing
YES NO
Solved Condition the Nonce value

33
34
Consensus Models /Mechanism And trust
Frame Work

•Proof – of –Work Consensus Model

•Proof –of- Stake Consensus Model

•Proof of Authority/Proof of Identity Consensus


Model

•Proof of Elapsed Time Consensus Model


Proof – of –Work (PoW) Consensus Model
•In the proof of work (PoW) model, a user publishes the next block by
being the first to solve a computationally intensive puzzle.

•The solution to this puzzle is the “proof” of their performed work.

•The puzzle is designed such that solving the puzzle is difficult, but
checking that a solution is valid is easy.

•This enables all other nodes to easily validate any proposed next
blocks, and
 any proposed block that did not satisfy the puzzle would be
rejected.
•A common puzzle method is to require that the hash digest of a
block header be less than a target value.
Proof – of –Work (PoW) Consensus Model
• Publishing nodes make many small changes to their block header
(e.g., changing the nonce)
 trying to find a hash digest that meets the requirement.
 For each attempt, the publishing node must compute the hash for
the entire block header.
• Hashing the block header many times becomes a computationally
intensive process.

•The target value may be modified over time to adjust the difficulty
(up or down) to influence how often blocks are being published

• Adjustments to the difficulty target is done to ensure that no entity


can take over block production.
•When a user receive completed block from another user, they need to
discard it and proceed.
Proof – of –Work (PoW) Consensus Model
Example: consider a puzzle where, using the SHA-256 algorithm, a
computer must find a hash value meeting the following target criteria
(known as the difficulty level):

SHA256(“blockchain” + Nonce) = Hash Digest starting with


“000000”

SHA256("blockchain0") =
0xbd4824d8ee63fc82392a6441444166d22ed84eaa6dab11d492307597
5acab938 (not solved) SHA256("blockchain1") =
0xdb0b9c1cb5e9c680dfff7482f1a8efad0e786f41b6b89a758fb26d9e22
3e0a10 (not solved)

SHA256("blockchain10730895") =
0x000000ca1415e0bec568f6f605fcc83d18cac7a4e6c219a957c10c6879
d67587 (solved)
Proof – of –Work (PoW) Consensus Model
•To solve this puzzle, it took 10,730,896 guesses (completed in 54 seconds on
relatively old hardware, starting at 0 and testing one value at a time).

•In this example, each additional “leading zero” value increases the difficulty.
By increasing the target by one additional leading zero (“0000000”), the
same hardware took 934,224,175 guesses to solve the puzzle (completed in
1 hour, 18 minutes, 12 seconds):

•There is currently no known shortcut to this process

•Publishing nodes must expend computation effort, time, and resources to


find the correct nonce value for the target.

•Publishing nodes normally attempt to solve this computationally difficult


puzzle to claim a reward of some sort
(usually in the form of a cryptocurrency offered by the blockchain network).
Proof – of –Work (PoW) Consensus Model
• Once a publishing node has performed this work, they send their block with
a valid nonce to full nodes in the blockchain network.

•The recipient nodes verify that the new block fulfills the puzzle
requirement, then add the block to their copy of the blockchain and resend
the block to their peer nodes.

•In this manner, the new block gets quickly distributed throughout the
network of participating nodes. Verification of the nonce is easy since only a
single hash needs to be done to check to see if it solves the puzzle

•For many proof of work based blockchain networks, publishing nodes tend
to organize themselves into “pools” or “collectives” whereby they work
together to solve puzzles and split the reward.

•This is possible because work can be distributed between two or more


nodes across a collective to share the workload and rewards.
Proof – of –Work (PoW) Consensus Model
•Node 1: check nonce 0000000000 to 0536870911
•Node 2: check nonce 0536870912 to 1073741823
•Node 3: check nonce 1073741824 to 1610612735
•Node 4: check nonce 1610612736 to 2147483647

The following result was the first to be found to solve the puzzle:
SHA256("blockchain1700876653") =

0x00000003ba55d20c9cbd1b6fb34dd81c3553360ed918d07acf16dc9e75d7
c7f1

•This is a completely new nonce, but still one that solved the puzzle. It took
90,263,918 guesses (completed in 10 minutes, 14 seconds).

•Dividing up the work amongst many more machines yields much better
results, as well as more consistent rewards in a proof of work model.
Proof – of –Work (PoW) Consensus Model
•“Sybil Attack” – a computer security attack (not limited to blockchain
networks ) where an attacker can create many nodes (i.e., creating multiple
identities) to gain influence and exert control.

The proof of work model combats this by having

•Amount of computational power (hardware, which costs money)


•Mixed with a lottery system
•Network identities

[Link]
Proof of Stake (PoS) Consensus Model
•The proof of stake (PoS) model is based on the idea that the more
stake a user has invested into the system,
 the more likely they will want the system to succeed, and the
less likely they will want to subvert it.

• Stake is often an amount of cryptocurrency that the blockchain


network user has invested into the system
 through various means, such as by locking it via a special
transaction type,
or by sending it to a specific address, or
holding it within special wallet software).

• Once staked, the cryptocurrency is generally no longer able to be


spent.
Proof of Stake (PoS) Consensus Model
• Proof of stake blockchain networks use the amount of stake a user
has,
 as a determining factor for publishing new blocks.
• Thus, the likelihood of a blockchain network user publishing a new
block is tied to the ratio of their stake to the overall blockchain
network amount of staked cryptocurrency
• With this consensus model, there is no need to perform resource
intensive computations
 involving time
 electricity and
 processing power as found in proof of work.
• Since this consensus model utilizes fewer resources, some
blockchain networks have decided to forego a block creation reward;
• The reward for block publication is then usually the earning of
user provided transaction fees.

• Blockchain network uses the stake and can vary.

• There are four approaches:


i) Random selection of staked users
ii) Multi-round voting
iii) Coin aging systems and
iv) Delegate systems

• Regardless of the exact approach, users with more stake are


more likely to publish new blocks.
i) Random Selection:
•When the choice of block publisher is a random choice (sometimes referred to as
chain-based proof of stake),
 the blockchain network will look at all users with stake and choose amongst
them based on their ratio of stake to the overall amount of cryptocurrency
staked.
 So, if a user had 42% of the entire blockchain network stake they would be
chosen 42 % of the time; those with 1 % would be chosen 1 % of the time.

ii) Multi-round voting (Byzantine fault tolerance proof of stake)


When the choice of block publisher is a multi-round voting system there is added
complexity.
The blockchain network will select several staked users to create proposed
blocks.
Then all staked users will cast a vote for a proposed block.
Several rounds of voting may occur before a new block is decided upon. This
method allows all staked users to have a voice in the block selection process for
every new block.

46
iii) Coin Age System:
•When the choice of block publisher is through a coin age system referred
to as a coin age proof of stake,
 staked cryptocurrency has an age property.
•It is calculated by multiplying the number of coins by the average amount
of time in blocks they have been possessed.
•For example, 3 BTC that have been possessed for 4 days would have a
coin age of 12 BTC-days (3 x 4 = 12).
•Under Proof of Stake, possessing a higher coin age increases the chance
of mining a block.
•After a certain amount of time (such as 30 days) the staked
cryptocurrency can count towards the owning user being selected to
publish the next block.
•This method allows for users with more stake to publish more blocks, but
to not dominate the system

47
iv) Delegate System
•When the choice of block publisher is through a delegate system,
users vote for nodes to become publishing nodes therefore creating
blocks on their behalf.
•Blockchain network users’ voting power is tied to their stake so the
larger the stake, the more weight the vote has.
•Nodes who receive the most votes become publishing nodes and can
validate and publish blocks.
•Blockchain network users can also vote against an established
publishing node, to try to remove them from the set of publishing
nodes.
•Voting for publishing nodes is continuous and remaining a publishing
node can be quite competitive.
• The threat of losing publishing node status, and therefore
rewards and reputation is constant so publishing nodes are
incentivized to not act maliciously.

• Additionally, blockchain network users vote for delegates,


who participate in the governance of the blockchain.

49
Proof of Authority / Proof of Identity Consensus Model
• The proof of authority (also referred to as proof of identity)
consensus model relies on the partial trust of publishing nodes
through their known link to real world identities.
• Publishing nodes must have their identities proven and verifiable
within the blockchain network

• Example: Identifying documents which have been verified and


notarized and included on the blockchain.

• The idea is that the publishing node is staking its


identity/reputation to publish new blocks.

• Blockchain network users directly affect a publishing node’s


reputation based on the publishing node’s behavior.
Proof of Authority / Proof of Identity Consensus Model (Contd…)

• Publishing nodes can lose reputation by acting in a way that the


blockchain network users disagree with,
 just as they can gain reputation by acting in a manner that the
block chain network users agree with.

• The lower the reputation, the less likelihood of being able to


publish a block.

• Therefore, it is in the interest of a publishing node to maintain a


high reputation.

• This algorithm only applies to permissioned block chain networks


with high levels of trust.
Proof of Elapsed Time Consensus Model

Within the proof of elapsed time (PoET) consensus model, each


publishing node requests a wait time from a secure hardware time
source within their computer system.

The secure hardware time source will generate a random wait time and

return it to the publishing node software. Publishing nodes take the

random time they are given and become idle for that duration. Once a

publishing node wakes up


from the idle state, it creates and publishes a block to the blockchain
network and the entire process starts over.
This model requires ensuring that a random time was used, since if the time to wait
was not selected at random, a malicious publishing node would just wait the
minimum amount of time by default to dominate the system. This model also
requires ensuring that the publishing node waited the actual time and did not start
early.

These requirements are being solved by executing software in a trusted execution


environment found on some computer processors (such as Intel’s Software Guard
Extensions5, or AMD’s Platform Security Processor6, or ARM’s TrustZone).

Verified and trusted software can run in these secure execution environments and
cannot be altered by outside programs.

A publishing node would query software running in this secure environment for a
random time and then wait for that time to pass.

After waiting the assigned time, the publishing node could request a signed
certificate that the publishing node waited
the randomly assigned time.

The publishing node then publishes the certificate along with the block.
56
Ethereum
Ethereum is a decentralized blockchain with
smart contract functionality.

57
Module No.-1

Ethereum

•Ethereum is a decentralized network that has the capability of


running applications in a distributed environment.
•The idea is simply to avoid complete dependency on a single entity
to store and manage a user's personal and business data.
•In the current database system, once data is stored online, the
client has no information about how the data has been stored, what
security prevention measures have been taken, who can read the
data, and so on.
•Ethereum provides a platform to build distributed applications that
connect each stack holder or party directly to achieve better
transparency and zero-dependency.

58
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1

Ethereum

•Even with the fundamental similarities between both Bitcoin and


Ethereum, both notably differ in their purposes and capabilities.
•With Ethereum, any centralized services can be transformed into
decentralized services with its unique programming capability.
•There are basically three layers of Ethereum:
 the Ethereum Virtual Machine (EVM)
 the cryptocurrency ether, and
 gas

59
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1

Smart Contracts
•Smart contracts are programs stored on a blockchain that run when
predetermined conditions are met.
•They typically are used to automate the execution of an agreement
•Ethereum allows developers to code their own smart contracts.
Smart contracts can be used to do the following:
(i) Streamline the process of claim settlement by automatically
triggering a claim when certain events occur
(ii) Manage agreements between users
(iii) Storing information about application such as health records and
KYC information

60
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1

Smart Contracts
•In Ethereum, each contract is given an address so that it can be
uniquely identified.

•This address is calculated by hashing the creator's address and the


number of transactions that have been performed.

•When we deploy a smart contract into a public blockchain


environment, we get an address for our smart contract.
•We can write code to interact with a specific instance in the smart
contract.

61
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1
EVM (Ethereum Virtual Machine)
•EVM is a decentralized runtime environment for building and
managing smart contracts.
•In Ethereum, with every program, a network of thousands of computers
processes it.
•Smart contracts are compiled into bytecode, which a feature called
EVM can read and execute.
•All of the nodes execute this contract using their EVMs.
•Every node in the network holds a copy of the transaction and the
smart contract's history of the network
•EVM is responsible for executing a contract with the rules pre-
programmed by the developer.
•EVM computes this data through stack-based bytecode, whereas a
developer writes the smart contract in a high-level language, such as
Solidity or Serpent.

62
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1
Gas
•Gas - the fee required to execute a transaction on Ethereum, regardless of
transaction success or failure
•It costs a lot of energy when a smart contract is executed by every single
node in the Ethereum network.
•Because consumption of more energy costs more money, it is also
dependent on the level of smart contract programming.
•In other words, each low-level opcode in the EVM costs a specific amount
of gas to produce its desired output.
•Gas just indicates the cost of performing a computation and helps
developers understand energy consumption against their smart contract
code.
•Like the Bitcoin market, the value of gas is determined by the market.
•If a higher gas price is paid, the node will prioritize the transactions for
profit.

63
Module No.-1
dApp
•dApp uses incentives such as crypto-tokens and inbuilt consensus
mechanisms.
•A distributed application does not need to store all of its states;
 however, an Ethereum-based distributed application does store
trusted states, and this results in an economical solution for end
users.
•The dApp client is required to program the frontend, except the client
interfaces with the Ethereum blockchain.

•The dApp browser makes use of the dApp client, which is usually
written in JavaScript,
 to interface with an Ethereum node that then communicates with
a smart contract.

64
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1

dApp
• dApp ensures a connection with the Ethereum node and
provides an easy process to change the connection.

• It also provides an account interface for the user so that they can
easily interface with these dApp’s.

65
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1

Public Vs. Private blockchain

66
Module No.-1

Public Vs. Private Blockchain


•There are more than a thousand startups launching their products
with distributed blockchain applications.
•When it is about business, it is important to know best-fit solutions.
•From its birth, blockchain has been permissionless, open to the
public without exception.
•You can download the node software and view the entire history of
blockchain, initiate transactions, and store information.
•Public blockchains do carry some critical disadvantages when it
comes to business.
•Businesses are usually more interested in private blockchains to
create blockchain solutions with better privacy and security.

67
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1

Public Vs. Private Blockchain


•An organization that sets up a private blockchain configures it to
work as a permissioned network.

•It is built to provide better privacy over transactions and is suited for
banking and other financial institutions.

•Unlike a public blockchain, just connecting to the internet with a


blockchain node client will not be enough to initiate transactions;
 however, a consortium blockchain allows only specific and pre-
verified people to access and transfer any type of value over the
network.

68
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1

• In this system, the consensus mechanism is controlled and


managed by pre-selected groups of nodes.

• This way, even though the blockchain works in a public network,


it still remains restricted and can only be controlled and
maintained by specific groups of nodes, or may be even a single
node.

• Private blockchains can also be called consortium


blockchains based on their restrictions and control levels.

69
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1
Business Adaptation
•FinTech: Financial organizations are always in need of adapting an
emerging technology to solve key security challenges and enhance
user experience. Because of the risk of downtime (service
disruption) involved in technology refreshes, organizations
prefer to wait till they get feedback and use cases from the majority
of their industry players.
•InsurTech: In general, to fill up an insurance policy, there is a need
for a third-party such as a broker, an insurance company sales
person, or maybe a lawyer.
•Healthcare: Healthcare operations are more than just a standard
business operation. With increasing data breaches and
ransomware incidents in healthcare industries, it is critical
that they come up with a technology that facilitates security from
the foundation layer.
70
M R Padma Priya Assistant Professor School of CS & IT
Module No.-1

• Cybersecurity: Cyber criminals are becoming more and more


sophisticated, and organizations are in a race with them to
defend critical assets, such as
 trade secrets
 intellectual property and
 customer information
• Some of its use cases are as follows:
– Identity and access management
– DDoS protection
– Decentralized storage
– Protection against man-in-the-middle (MITM) attacks

71
M R Padma Priya Assistant Professor School of CS & IT
Cryptocurrency Basics
Cryptocurrency is a type of digital or virtual currency that uses
cryptography for security. Unlike traditional currencies issued by
governments (fiat currencies), cryptocurrencies operate on
decentralized networks based on blockchain technology.
Key Concepts:
•Decentralization: Cryptocurrencies are typically decentralized,
meaning they are not controlled by any central authority (like a
government or financial institution). Instead, they rely on a
network of nodes (computers) to validate and record
transactions.
•Blockchain: A blockchain is a distributed ledger that records all
transactions across a network of computers. Each block contains a
list of transactions and is linked to the previous block, forming a
chain. 72
• Cryptography: Cryptocurrencies use cryptographic
techniques to secure transactions, control the
creation of new units, and verify the transfer of
assets.
• Public and private keys are essential to this
[Link] and Demand: The value of a
cryptocurrency is driven by supply and demand.
Some cryptocurrencies, like Bitcoin, have a fixed
supply, which can contribute to their value.

73
Examples of Popular Cryptocurrencies:

• Bitcoin (BTC): The first and most well-known


cryptocurrency, created by an anonymous person or
group known as Satoshi Nakamoto.
• Ethereum (ETH): A cryptocurrency that supports
smart contracts and decentralized applications
(dApps) through its blockchain.
• Litecoin (LTC): Often considered the "silver" to
Bitcoin's "gold," Litecoin is a peer-to-peer
cryptocurrency with faster transaction times.

74
Wallets on the Blockchain

• A cryptocurrency wallet is a digital tool that allows


users to store, send, and receive cryptocurrencies.
Unlike physical wallets, cryptocurrency wallets
don't store the currency itself but the cryptographic
keys required to access and manage the
cryptocurrency on the blockchain.

75
Types of Wallets:

• Hot Wallets: Wallets that are connected to the internet.


They are convenient for everyday use but are more
susceptible to hacking.
• Examples include:Software Wallets: Applications or
programs that store keys on a computer or mobile device
(e.g., Electrum, Exodus).
• Web Wallets: Wallets accessed through a web browser,
provided by online services (e.g., Coinbase, MetaMask).
• Cold Wallets: Wallets that are not connected to the
internet.
76
• They are more secure but less convenient for frequent
transactions.
• Examples include:
– Hardware Wallets: Physical devices that store private keys
offline (e.g., Ledger Nano S, Trezor).
– Paper Wallets: Physical documents that contain printed keys
or QR codes. These are extremely secure if kept in a safe
place.

77
• Public Key: A cryptographic code that allows a user to
receive cryptocurrency. It is similar to a bank account
number and can be shared publicly.
• Private Key: A cryptographic code that allows a user
to access and manage their cryptocurrency. It must
be kept secure and private.
• Seed Phrase: A sequence of words generated by the
wallet that can be used to recover the wallet if lost. It
must be stored securely.

78
Cryptocurrency Transactions
• Cryptocurrency transactions involve the transfer of
digital assets from one wallet to another.
• These transactions are recorded on the blockchain,
ensuring transparency and security.
• Steps in a Cryptocurrency Transaction:
Initiation: The sender initiates a transaction by inputting
the recipient's public address, the amount to be
transferred, and possibly a transaction fee.

79
• Broadcasting: The transaction is broadcasted to the
network of nodes (computers) that make up the
blockchain.
• Validation: The network nodes verify the transaction
to ensure that the sender has sufficient funds and
that the transaction is valid.
• This process often involves solving complex
mathematical problems (Proof-of-Work) or staking
tokens (Proof-of-Stake).

80
• Mining (for Proof-of-Work Blockchains): Once
validated, the transaction is grouped with others into
a block, which is then added to the blockchain.
Miners (nodes that validate and add transactions to
the blockchain) are rewarded with newly created
cryptocurrency or transaction fees.
• Confirmation: Once the block is added to the
blockchain, the transaction is confirmed. Multiple
confirmations may be required for a transaction to be
considered secure and irreversible.
81
Creating a Cryptocurrency
• Creating a cryptocurrency involves several steps, from
defining its purpose and underlying technology to
launching it on the blockchain.
• Steps to Create a Cryptocurrency:
[Link] a Consensus Mechanism:Proof-of-Work
(PoW): Requires miners to solve complex problems to
validate transactions and create new blocks.
Proof-of-Stake (PoS): Validators are chosen based on the
number of tokens they hold and are willing to "stake"
as collateral.
82
[Link] on the Blockchain:
•You can either create a new blockchain from scratch or
use an existing platform like Ethereum to create a
token.
•Custom Blockchain: Requires extensive knowledge of
blockchain development. Examples include Bitcoin and
Ethereum.
•Existing Blockchain: Easier and quicker. You can create
a token using platforms like Ethereum (ERC-20
standard) or Binance Smart Chain.
83
[Link] the Nodes:
•Determine how nodes will operate in your network.
Nodes are responsible for validating transactions and
maintaining the blockchain.
•Decide whether your network will be public, private, or
consortium.

84
[Link] the Blockchain Architecture:
•Define how the blockchain will operate, including
transaction structure, block structure, and how new
blocks will be added.
•This step involves choosing the programming
language (e.g., C++, Python, Go) and creating the
necessary software.

85
[Link] Smart Contracts:
•If using a platform like Ethereum, you’ll need to
develop smart contracts that define the rules and
behavior of your cryptocurrency.
•Smart contracts are self-executing contracts with
the terms of the agreement directly written into
code.

86
6. Launch the Cryptocurrency:
•Once everything is developed and tested, you can
launch your cryptocurrency on the blockchain.
•This involves creating the genesis block (the first block
in your blockchain) and making your cryptocurrency
available for use.

87
Module No.-1

88

You might also like