Vous êtes sur la page 1sur 41

THE NEW TECHNOLOGY

OF TRUST

DITC 2: SPECIAL TOPICS SEMINAR


MARCH 9, 2019
Discussion Outline
1. The Emergence of Blockchain
2. What is Blockchain?
3. How does Blockchain work?
4. Immutability of Blockchain
5. Security, privacy and anonymity
6. Blockchain implementations
7. Demonstration
8. Hands-on and Case Study
The Emergence of Blockchain
Traditionally,
systems often rely
to a trusted
middleman to
complete
transactions with
other individuals
and groups.
The Emergence of Blockchain

Banks and Finance


Governance

Healthcare

Supply Chain Mgt


The Emergence of Blockchain
Shortcomings of the present system:
1. Cash is useful only in local transactions
2. Time between transactions can be long
3. Inefficiencies due to duplication of effort and need for
third party validation
4. Susceptibility to fraud, cyberattacks and security
vulnerabilities (i.e. bank system is compromise)
5. Failure of a centralized system would result to a domino
effect (i.e. 2008 global financial crisis)
The Emergence of Blockchain
The global financial crisis
in 2008 has paved way
for the introduction of
cryptocurrencies (i.e.
bitcoin) as a
countermeasure against
failure of central banking
systems
The Emergence of Blockchain
“Satoshi Nakamoto”
authored a 2008
whitepaper that proposes
the use of peer to peer
electronic cash payment
via digital currency called
bitcoin.
In 2009, Nakamoto
released the first bitcoin
software running using
blockchain technology.
What is Blockchain?
Blockchain is shared, distributed ledger that facilitates the
process of recording transactions and tracking assets in a business
network. An asset can be tangible (i.e. cash, land) or intangible (i.e.
patents, copyrights).

Rather than having a central administrator like banks, a


distributed ledger has network of replicated database,
synchronized via the internet and visible to anyone within the
network.
What is Blockchain?

Traditional A Blockchain Distributed,


Ledgers shared ledger
What is Blockchain?
What is NOT about Blockchain

Not Bitcoin Not A Product Not Distributed Not for high volume,
Database low value transactions

Not Really Private Not Solution to All Transaction Problems


What is Blockchain?
Characteristics of Blockchain:
1. Peer to peer - No central authority to control or
manipulate it.
2. Distributed - The ledger is spread across the whole
network which makes tampering not so easy.
3. Cryptographically Secured - used for the security services
to make the ledger tamper-proof
4. Add-Only - Data can only be added in the blockchain
with time-sequential order.
What is Blockchain?
Characteristics of Blockchain:
5. Consensus – for a transaction must be valid, all participants
must agree on its validity
6. Provenance – participants know where the asset came from
and how its ownership has changed over time
7. Immutability – no participant can tamper with a transaction
after it has been recorded to the ledger
8. Finality – a single, shared ledger provides one place to go
to determine the ownership of an asset or completion of
transaction
What is Blockchain?

Distributed versus
Centralized and
Decentralized
What is Blockchain?

Centralized control versus Decentralized Peer to Peer


What is Blockchain?

Use of Private Key to Encrypt and Transactions in blocks are coded


Public Key to Decrypt with hash codes
How does Blockchain Work?
Case Scenario 1: Tracking Vehicle Ownership

Tracking vehicle
ownership without
blockchain
How does Blockchain Work?
Case Scenario 1: Tracking Vehicle Ownership

Tracking vehicle
ownership with
blockchain
How does Blockchain Work?
Blockchain At Micro-Level View:
How does Blockchain Work?
Blockchain At Micro-Level View:
The shared ledger is composed of multiple
linked BLOCKS. Each block contains the
following elements at the least:
How does Blockchain Work?
Blockchain At Micro-Level View:
Data – contains details of In bitcoin, a data contains multiple
transaction like amount to be transactions. Transactions are added into
transferred, destination, the block until the 1MB size limit of it has
recipient, transaction time. been reached.
How does Blockchain Work?
Blockchain At Micro-Level View:

Hash – a unique digital signature of Regardless of the cryptographic


the block (fingerprint). Primarily used formula used to generate the hash, if
to linked blocks together and protect the data is altered, the hash code of
the integrity of the chain. the block would change.
How does Blockchain Work?
Blockchain At Micro-Level View:

Hash codes are created using A change in the input string would
cryptographic hash function (i.e SHA result in a change in the hash code:
256). Normal string inputs are
converted to a 64-character hash code Ex. String: You are awesome!
using this function. Hash:
2056193E4FC7C897B21603442169
Ex. String: You are awesome B8C7C8ED3CCF89752C5FFE4A9D28
Hash: E528575D
2423D0CA84C04B7155CA9AC1E919
4832EBCCBC42801F1A3C1C40892B
E6BB3673
How does Blockchain Work?
Chaining and linking blocks
Each block stores the hash code of the previous block. By storing the
previous hash code, a link is created between blocks.

First block is called the genesis block and has no previous hash code.
How does Blockchain Work?
Chaining and linking blocks
Previous hash also ensures that the integrity of the blockchain is secured.
Changing the data of a block would require changing the previous hash
codes of the succeeding blocks. Thus, BC is said to be immutable.
How does Blockchain Work?
Chaining and linking blocks
Previous hash also ensures that the integrity of the blockchain is secured.
Changing the data of a block would require changing the previous hash
codes of the succeeding blocks. Thus, BC is said to be immutable.
How does Blockchain Work?
Chaining and linking blocks
If there is a change in the data or a new block is to be added, the signature
needs to be qualify before it gets accepted in the block. For example:

