KEMBAR78
2.blockchain Types | PDF | Finance & Money Management | Technology & Engineering
0% found this document useful (0 votes)
16 views62 pages

2.blockchain Types

The document discusses blockchain architecture and peer-to-peer networks. It defines blockchain and describes the skills required for blockchain development. It also covers key characteristics of blockchain architecture including cryptography, immutability, and decentralization. Additionally, it discusses concepts like distributed ledgers, cryptographic hash functions, and different types of peer-to-peer networks.

Uploaded by

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

2.blockchain Types

The document discusses blockchain architecture and peer-to-peer networks. It defines blockchain and describes the skills required for blockchain development. It also covers key characteristics of blockchain architecture including cryptography, immutability, and decentralization. Additionally, it discusses concepts like distributed ledgers, cryptographic hash functions, and different types of peer-to-peer networks.

Uploaded by

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

Introduction of

1
Instructor : Ahmed Abbas
What is Blockchain?

“A blockchain is a tamper-evident, shared digital ledger


that records transactions in a public or private peer to peer
network. Distributed to all member nodes in the network,
the ledger permanently records, in a sequential chain of
cryptographic hash-linked blocks, the history of asset
exchanges that take place between the peers in the
network .”

(Brakeville and Perepa, 2018).

2
https://www.youtube.com/watch?v=qOVAbKKSH10
Skills Required to Build Blockchain Architecture

• To be a blockchain developer is a demanding task that


requires a lot of technical skills and a complex background.
Generally, in order to work with blockchain architecture, a
strong background in Computer Science or Engineering is most
desirable. As well, knowledge pertaining the following ;
• Consensus methods
• Data structures
• Decentralized ledgers
• Cryptographies and cryptocurrencies
• Data security

3
Key Characteristics of Blockchain Architecture

• Cryptography - blockchain transactions are validated and


trustworthy due to the complex computations and
cryptographic proof among involved parties
• Immutability - any records made in a blockchain cannot be
changed or deleted
• Provenance - refers to the fact that it is possible to track the
origin of every transaction inside the blockchain ledger
• Decentralization - each member of the blockchain structure
has access to the whole distributed database. As opposed to
the central-based system, consensus algorithm allows for
control of the network
4
Key Characteristics of Blockchain Architecture

• Anonymity- each blockchain network participant has a


generated address, not user identity. This keeps users'
anonymity, especially in a public blockchain structure
• Transparency - the blockchain system cannot be corrupted.
This is very unlikely to happen, as it requires huge computing
power to overwrite the blockchain network completely

5
Core Concepts

6
Distributed ledgers
“A distributed ledger
technology (DLT) is a system
where we share information
and we don’t trust each
other individually, but we
trust the group as a whole.
DLTs allow us to come up
with a consensus on the
order of transactions and
timestamps.”

https://hackernoon.com/an-overview-of-hashgraph-b0900a1fd7bf
Cryptographic hash functions
“a mathematical algorithm
that maps data of arbitrary
size to a bit string of a
fixed size (a hash) and is
designed to be a one-way
function..”
- Algorithms:
- MD5, SHA1
(unsuitable)
- SHA2 (SHA-256 and
SHA-512)
- SHA3, BLAKE2
- Signatures
https://en.wikipedia.org/wiki/Cryptographic_hash_function
What is Peer to Peer (P2P)
• In computer science, a peer-to-peer (P2P) network consists of
a group of devices that collectively store and share files. Each
participant (node) acts as an individual peer. Typically, all
nodes have equal power and perform the same tasks.
• In financial technology, the term peer-to-peer usually refers
to the exchange of cryptocurrencies or digital assets via a
distributed network. A P2P platform allows buyers and sellers
to execute trades without the need for intermediaries. In
some cases, websites may also provide a P2P environment
that connects lenders and borrowers

9
How does P2P work?
• In essence, a P2P system is maintained by a distributed
network of users. Usually, they have no central administrator
or server because each node holds a copy of the files - acting
both as a client and as a server to other nodes. Thus, each
node can download files from other nodes or upload files to
them. This is what differentiates P2P networks from the more
traditional client-server systems, in which client devices
download files from a centralized server.

10
Peer-peer networking
Focus at the application level
Unstructured P2P networks
• Unstructured P2P networks don’t present any specific
organization of the nodes. The participants communicate
randomly with one another. These systems are considered robust
against high churn activity (i.e., several nodes frequently joining
and leaving the network).

