Session 5 - Tareq Shaheen

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 30

Talent & Technology Symposium 2018

Presenter: Tareq Shaheen


Title: Under the Hood of Blockchain - Beyond The Basics
Date: Wednesday, 13 June 2018
Agenda

• Recap of Blockchain Basics


• Hash Function
• Merkle Tree
• Block Structure
• How are Blocks Chained
• Consensus
• Smart Contract
• FlightChain: Blockchain Use Case
• GDPR Regulation: A challenge for Blockchain?
• The Best “Feature” of Blockchain is …
What is Blockchain

• Blockchain is a special kind of database that is replicated on


every node of a network.

• The blockchain database represents a digital ledger that:


o Stores transactions.
o Replicated, shared and synchronized across multiple
nodes/locations.
o Immutable: no delete, append only.
o Secured by cryptography.
Two Types of Blockchain

Public Blockchain Blockchain for Business

aka Permission-less Permissioned Blockchain,


Blockchain Private Blockchain
Membership Open Restricted

Transactions Anyone can view all Only members can view the
Visibility ledger transactions transactions they are
authorized to view

Domain Not suitable for regulated Enterprise and business


business
Example Bitcoin blockchain Hyperledger Fabric
Blockchain and Bitcoin

• Bitcoin is a cryptocurrency and a payment system.


• Bitcoin uses blockchain as its transactions database.
• Bitcoin is the first use case of blockchain.
• Bitcoin blockchain is a public blockchain.

Business
Bitcoin
Application

Public Blockchain for


Blockchain Business
Distributed Ledger Technology

• Distributed Ledger Technology (DLT) and Blockchain are used


interchangeably .
• There are technical differences and many arguments on who is
who.
• Every blockchain is a DLT, but not every DLT is blockchain.

DLT

Blockchain
Blockchain Network

• Peer to peer network: every computer is indirectly connected to


all other nodes.

Stellar blockchain P2P network*

*Source: stellar.org
Cryptographic Hash Function

• A cryptographic hash function converts an input text to a fixed


length string of bits called a hash. It has the following properties:

 A slight change in the input text changes the resulting hash.


 Practically impossible to find the original text from the hash.

• SHA-256 is a commonly used hash function.


• Example: SHA-256(“Hello World) =
A591A6D40BF420404A011733CFB7B190D62C65BF0BCDA32B57B277D9AD9F146E
Merkle (Hash) Tree

• Merkle Tree is a data structure that summarizes and verifies


integrity data.
• A hash function is applied to transaction data.
• A Merkle tree is constructed as follows:
– Apply a hash function to each transaction data.
– For each pair of adjacent transactions, concatenate the
resulting hashes and apply the hash function.
– This is repeated until we reach the root.
• Merkle tree is used in every block of a blockchain.
Merkle (Hash) Tree

Merkle Root
(Root of all hashes)
Merkle Tree / Blockchain

• In a blockchain:
– Every block stores the Merkle root of all the transactions it
has.

– Since any change in a transaction would change the hash


values and the resulting Merkle root, any modification on the
transactions data can be easily detected.

– No need to check transactions one by one: just calculate and


compare hashes. A changed hash means transactions were
tampered with.
The “Block”: Structure

• Header:
– Block Number.
– Timestamp.
– Hash of the previous block's header
– Merkle Root: Hash of this block’s transactions
• A batch of transactions.
The “Block” – Transactions

• An imaginary Transfers Blockchain Network.


• Block Transactions:

1: Ahmad transfers $1000 to Mary


2: Praveen transfers $2000 to James
3: Ching transfers $1500 to Tim
4: Amanda transfer $3000 to Yaser
The “Block” - Content
C2CC22B53AD1CA57 95AB2ADFE85C4DCBEE
DF394B2435EFD62C0 1975 3905AB5C6EB2C239C31
9C5CAEAA296A28F6 A8DDDEB6ED98E937B6
Block Header A336C29B9DF5179 A0414A41B
Unique
Hash of the previous Block Hash of this block’s
block's header Number transactions
(Merkle Root)

1: Ahmad transfers $1000 to Mary

Block 2: Praveen transfers $2000 to James


Transactions 3: Ching transfers $1500 to Tim
4: Amanda transfer $3000 to Yaser

Block Block creator information and digital signature


Metadata

*Some fields were omitted for simplicity.


**Block structure can vary from one blockchain platform to another.
The “Block”: Design Considerations

• Block structure can vary from one blockchain platform to another.

• Number of transactions per block varies depending on maximum


allowed block size and size of transactions data.

• Can the block transactions themselves be encrypted?


– Yes, private blockchains do that.
The “Chain”
Hash of
the 1974
previous
block's
header

Block 1974 transactions Hash of