1. Only blocks with a signature with seven leading zeroes can be accepted in
the blockchain.
2. As such, changes in the data is needed to be done repeatedly until the
prescribed signature format is achieved. It is impossible!
3. A small piece of data called NONCE is added to the block. It’s sole
purpose is have it changed repeatedly until the ideal signature format has
been achieved.
4. Repeatedly changing the NONCE is called MINING. Mining requires
computational power in order to achieve the right signature format.
How does Blockchain Work?
Chaining and linking blocks

Finding a hash like that is not easy, it requires a lot of computational


power and time (trial and error).
Immutability of Blockchain
Suppose a corrupt miner tries to alter a data in a block, is it
possible ?

No, because as the corrupt miner tries to modify the signature,


new blocks are being added by other miners. The corrupt miner
must have more computational power than the rest of the network
Security, Privacy and Anonymity of Blockchain
Blockchain makes use of cryptography
Private key – used for encryption
heavily to secure its data transactions.
Public key – used for decryption
The most common is the public key
cryptography
Security, Privacy and Anonymity of Blockchain
Blockchain can be classified as PUBLIC, CONSORTIUM and PRIVATE and
varies on access type, speed, security, identity and assets being processed.
Security, Privacy and Anonymity of Blockchain
PUBLIC BLOCKCHAINS:
1. No one is in-charge and anyone can participate in
writing/reading the blockchain (permisionless).
2. Open and transparent (i.e. anyone can review anything,
anytime)
3. Decision making happens via decentralized consensus
mechanism such as proof of work (POW) and proof of stake
(POS)
4. Transactions are transparent but anonymous / pseudonomous
5. Requires more computational power (i.e. slow processing)
6. Bitcoin is an example of a public blockchain
Security, Privacy and Anonymity of Blockchain
PRIVATE BLOCKCHAINS:
1. One organization/individual is in-charge of managing the
blockchain. Faster processing time of blocks
2. Writing and mining the blockchain requires consent from the
owner. Verifying chain done by a group of selected experts.
3. Read permissions may be public or restricted.
4. Partly centralized because authority is vested on a single
authority. Debatable if private BCs are really BCs.
5. Commonly used when data privacy is a top priority
6. Database management and auditing are fields where private
BCs could be applied.
Security, Privacy and Anonymity of Blockchain
CONSORTIUM BLOCKCHAINS:
1. Removes the sole autonomy vested on a single organization
2. A group of companies and individuals manages this type of
blockchain and makes decision for its operations.
3. Consensus is made via voting among the organizations before
a block of transaction is added
4. Only members of the consortium can read, write and mine the
blocks. Faster processing of block transactions
5. Banking, insurance, healthcare and energy are among the
fields the Consortium blockchain can be used.
Blockchain Implementations

1. Bitcoin – peer to peer electronic currency exchange

2. Ethereum – platform for running decentralized applications

3. HyperFabric Ledger – suite of blockchain tools developed by


Linux Foundation. Support mostly consortium blockchain
Quick Demonstration

1. Blockchain Demo on hash, block, blockchain and


distributed ledger – https://anders.com/blockchain/

2. Blockchain demo on peer networking –


https://blockchaindemo.io

3. Live Bitcoin, Bitcoin Cash and Ethereum Transaction –


https://blockchain.com
Hands-On: Building Simple Blockchain Using NodeJS

1. Ensuring node and npm are running OK


2. Initializing a genesis block
3. Calculating hash code
4. Adding elements to the block
5. Validating tampered blocks
6. Proof of work simulation
Hands-On: Building Simple Blockchain Using NodeJS
Ensuring node and npm are running OK:
1. Install the NodeJS. Open the command prompts (cmd).
2. To check node: type node –v
3. To check npm: npm –v
4. To check if npm executes, create a file ‘hello.js’ in your
Desktop.
5. Inside it, type console.log(‘Hello World!’);
6. At the command line, type node hello.js
Hands-On: Building Simple Blockchain Using NodeJS
Preparations:
1. Open Visual Studio Code (VSC)
2. Create a new Javascript file and save it as main.js in
your Desktop
3. Open the built-in terminal of VSC.
4. Install the crypto-js modules by typing the command:
npm install --save crypto-js
Hands-On: Building Simple Blockchain Using NodeJS
Let us start coding!
1. Create two classes called Block and Blockchain
2. Class Block will have a constructor and function
calculateHash()
3. Class BlockChain will have a constructor and functions:
createGenesisBlock(), getLatestBlock(), addBlock() and
isChainValid()
4. Initialize an object and invoke class functions
Hands-On: Building Simple Blockchain Using NodeJS
Exercise:
1. Modify the script such that the data will contain names
of 4 family member
2. Try to tamper one node by modifying a name of the
family member. The program should return FALSE.
3. Adjust the hashes to three leading zeroes
4. Display the time spent in coming up with a NONCE
THANK YOU FOR LISTENING!

Alison Perez
DITC2 (2nd semester, 2018-2019)
DIT, University of the Cordilleras
perez.alison@gmail.com

Vous aimerez peut-être aussi