• Although easier to build, unstructured P2P networks may require


higher CPU and memory usage because search queries are sent
out to the highest number of peers possible. This tends to flood
the network with queries, especially if a small number of nodes
is offering the desired content.

12
Structured P2P networks
• In contrast, structured P2P networks present an organized
architecture, allowing nodes to efficiently search for files,
even if the content is not widely available. In most cases,
this is achieved through the use of hash functions that
facilitate database lookups.

• While structured networks may be more efficient, they tend


to present higher levels of centralization, and usually require
higher setup and maintenance costs. Other than that,
structured networks are less robust when faced with high
rates of churn.

13
Hybrid P2P networks
• Hybrid P2P networks combine the conventional client-server
model with some aspects of the peer-to-peer architecture.
For instance, it may design a central server that facilitates the
connection between peers.

• When compared to the other two types, hybrid models tend


to present improved overall performance. They usually
combine some of the main advantages of each approach,
achieving significant degrees of efficiency and
decentralization simultaneously.

14
Distributed vs. decentralized
• Although the P2P architecture is inherently distributed, it’s
important to note that there are varying degrees of
decentralization. So, not all P2P networks are decentralized.

• In fact, many systems rely on a central authority to guide the


network activity, making them somewhat centralized. For
instance, some P2P file-sharing systems allow users to search
and download files from other users, but they are unable to
participate in other processes, like managing search queries.

• In addition, small networks controlled by a limited user base


with shared goals could also be said to have a higher degree of 15
centralization, despite the lack of a centralized network
infrastructure.
The role of P2P in blockchains
• In the early stages of
Bitcoin, Satoshi Nakamoto
defined it as a “Peer-to-
Peer Electronic Cash
System.” Bitcoin was
created as a digital form of
money. It can be
transferred from one user
to another through a P2P
network, which manages a
distributed ledger called
blockchain.
16
https://www.binance.vision/blockchain/peer-to-peer-networks-explained
Advantages
• The peer-to-peer architecture of blockchains provides many
benefits. Among the most important is the fact that P2P
networks offer greater security than traditional client-server
arrangements. The distribution of blockchains over large
numbers of nodes renders them virtually immune to the
Denial-of-Service (DoS) attacks that plague numerous systems
• Likewise, because a majority of nodes must establish
consensus before data is added to a blockchain, it's almost
impossible for an attacker to alter the data. This is especially
true for big networks like the one of Bitcoin. Smaller
blockchains are more susceptible to attacks because one
person or group could eventually achieve control over a
majority of nodes (this is known as a 51 percent attack). 17
Advantages
• Beyond security, the use of P2P architecture in
cryptocurrency blockchains also renders them resistant to
censorship by central authorities. Unlike standard bank
accounts, cryptocurrency wallets can’t be frozen or drained
by governments. This resistance also extends to censorship
efforts by private payment processing and content platforms.
Some content creators and online merchants adopted
cryptocurrency payments as a way to avoid having their
payments blocked by third parties.

18
Limitations
• Because distributed ledgers must be updated on every single
node instead of on a central server, adding transactions to a
blockchain requires a massive amount of computing power.
While this provides increased security, it greatly reduces
efficiency and is one of the main obstacles when it comes to
scalability and widespread adoption
• Another potential limitation relates to attacks that may arise
during hard fork events. Since most blockchains are
decentralized and open source, groups of nodes are free to
copy and modify the code and split away from the main chain
to form a new, parallel network. Hard forks are completely
normal and not a threat on their own. But if certain security
methods are not adopted properly, both chains may become 19
vulnerable to replay attacks.
Blockchain Architecture

20
Blockchain Network Types

21
• https://www.iltanet.org/blogs/deborah-dobson/2018/02/13/the-4-types-of-blockchain-networks-explained?ssopc=1
Semi Private Blockchain
• Semi-private blockchains are run by a single
company who grants access to any user who
qualifies, and they typically target business-to-
business users.
• They will be similarly managed as a company
would manage private web applications.
• Examples of semi-private blockchains could
include ones for government entities for record-
keeping, land titles, public records, etc
22
Semi Private Blockchain
• Advantages
• Launching a semi-private blockchain more closely resembles
how a company runs a website.
• The business case is typically well planned ahead of
implementation, and supports existing business, thus lowering
the risk of failure.

