Blocchain Fundamentals Module1
Blocchain Fundamentals Module1
Blocchain Fundamentals Module1
• Books
https://www.elsevier.com/books/the-blockchain- https://www.routledge.com/Probabilistic-Data-
technology-for-secure-and-smart-applications-across- Structures-for-Blockchain-Based-Internet-of-Things-
industry-verticals/kumar/978-0-12-821991-1 Applications/Kumar-Miglani/p/book/9780367529901
Table of Contents
● Introduction
1. Blockchain terminologies
2. Distinction between databases and blockchain ledgers
● Cryptographic component
1. Cryptography, hash functions and digital signatures
● Consensus components
1. Principles and paradigms of distributed systems
2. Blockchain consensus algorithms
● Blockchain structures
1. Blockchain structure
2. Types of blockchain
Table of Contents K1
● Introduction
1. Blockchain terminologies
2. Distinction between databases and blockchain ledgers
● Cryptographic component
1. Cryptography, hash functions and digital signatures
● Consensus components
1. Principles and paradigms of distributed systems
2. Blockchain consensus algorithms
● Blockchain structures
1. Blockchain structure
2. Types of blockchain
Introduction
Source: https://www.economist.com/leaders/2015/10/31/the-trust-m
Table of Contents K1
● Introduction
1. Blockchain terminologies
2. Distinction between databases and blockchain ledgers
● Cryptographic component
1. Cryptography, hash functions and digital signatures
● Consensus components
1. Principles and paradigms of distributed systems
2. Blockchain consensus algorithms
● Blockchain structures
1. Blockchain structure
2. Types of blockchain
Tracing Blockchain’s Origin
• The shortcomings of current transaction systems
• During 2000’s financial crisis
Bitcoin Whitepaper: 10/31/2008
https://bitcoin.org/bitcoin.pdf
Digital Currency
• The most successful among lot of efforts: Bitcoin
• Replace cash with numbers and codes
• Advantages
• Fast
• International
• Easy accounting
• Weighs nothing
• Cheap
• Problems to be solved
Problems of Digital Currency
• Perfect Copy
• Just like downloading attachment from email
• How to distinguish counterfeits
• Ownership Problem
• Double Spending
• Networks are noisy and transmission across networks is far from instantaneous:
delay
• A hacker can capitalize
• Fraudster Detection Problem
The Long Road to Bitcoin
• Centralized Banking: not robust
• Satoshi determined to find the centralized part of banks
• The ledger
• “What if I could turn a bank inside out? Instead of one central party controlling
the ledger, what if every user were recruited to maintain a constantly updated
copy?”
• The strength of the digital was perfect copies, so copy the ledger,
everywhere, instantly.
• Any ledgers with even one common not agreeing with the masses would be
discarded, leaving fraudsters powerless
• Replace cash with Ledger!
Decentralization
• Replace cash with Ledger
Blockchain terminologies
Source: https://miethereum.com/wp-content/uploads/2017/11/A.-A-Gentle-Introduction-To-
What is Blockchain Technology
• Bitcoin stores all its transactions onto a public database called
as Blockchain
Highlights
Blockchain Structure
Source: https://www.edureka.co/blog/blockchain-tutorial/
4 Key Concepts of Blockchain
Source: https://tradeix.com/distributed-ledger-technology/
Blockchain terminologies
o Technologically, it is :
• Distributed database – public ledger (you can insert,
select data, but can’t update or delete data.
• Distributed computer – execute digital contracts
• Based on p2p (peer-to-peer) technology, cryptology and
API
Image source:
Blockchain Architecture
• Revolutionary Technology
• Protocol
• TCP/IP, HTTP, Cloud Computation, Big Data, IoT, FinTech…
• Melanie Swan: Blockchain: Blueprint for A New Economy, Jan 2015
• Blockchain 1.0
• Bitcoin
• Programmable Money
• Blockchain 2.0
• Ethereum
• Smart Contract
• Blockchain 3.0…
• Non-Financial Uses
• Applications
Bitcoin System vs. Current Banking System
• Decentralized System
• The Blockchain system follows a decentralized approach when compared to banks and financial organizations which are
controlled and governed by Central or Federal Authorities.
• Here, everyone who is involved with the system holds some power.
• Public Ledgers
• The ledger which holds the details of all transactions which happen on the Blockchain, is open and completely accessible to
everyone who is associated with the system.
• Even though the complete ledger is publicly accessible, the details of the people involved in the transactions remains
completely anonymous.
• Verification of Every Individual Transaction
• Every single transaction is verified by cross-checking the ledger and the validation signal of the transaction is sent after a few
minutes.
• Through the usage of several complex encryption and hashing algorithm, the issue of double spending is eliminated.
• Low or No Transaction Fees
• These transaction fees are however relatively quite less when compared to the fees implied by banks and other financial
organizations.
• If a transaction needs to be completed on priority then an additional transaction fees can be added by the user so as to have
the transaction verified on priority.
the key business benefits
• Time savings:
• Cost savings:
• Tighter security:
• Enhanced privacy:
• Improved auditability:
• Increased operational efficiency:
Building trust with blockchain
• Distributed and sustainable:
• Secure, private, and indelible:
• Transparent and auditable:
• Consensus-based and transactional:
• Orchestrated and flexible:
Why It’s Called “Blockchain”
Different Players in Implementation
• Blockchain user
• Regulator
• Blockchain developer
• Blockchain network operator
• Traditional processing platforms
• Traditional data sources
• Certificate authority
Blockchain terminologies
Users initiate
Users Broadcast One or more Nodes aggregate
transactions
their Nodes begin validated
using their
transactions to validating each transactions into
Digital
Nodes transaction Blocks
Signatures
Block reflecting
Nodes Broadcast
Consensus “true state” is
Blocks to each
protocol used chained to prior
other
Block
Source: https://ccl.yale.edu/sites/default/files/files/A%20Brief%20Introduction%20to%20Blockchain
Ledger
The decentralized ledger (Blockchain)
• Decentralization: get rid of the Third Party
• Satoshi paired two main technologies
• Proof of Work: to solve the double spending problem
• Elliptic Curves: to solve unique access to the ledger
• Nothing was newer than 2001
1. 2001: SHA-256 finalized
2. 1999-present: Byzantine fault tolerance
3. 1999-present: P2P networks
4. 1998: Wei Dai, B-money
5. 1998: Nick Szabo, Bit Gold
6. 1997: HashCash
7. 1992-1993: Proof-of-work for spam
8. 1991: cryptographic timestamp
9. 1980: public key crypto algorithm
Blockchain: Distributed Ledger Technology
What does a block look like?
Blockchain terminologies
● Transaction & blocks
o A transaction is a value transfer; a block is a collection of
transactions on the bitcoin network, gathered into a block that are
hashed and added to the blockchain.
● Mining
o This process of solving cryptographic problems using computing
hardware also triggers the release of cryptocurrencies
Source: https://marmelab.com/blog/2016/05/12/blockchain-expliquee-aux-
Blockchain terminologies
● Mining
o The process by which transactions are verified and added to a
blockchain.
Source:
Blockchain terminologies
● Mining
o Miners on the network select transactions from pools and form
them into a ‘block’.
Blockchain terminologies
● Forks
o A fork is the creation of an ongoing alternative version of the
blockchain, by creating two blocks simultaneously on different
parts of the network. This creates two parallel blockchains, where
one of the two is the winning blockchain.
● Forks
Blockchain terminologies
● Bitcoin
o Crypto currency, first asset based on Blockchain
o Used for drug/weapons e-commerce, ransom ware
o Used for remittance, speculation, store of value
Source: https://medium.com/@flatoutcrypto/what-is-the-point-of-
Blockchain terminologies
● Bitcoin
o Monetary creation
Image source:
Blockchain terminologies
● Bitcoin
o Inside Bitcoin’s Blockchain
BLOCK
(Units of the blockchain, like pages of transactions in a ledger)
Header
(It is hashed twice to create the fingerprint which
is referred to in the next block)
Transaction count
(How many transactions are in the block,
including the coinbase transaction)
Block content
Coinbase transaction Bitcoin transactions
Blockchain terminologies
● Bitcoin
o Inside Bitcoin’s Blockchain
- Block Header : includes Technical
data, Previous block hash, Merkle Root,
Timestamp, Difficulty target, Nonce.
Here is an example:
Source:
Blockchain terminologies
● Bitcoin
o Inside Bitcoin’s Blockchain
- Block content : Transaction Flow
Mining Coinbase Regular Address to Address Transaction
● Bitcoin
o Inside Bitcoin’s Blockchain
- Block Transaction example:
● Bitcoin
o How the
money transfer works
● Ethereum
o Proposed in late 2013 by Vitalik Buterin (cryptocurrency researcher
and programmer)
o Online crowdsale during summer 2014
o Bitcoin on steroids!
● Ethereum
o Decentralised app platform (dapps)
o Transaction & smart-contracts ledger
o Based on the Ethereum Virtual Machine
(EVM)
o Cryptocurrency called ether (ETH)
Image source:
Blockchain terminologies
● Ethereum
o Smart Contract
How a “Traditional”
contract works:
Source: https://www.investopedia.com/terms/s/smart-contracts.asp
Blockchain terminologies
● Ethereum
o Smart Contract
Source:
Table of Contents K2
● Introduction
1. Blockchain terminologies
2. Distinction between databases and blockchain ledgers
● Cryptographic component
1. Cryptography, hash functions and digital signatures
● Consensus components
1. Principles and paradigms of distributed systems
2. Blockchain consensus algorithms
● Blockchain structures
1. Blockchain structure
2. Types of blockchain
Distinction between databases and blockchain ledgers
● Databases
Source:
● Blockchain ledgers https://www.coindesk.com/inf
Distinction between databases and blockchain ledgers
Databases Blockchains
VS
Source: https://coinsutra.com/blockchain-vs-data
Table of Contents K1
● Introduction
1. Blockchain terminologies
2. Distinction between databases and blockchain ledgers
● Cryptographic component
1. Cryptography, hash functions and digital signatures
● Consensus components
1. Principles and paradigms of distributed systems
2. Blockchain consensus algorithms
● Blockchain structures
1. Blockchain structure
2. Types of blockchain
Table of Contents K1
● Introduction
1. Blockchain terminologies
2. Distinction between databases and blockchain ledgers
● Cryptographic component
1. Cryptography, hash functions and digital signatures
● Consensus components
1. Principles and paradigms of distributed systems
2. Blockchain consensus algorithms
● Blockchain structures
1. Blockchain structure
2. Types of blockchain
Cryptography, hash functions and digital
signatures
● Cryptography: the encryption and decryption of data
o 2 main cryptographic concepts used in Blockchain:
- Hashing
- Digital Signatures
Source:
Table of Contents K1
● Introduction
1. Blockchain terminologies
2. Distinction between databases and blockchain ledgers
● Cryptographic component
1. Cryptography, hash functions and digital signatures
● Consensus components
1. Principles and paradigms of distributed systems
2. Blockchain consensus algorithms
● Blockchain structures
1. Blockchain structure
2. Types of blockchain
Consensus components
Source: https://www.newgenapps.com/blog/8-blockchain-consensus-
Consensus components
Image source:
Table of Contents K1
● Introduction
1. Blockchain terminologies
2. Distinction between databases and blockchain ledgers
● Cryptographic component
1. Cryptography, hash functions and digital signatures
● Consensus components
1. Principles and paradigms of distributed systems
2. Blockchain consensus algorithms
● Blockchain structures
1. Blockchain structure
2. Types of blockchain
Table of Contents K1
● Introduction
1. Blockchain terminologies
2. Distinction between databases and blockchain ledgers
● Cryptographic component
1. Cryptography, hash functions and digital signatures
● Consensus components
1. Principles and paradigms of distributed systems
2. Blockchain consensus algorithms
● Blockchain structures
1. Blockchain structure
2. Types of blockchain
Consensus components
● Blockchain structure
o No more client/server architecture with name roles
● Blockchain structure
o Peer-to-peer Architecture with pseudonymous client bearing key
pairs. Each node as a database copy.
● Blockchain structure
o Data structure:
● Blockchain structure
o Blocks of data:
● Types of blockchain
o There mainly three types of Blockchains that have emerged after
Bitcoin introduced Blockchain to the world.
Public Blockchain:
no one in charge, anyone can participate in reading/writing/auditing the
blockchain (i.e. Bitcoin, Litecoin, etc.)
Private Blockchain:
a private property of an individual or an organization, there is one in charge of
important things such as read/write or whom to selectively give access to read
or vice versa (i.e. Bankchain)
Consortium or Federated Blockchain:
More than one in charge. A group of companies or representative individuals
come together and make decisions for the best benefit of the whole network
(i.e. r3, EWF)
Table of Contents K2
● Smart contract theory
1. Smart Contract Theory and architecture
2. Architectures and decentralized autonomous systems
● Smart contract application
1. Existing blockchain applications, related structures and
architectures
Table of Contents K2
● Smart contract theory
1. Smart Contract Theory and architecture
2. Architectures and decentralized autonomous systems
● Smart contract application
1. Existing blockchain applications, related structures and
architectures
Table of Contents K2
● Smart contract theory
1. Smart Contract Theory and architecture
2. Architectures and decentralized autonomous systems
● Smart contract application
1. Existing blockchain applications, related structures and
architectures
Smart Contract Theory and architecture
Source: https://en.wikipedia.org/wiki/Smart_con
Smart Contract Theory and architecture
● Example 1: Lottery
o Lottery without smart contract
Company
Organizer
Statuses
Payment provider
Lottery
Terms &
conditions
participants
Smart contract application
● Example 1: Lottery
o Lottery with smart contract
Organizer
Smart
contract
participants
Smart contract application
Andre Beth
2 <pubKeyAndrew> Carl
<pubKeyBeth> w
<pubKeyCarl> 3
CHECKMULTISIG Bitcoin
transaction
Blockchain
Smart contract application
IF
<pubKeyCamille> Camill
CHECKSIG Beth
e
ELSE
<5 y> CLTV DROP
<pubKeyBeth> Bitcoin
CHECKSIG transaction
ENDIF
Blockchain
Smart contract application
Blockchain
Existing blockchain applications, related
structures and architectures
● ERC-20
o Proposed on November 19, 2015 by Fabian Vogelsteller.
o A technical standard used for smart contracts on the Ethereum
blockchain for implementing tokens. (ERC: Ethereum Request for
Comment, 20: the number that was assigned to this request.)
o It defines a common list of rules that an Ethereum token has to
implement, allowing developers to program how new tokens will
function within the Ethereum ecosystem. These rules include how
the tokens are transferred between addresses and how data within
each token is accessed.
o + 142,200 ERC-20 token contracts (as of November 19, 2018): EOS,
Bancor, Qash, etc…
Source: https://en.wikipedia.org/wiki/ERC
Existing blockchain applications, related
structures and architectures
● ERC-721: a class of unique tokens
o A free, open standard that describes how to build non-fungible or unique
tokens on the Ethereum blockchain. While most tokens are fungible (every
token is the same as every other token, i.e.ERC-20), ERC-721 tokens are all
unique.
o It defines a minimum interface a smart contract must implement to allow
unique tokens to be managed, owned and traded.
● ERC-725: Ethereum Identity Standard
o A proposed standard for blockchain-based identity which lives on the
Ethereum blockchain.
o It describes proxy smart contracts that can be controlled by multiple keys
and other smart contracts, it can describe humans, groups, objects and
machines.
o Users should be able to own and manage their identity instead of ceding
ownership of identity to centralized organizations. Source:
http://erc721.org/
Block Chain usecase (dubai)