0% found this document useful (0 votes)
7 views36 pages

Chuong 00

Uploaded by

vothanhvy12356
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)
7 views36 pages

Chuong 00

Uploaded by

vothanhvy12356
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/ 36

INTRODUCTION TO

“BLOCKCHAIN”
Blockchain và Crypto-Currency - Bitcoin
First Bitcoin’s event in October 2008
Source: https://bitcoin.org/bitcoin.pdf
Who is Satoshi Nakamoto?
Since 2008, after Bitcoin…
Blockchain và Crypto-Currency - Bitcoin

• Because Bitcoin was the first


application on the Blockchain
technology, one might say that Bitcoin
is Blockchain … .

• However, Blockchain is not Bitcoin.


So, what is Blockchain?

Blockchain : a chain of blocks that contains information


So, what is Blockchain?

Blockchain is a distributed ledger/data that is completely


open/decentralized to anyone. Once some data has been
recorded inside a blockchain, it becomes very dificult to
change it.
Each block contains what?
WHAT IS HASHING?

▪ Hashing is the practice of transforming a string of


characters into another value for the purpose of
security. Although many people may use the
terms hashing and encryption interchangeably,
hashing is always used for the purposes of one-way
encryption, and hashed values are very difficult to
decode.

▪ Hashing requires two components: a plaintext value


and a hashing algorithm. The application of the
algorithm against the plaintext value results in a
hashed output.
The hash value of the block

The hash value is always unique for each block,


like a fingerprint. Once a block is created, its hash is being caculated.
Changing something inside the block will cause the hash
to change. In other words, HASH is very useful when you want to detect
changes to blocks. If the fingerprint of a block changes,
it no longer is the same block.
EXAMPLE
HASH : Quan hệ giữa các Block

Interestingly, the blockchain stores the value of the previous block in


the form of a hash value for the current block. As a result, anyone
cannot change the block without modifying the following blocks. So changing a
block will make all the following blocks invalid.
Blockchain
Using hashes is not enough to prevent tampering

To mitigate this, blockchains have something called


proof-of-work
Proof-of-Work and the miner’s job

• Crypto miners create new blocks and validate them on a


cryptocurrency blockchain network alongside adding the
blocks to the chain.

• When miners work on validation of the blocks, they must


comply with the Proof-of-Work consensus mechanism
for adding the block to the cryptocurrency network.

• The blockchain NONCE is a crucial highlight for the


Proof of Work process and calls for attention from every
crypto user.
So, what is a NONCE?

• Nonce is basically an abbreviation for “number used


once”, and it is a random number you can use only once.
• The Nonce is a 32-bit field subject to adjustment by
miners for ensuring validity to use in hashing a block’s
value.
• The nonce is just a random number that miners use to
iterate the output of their hash calculations.
• After finding the perfect Nonce, miners can add it to the
hashed block.
How Does Nonce Work in Blockchain?
• In the case of Blockchain technology, a Nonce is basically
a pseudo-random number used primarily as a counter in
the mining process.

• For example, Bitcoin miners must try and guess the right
Nonce when they try multiple attempts for calculating a
block hash complying with specific requirements.

• The miners who successfully find a Nonce capable of a


valid block hash receive the right for adding the next
block in the blockchain. At the same time, the miners
receive rewards for finding the Nonce.
Example on estimating NONCE
using “trial and error method”

BLOCK 1
Consensus: the first 4 digits of HASH value must be below 1961 (target)
PREVIOUS HASH 0
TIMESTAMP FRI, 2 OCT 2018 10 : 30 : 00
GTM
DATA Mr Quang Thong TRUONG
opened c/a with Credit Suisse
Geneva
HASH 0985abc1370025abc98e00014
NONCE 46128
Example on estimating NONCE using tral
and error method

BLOCK 2
Consensus: the first 4 digits of HASH value must be below 1961 (target)
PREVIOUS HASH 000018a1370025abc98e00014
TIMESTAMP FRI, 2 OCT 2018 10 : 35 : 00
GTM
DATA Mr Quang Thong TRUONG’s c/a
was credited USD10,000,000
transferred from UBS Paris
HASH ?
NONCE ?
Example on estimating NONCE using tral and error method
NONCE VALUE HASH VALUE OF BLOCK 2
1 5a16sr0025sxt45362stuvbc912

2 7531sr0025sxt45362qtrsbc98e
3 5abcsr0025sxt45362qtrsbc98e

… …
18 9631sr0025sxcd5362qtrsbc123

… …
593255 29xyabc1370025abc98e00014

….

75320 1531sr0025sxt45362qtrsbc98e
Difficulty in Finding Nonce

▪ The random of 32-bit string is very difficult to guess through a trial


and error approach.

▪ Miners must guess the valid nonce and add it to the hash of the
existing header, followed by rehashing the value and comparing the
value to the target hash.

▪ Miners must have heavy-duty computing resources which can


contribute their processing power to the cryptocurrency blockchain.

▪ When the resulting hash value meets the requirements, miners can
receive rewards for the block.
Bitcoin: Miners in average to spend 10mn to
estimate the PoW capable to add a new block
Blockchain

In sum, HASH và PoW are the two


technological solutions to secure
BLOCKCHAIN.

But, that is still not ENOUGH !


Blockchain and P2P

Instead of using a central entity to manage the chain,


blockchains use a peer-to-peer, and anyone is allowed to join..
Blockchain and P2P

When someone joins this network, he gets


the full copy of the blockchain.
Blockchain and P2P

The node can use this to verify that everything is still in order
Blockchain and P2P

The new block is send to everyone on the network


Blockchain and P2P

Each node then verify the block the make sure


that it hasn’t been tampered with
Blockchain and P2P

If eveything checks out, each node adds this block to their


own blockchain. All the nodes in this network create consensus
Blockchain and P2P

They agree about what blocks are valid and which aren’t.
Blocks that are tampered with will be rejected by other nodes
in the network.
Blockchain and P2P

• So, to successfully tamper with a blockchain,


you’ll need to tamper with all blocks on the
chain, redo the proof-of-work and take control
more than 50% of the P-2-P.

• Only then will your tampered block become


accepted by everyone else.

You might also like