23
Consortium blockchain
• A consortium blockchain is a blockchain where
the consensus process is controlled by a pre-
selected set of nodes, for example, a consortium
of 15 financial institutions, each of which
operates a node and of which 10 must sign every
block in order for the block to be valid. The right
to read the blockchain may be public, or
restricted to the participants. Some examples of
consortium blockchains include R3 (banks) and
EWF (Energy). Consortium blockchains are also
24
referred to as federated blockchains.
Consortium blockchain
• Advantages
• Reduces transaction costs and data redundancies
• Replaces legacy systems, simplifying document handling and
getting rid of semi manual compliance mechanisms

• NOTE: The main difference between Private and Consotium is that


consortium blockchains are governed by a group rather than a single entity. 25
Public blockchain
• A public blockchain is a blockchain that anyone in the world
can read, send transactions too and expect to see them
included if they are valid, and anyone can participate in the
consensus process – the process for determining what blocks
get added to the chain and what the current stat is.
• Public blockchains are secured by cryptoeconomics – the
combination of economic incentives and cryptographic
verification using mechanisms such as proof of work (Bitcoin)
or proof of stake (Ethereum). These blockchains are generally
considered to be “fully decentralized.” One of the drawbacks is
the substantial amount of computational power necessary to
maintain a distributed ledger at a large scale.
26
Public blockchains
• Advantages
• Public blockchains provide a way to protect the users of an
application from the developers, establishing there are certain
things that even the developers of an application have no
authority to do.
• Because public blockchains are open, they are likely to be used
by very many entities, with no third-party verification
necessary.

27
Private blockchain
• A fully private blockchain is a blockchain where write
permissions are kept to one organization. Read
permissions may be public or restricted to certain
participants.

28
Private blockchain
• Advantages
• The consortium or company running a private blockchain can
easily change the rules of a blockchain, revert transactions,
modify balances, etc. For example, in some case, such as
national land registries, this functionality is necessary.
• The validators are known, so any risk of a 51% attack from
some miner collusion does not apply.
• Transactions are cheaper, since they only need to be verified
by a few nodes that can be trusted to have very high
processing power with no need to be verified by 10,000
nodes.
• Since read permissions are restricted, private blockchains
29
provide a greater level of privacy.
Summary
Consortium
Property Public blockchain Private blockchain
blockchain
Consensus Selected set of Within one
All miners
determination nodes organization
Read permission Public Public or restricted Public or restricted
Almost impossible to
Immutability level Could be tampered Could be tampered
tamper
Efficiency (use of
Low High High
resources)
Centralization No Partial Yes
Consensus process Permissionless Needs permission Needs permission

30
Why do we need blockchain
technology?

31
Why need Blockchain?
• A Digital Ownership Revolution

• Keeping Your ID and Personal Information Secure

• Digital Freedom

• It will Become Part of our Daily Lives like internet

• Save Commissions

• A Horizon of New Possibilities


32
33
How Blockchain works?
A wants to send The transaction is The block is broadcast to every
money to B represented as block node in the network

?
? ?

? ?
A
Sufficient miners approve The transaction is added
the transaction to Blockchain B receives the money

 

 B
W

35
36
37
38
39
Blockchain Advantages

Speed Security Efficiency

Faster transaction Less required oversight Immutable records, pre-


times venting tampering and
fraud

Involvement of fewer Improved trust among


intermediaries members

Less duplication effort Privacy (e.g. in private


permissioned blockchains)
40
41
Blockchain Hashing

42
Hash Function
• A hash function is any function that can be used to map data of
arbitrary size to data of fixed size¹.
• If a hash function is secure, its output is indistinguishable from
random.

• Example:
keccak256("hello") =
1c8aff950685c2ed4bc3174f3472287b56d9517b9c948127319a09a7a36deac8
keccak256("hello1") =
57c65f1718e8297f4048beff2419e134656b7a856872b27ad77846e395f13ffe

43
Cryptographic Hash Function

• A cryptographic hash function is a mathematical equation


that enables many everyday forms of encryption. This
includes everything from the HTTPS protocol to payments
made on e-commerce websites. Cryptographic hash
functions are also used extensively in blockchain
technology

• A cryptographic hash function is just a mathematical


equation. You may remember learning a few equations in
high school, such as linear equations of the form y=mX+b
or quadratic equations of the form y=aX2+bX+c.