the 1975
previous
block's
header

1: Ahmad transfers $1000 to Mary


2: Praveen transfers $2000 to James Hash of
3: Ching transfers $1500 to Tim the 1976
4: Amanda transfer $3000 to Yaser previous
block's
header

Block 1976 transactions


Hash of
the 1977
previous
block's
header

Block 1977 transactions

Each block contains a hash of its predecessor block header.


How is a Block added to the Chain?

• Nodes create truncations and digitally sign them,


• Nodes broadcast transactions to the blockchain network.
• Transactions are propagated to immediate peers.
• When a node receives a transaction, it will verify its digital signature
and that it adheres to this blockchain’s rules. If it is valid, it will be
relayed to the next immediate peer until it reaches all nodes.
• Validator nodes group transactions relayed to them to create a new
block.
• Validating nodes agree on the new block using a consensus algorithm.
• The new block is published to the network.
• Nodes add the new block.
Consensus: Accepting New Transactions

• In a Blockchain network:
– Each node keeps an identical copy of the ledger.
– Nodes can issue new transactions.
– There is no central authority to validate new transactions.

• So how do nodes agree on new transactions?


– Consensus answers this question.
• Each blockchain platform has its own consensus algorithm.
• Hyperledger allow a pluggable consensus.
The Value of Consensus in Blockchain

• Consensus provides the following:

– Ensures transactions on the ledger are the same for all


nodes in the blockchain network.

– Prevents invalid transactions in the absence of a trusted


authority.
Examples of Consensus Algorithms

• Proof-of-Work (PoW) or Mining


• Proof-of-Stake (PoS)
• Practical Byzantine Fault Tolerance (PBFT)
• Proof-of-Authority (PoA)
• Federated Byzantine Agreement (FBA)
Proof-of-Work (PoW) or Mining

• Used in public blockchain, like bitcoin.


• Miners compete to find a number that makes the hash of the block
begin with a certain number of zeros.
• The node that finds the number adds the new block to the chain.
• A computing intensive process, which reflects into consumption of
electricity.
• The computational power needed increases over time.
• Miners “invest” this electricity in the hope of being the first to find the
number and win a reward (currently it is 12.5 bitcoins)
• Called mining because it introduces new bitcoins into the network.
Proof-of-Authority Consensus

• Used in private blockchains.


• Voting based.
• Transactions are valid if the majority of validating nodes agree
on them.
• Validating nodes: Specific nodes have the authority to validate
transactions and create new blocks.
• Other nodes depend on those nodes to achieve consensus
among themselves on the state of the ledger.
Smart Contract

• A computer program that is executed when conditions are satisfied.


• Automatically enforced, Self-executing.
• It can read and write transactions on the blockchain.
• In some aspects, it is similar to stored procedure executed by a trigger
in a relational database.
• A simple example:
– If the receiving party of a transfer is a charity, create a new
transaction on blockchain to reverse fees.
• Smart contract can add power to blockchain by enforcing real-life
contractual obligations.
Beyond the Technical Details

• Interesting Blockchain Use Case in Aviation


• GDPR Challenge for Blockchain.
• The Best “Feature” of Blockchain is …
FlightChain: Blockchain for Aviation

• An interesting blockchain for business POC.

• Business problem: The flight data problem is a common issue in


aviation: there is no single source for flight data and the
available data is not easily accessed by all parties.

• How would blockchain help:


– Create a “single source of data” for real-time flight data.
– Ensure all stakeholders have access to the same source of
accurate data: the blockchain ledger.
FlightChain: Blockchain for Aviation

• Blockchain Participants: British Airways, Geneva Airport, Heathrow


Airport and Miami International Airport.

• Each participant was granted permission to feed in live updates relating


to certain stages of the journey. For example:
– Airline updates flight data.
– Departure airport updates departure gate.
– Arrival airport updates arrival gate.

• This approach means data on the blockchain came from the most
reliable source.
FlightChain: Blockchain for Aviation

*Source: SITA
https://www.sita.aero/resources/type/white-papers/flightchain-shared-control-of-data
GDPR and Blockchain

• GDPR: General Data Protection Regulation – European Union.


• Enforced on 25 May 2018
• GDPR:
– Right for individuals to have personal data erased (aka the right to be
forgotten).
– Personal data is not to leave the EU.
• Blockchain:
– Immutable: no delete.
– Distributed, possibly across continents.
• Keep in mind that blockchain might bring regulatory and legal challenges with
respect to data privacy.
• Easier to handle such challenges in a private blockchain for business.
The Best Feature of Blockchain is …

• Blockchain triggered a new wave of re-thinking how systems


and business processes interact and how they can be
optimized: with Blockchain or without it!
Thank you

Questions?

www.PMI.org

You might also like