44
Cryptographic Hash Function Properties

Property #1: Computationally Efficient

• First and foremost, hash functions must be computationally


efficient. This is just a fancy way of saying that computers
must be able to perform a hash function’s mathematical
labor in an extremely short period of time.

• This property is probably somewhat obvious. If an ordinary


computer needed several minutes to process a
cryptographic hash function and receive the output, it
would not be very practical. To be useful, hash functions
must be computationally efficient.
45

• .
Cryptographic Hash Function Properties

Property #2: Deterministic


• Cryptographic hash functions must be deterministic. In
other words, for any given input, a hash function must
always give the same result. If you put in the same input
ten million times in a row, a hash function must produce
the same exact output ten million times over.

• This may also be rather obvious. If a cryptographic hash


function were to produce different outputs each time the
same input was entered, the hash function would be
random and therefore useless. It would be impossible to
verify a specific input, which is the whole point of hash
functions— to be able to verify that a private digital 46
signature is authentic without ever having access to the
private key.
Cryptographic Hash Function Properties

Property #3: Pre-Image Resistant

• The output of a cryptographic hash function must not reveal


any information about the input. This is called pre-image
resistance.

• It’s important to note that cryptographic hashing algorithms


can receive any kind of input. The input can be numbers,
letters, words, or punctuation marks. It can be a single
character, a sentence from a book, a page from a book, or an
entire book.
47
• However, a hash function will always produce a fixed-length
output.
Cryptographic Hash Function Properties

Property #4: Collision Resistant

• The final property that all cryptographic hash functions must


have is what’s known as collision resistance. This means that it
must be extremely unlikely— in other words, practically
impossible— to find two different inputs that produce the
same output.

• As noted above, the inputs to a hash function can be of any


length. This means there are infinite possible inputs that can
be entered into a hash function.
48
One way Hashing
• Hash functions are often called one-way functions because,
according to the properties listed above, they must not be
reversible. If an attacker could easily reverse a hash function,
it would be totally useless. Therefore, cryptography requires
one-way hash functions.

• The best way to demonstrate a one-way function is with a


simple modular function, also called modular arithmetic or
clock arithmetic. Modular functions are mathematical
functions that, put simply, produce the remainder of a division
problem.

49
One way Hashing
• So, for example, 10 mod 3 = 1. This is true
because 10 divided by 3 is 3 with a
remainder of 1. We ignore the number of
times 3 goes into 10 (which is 3 in this
case) and the only output is the
remainder: 1.
• Let’s use the equation X mod 5 = Y as our
function. Here’s a table to help get the
point across:
• You can probably spot the pattern. There
are only five possible outputs for this
function. They rotate in this order to
infinity. 50
Standard Hashing Alogorithms

There are several different classes of hash functions. Here


are some of the most commonly used:

• Secure Hashing Algorithm (SHA-2 and SHA-3)


• RACE Integrity Primitives Evaluation Message Digest
(RIPEMD)
• Message Digest Algorithm 5 (MD5)
• BLAKE2

• SHA-256 is perhaps the most famous of all cryptographic hash


functions because it’s used extensively in blockchain technology. 51
It is used in Satoshi Nakamoto’s original Bitcoin protocol.
Patterns of Hashing Data

• Independent Hashing
• Repeated Hashing
• Combined Hashing
• Sequential Hashing
• Hierarchical Hashing

52
Independent Hashing

53
Repeated Hashing

54
Combined Hashing

55
Sequential Hashing

56
Hierarchical Hashing

57
58
Hashing & Mining
The process of new coin generation is called
mining because the reward is designed to
Part1 Hashing simulate diminishing returns, just like mining
for precious metals. Bitcoin’s money supply is
created through mining. The amount of newly
created bitcoin a miner can add to a block
Part-2 Hashing
decreases approximately every four years (or
precisely every 210,000 blocks). It started at
50 bitcoin per block in January of 2009 and
halved to 25 bitcoin per block in November of
2012. It will halve again to 12.5 bitcoin per
block sometime in 2016. Based on this
formula, bitcoin mining rewards decrease
exponentially until approximately the year
2140, when all bitcoin (20.99999998 million) 59
will have been issued. After 2140, no new
bitcoins will be issued.
Merkle Tree

60
Merkle Tree

61
62

You might also like