KEMBAR78
Introduction into blockchains and cryptocurrencies | PDF
Introduction to blockchains and
cryptocurrencies
Sergey Ivliev
• Digital assets ecosystem
• Bitcoin
• Other blockchains
• Smart contracts
• DeFi
• Other DApps
Agenda
Digital Assets Ecosystem
7
~$265B MCap ~$8B 24h volume~2500 assets ~260 exchanges ~3M NFT-tokens
Digital assets ecosystem
Bitfinex hack SegWit2x/UASF Crypto winter Libra
https://coinmarketcap.com/charts/
World money
$ bln
Ecosystem overview
• Custodial
• Private
• Hardware
• Centralized
• DEXes
• Fiat on-ramps
• ICO/STO
• Stablecoins
• DeFi
• Collectibles
• Bitcoin
• Ripple
• Monero
• Ethereum
• EOS
• TRON
• Bitmain
• Nvidia
• Infura
• BloXroute
Bitcoin
"I think that the Internet is going to be one
of the major forces for reducing the role of
government. The one thing that’s missing,
but that will soon be developed, is a
reliable e-cash, a method whereby on the
Internet you can transfer funds from A to
B, without A knowing B or B knowing A"
Milton Friedman, a Nobel Prize Laureate in
Economics (1999)
• You are not able to physically give a coin or a bill to two
people at the same time
• Electronic payment system should be able to prevent
double spending, because it is easy to copy electronic
records
• The centralized payment system is based on a trusted
middleman (bank, central bank, PSP, etc.)
The double spending problem
The challenge:
• Develop a secure and reliable method for updating a
public ledger of which there are myriad copies
distributed throughout the world
• Create the necessary incentives for users to
contribute resources to verifying transactions
The double spending problem
Centralized payment system Decentralized payment system
Centralized vs. Decentralized
• Symmetric encryption (Diffie, Hellman, Merkle, 1975)
• Asymmetric encryption (Rivest, Shamir, Adelman, 1977)
• Blind Signature Technology (Chaum, 1989)
• Digital Signatures (Schnorr, 1989), ECDSA (NIST, 2000)
• HashCash, Proof-of-Work (Back, 1997)
• Bit gold (Szabo, 1998)
• Smart contracts (Szabo, 2003)
History
The story behind
https://bitcoin.org/bitcoin.pdf
Bitcoin whitepaper 31 Oct 2008
Genesis block 3 January 2009
Bitcoin code released 9 January 2009
Pizza Day 22 May 2010
Step 1 — Agreement on transaction
Alice is a private person who has bitcoins
Bob is an entrepreneur who sells digital content online and
accepts bitcoins
Alice agreed with Bob to purchase a digital art object for 0.05 BTC
How it works…
http://cointemporary.com
Step 2 — Creating a transaction message
Alice creates a message that contains:
• A link to previous transactions in which she received bitcoins
• Recipient address (Bob's address) and
• The amount to be paid
...and may contain other conditions (e.g. time delay)
How it works…
Alice's private key
L5Ptvbbh6hpXMChRoqLUQAzQn6YoV5Hpi97aGBbjTYfh837fCXp3
Alice's public key
025cdade7165c4683e968d6b66459d3c42aa26232e1a7f88d34d0bc283418dd741
Alice's wallet address
1DgM5xyFxUyAVrAhxR1KY2r5uyiGXrKmGc
How it works…
Bob's wallet address
1KsGhiAotJxzRPH52EV25d2XFWkcv3bLCC
How it works…
Step 2 — Creating a transaction message
Inputs:
• 0.1 BTC from Alice.
Outputs:
• 0.05 BTC to Bob
• 0.0001 BTC is a fee for transaction validation
• 0.0499 BTC is a change back to Alice's address
How it works…
Inputs
Outputs
https://coinb.in
How it works…
Outcome: transaction
How it works…
Step 3 — Signing a transaction
As soon as the message is created, Alice signs it to prove that she
manages the sender's address.
Alice encrypts the message with her private key.
This message can be decrypted with a public key, which is also
sent with the transaction.
How it works…
https://coinb.in
Outcome: signed transaction
How it works…
Step 4 — Broadcasting
Alice distributes her message over the network to validate.
How it works…
https://blockchain.info/address/1DgM5xyFxUyAVrAhxR1KY2r5uyiGXrKmGc
Validating nodes (miners) are organized into a peer-to-peer network.
The message propagates along the fastest path from the node to its
closest neighbors…
How it works…
On average, 8-10 thousand full nodes are active daily
How it works…
The first 1,000 nodes receive a transaction in 2 seconds on the average…
How it works…
https://bitcoinchain.com/mempool/
The transaction is put on the waiting list (mempool)
How it works…
The number of transactions in the mempool can be up to 20,000 or more
How it works…
https://www.blockchain.com/charts/mempool-count
Step 5 — Transaction verification (mining)
Miners receive Alice's transaction and add it along with other
transactions to the candidate block.
Miners compete with each other who will verify the new block
faster.
Verification of the block means:
• Validation of transactions in the block
• Reaching consensus
How it works…
Reaching consensus is a time-consuming process and requires
from each miner to demonstrate computing resources, the so-
called work (Proof of Work, PoW).
How it works…
Hashrate ~80 . 1018 H/s
500x top supercomputer
How it works…
Mining allows you to reach consensus on what transactions took place
and in what order.
When branching (forking), the
chain will be selected, which has
the largest amount of work for
the verification, i.e. the longest
one
Step 6 — Success
Clara is a miner, who successfully verified the block with Alice's
transaction, receives a reward for the extracted block (12.5 BTC),
as well as a commission for the block's transactions.
Clara spreads her output among other miners and they add this
block to the chain.
Bob receives confirmation that the payment has been sent by Alice
and initiates the delivery.
How it works…
How it works…
The first 1,000 nodes receive a block in 1.1 seconds on the average…
Outcome
Step 6 — Success
How it works…
Viewing the transaction in the blockchain explorer by the hash number
How it works…
The hashrate exceeds 80 million TH/s. Power consumption ~13.5 GWh
Energy cost 13.5 GW * $0.05/KWh = $675k /hour ($5.9b /yr)
Equipment replacement cost 6.4 mln S9 * $2000 = $12,8 b
Mining
Mining award for 6 blocks * 12.5 BTC = 75 BTC / hour
Transaction fee for 6 blocks * 1400 tx * 0.00013 BTC = 1.1 BTC / hour
Revenue of miners of 76.1 BTC * $10k ~ $761k / hour ($6.6b /yr)
Mining
https://blockchain.info/pools
Consolidation of miners into pools
12.5 BTC is a block award, 6 blocks
per hour => 1,800 BTC are issued daily
($18m)
Halving every ~4 years, maximum of
21 million BTC
17.89 million BTC issued =>
Mcap = $10k * 17.89 million = $178b
Mining
Average transaction volume: ~$1 bln/day
$73m
(2015)
$62m
(2014)
$40m
(2013)
$1.6m
(2012)
Metrics
$158m
(2016)$1.1m
(2011)
https://blockchain.info/charts/estimated-transaction-volume-usd?timespan=all
$1b
(2017)
Max=$5.6bWU $0.2 bln/day (2016)
Paypal $1.25 bln/day (Q3 2017)
VISA $24 bln/day (2016)
SWIFT $5 trln/day (2016)
$1b
(8m2019)
$1b
(2018)
Transaction rate: ~3.8 tps (max 7 tps)
125k
(2015)
69k
(2014)
53k
(2013)23k
(2012)
Metrics
226k
(2016)
5k
(2011)
https://blockchain.info/charts/n-transactions?timespan=all
285k
3.3 tps
(2017)
Max=425k
4.9 tps
WU 9 tps (2016)
SWIFT 130 tps (2016)
Paypal 200 tps (2016)
Visa 4470 tps (2017)
222k
2.57 tps
(2018)
335k
3.9 tps
(8m2018)
Metrics
Average transaction fee: ~$1.5
WU >$10 (5-10%)
Paypal $2.9+0.3%
VISA ~0.2%
SWIFT $20-40
https://bitcoinfees.info/
Use cases
Alternative payment system: ~600k daily active addresses
https://bitinfocharts.com/comparison/bitcoin-activeaddresses.html
Use cases
Store of value
Bitcoin Gold Cash Bank deposit
Durable
Portable
Fungible
Verifiable
Divisible
Scarce
Established history
Censorship resistant
Use cases
Non-correlated asset
https://coinmetrics.io/correlations/#assets=btc-gld,btc-s&p_period=90
Use cases
Non-correlated asset
https://www.cmegroup.com/trading/
equity-index/us-index/bitcoin.html
CME futures market ~$100-500m / day
Use cases
Escape from the devaluation of the national currency
https://coin.dance/volume/localbitcoins
Use cases
https://coin.dance/statshttps://trends.google.com/trends/explore?q=bitcoin
New generation money (57% under 34)
Use cases
Purchase of illegal goods (~10% of payments)
https://papers.ssrn.com/abstract=3102645
Foley, Sean et al. Sex, Drugs, and Bitcoin: How Much Illegal Activity Is Financed
Through Cryptocurrencies? (January 15, 2018).
Use cases
Gateway to crypto + unit of measure for crypto-assets
https://coinlib.io/exchange/bittrex
Use cases
https://www.ezonomics.com/ing_international_surveys/mobile-banking-2018-
cryptocurrency/
Use cases
• Killer app – money
• Open protocol, everyone can participate
• Operates without trusted parties, censorship is not possible
• Strong cryptography and PoW energy secure network
• Transactions are (pseudo-)anonymous
• Fungible, divisible, portable, scarce (!)
• High price volatility: >3% / day
• Poorly scalable: <10 tps
Summary
Other blockchains
GHOST
Y. Sompolinsky, A.Zohar “Secure High-Rate Transaction Processing in Bitcoin”, 2013
SPECTRE/PHANTOM
Y. Sompolinsky, A.Zohar “PHANTOM: A Scalable BlockDAG protocol”, 2017
Proof-of-Stake
• NXT (2012)
• Ouroboros (Cardano)
• Casper (Ethereum)
• Algorand
• Based on staking
• Lower energy consumption
• Wider attack surface
Proof-of-Identity
• Idena (2019)
• Time-synced Turing test
• 1 human = 1 vote
• Use cases: governance,
serverless messenger, direct
marketing
Filter for Live Intelligent People (flip)
Horizontal scaling
• Big blockers: Bitcoin Cash,
DASH, Waves (NG) 100 tps
• DAG: Byteball 17 tps, IOTA
100 tps, Nano 300 tps
• Committee: Algorand 1k tps
• Sharding: Zilliqa 2.5k tps
• DPoS: Bitshares, EOS 8k tps
• aBFT: Hedera Hashgraph
200k tps
Permissioned blockchains
Permissionless Permissioned
Bitcoin, Ethereum, ZCash,… Fabric, Quorum, Corda, Libra
Open access (PoW, PoS, …) Membership (consortium)
Many validators Few validators
Wide range of users Small range of users (B2B)
Relatively low performance Relatively high performance
Managed by ecosystem Managed by stakeholders
“Internet” “Intranet”
The subject of this course is open (public) protocols and crypto markets
Vertical scaling
Lightning Network
• Micro-payment channel network (Level 2)
• Many hubs with many open channels
• A channel is a multisig address with a frozen collateral
• Micro-payments are made as the exchange of commitment transactions
(off-chain), payments can be locked between hubs
• Any party can close the channel by publishing the last transaction and
receiving the balance to his or her address
Joseph Poon, Thaddeus Dryja. The Bitcoin Lightning Network:
Scalable Off-Chain Instant Payments, 14 Jan 2016
https://lightning.network/lightning-network-paper.pdf
Vertical scaling
Advantages:
• The transactions are carried out in milliseconds
• Safety is guaranteed by blockchain
• Does not require trust between the participants
• Scalability is up to 1 million per second or more
• Low transaction costs
• The possibility to carry out micro-transactions (<$1)
• Crosschain atomic swaps, non-custodial DvP trading
https://explorer.acinq.co
Vertical scaling
Lightning Network
Vertical scaling
https://bitcoinvisuals.com/lightning
Lightning network: <$10 mln capacity
Vertical scaling
Disadvantages:
• Opening and re-opening channels requires transaction costs
• The hub needs to keep the frozen capital in the channels
https://www.trustnodes.com/2019/08/20/guy-makes-20-a-month-for-locking-5-
million-worth-of-bitcoin-on-the-lightning-network
• The average amount of collateral in the channels is small ($20), payments
over $5 can be a problem
• "Sending payments using the Lightning Network is cheaper than the regular
Bitcoin network, but suffers from routing errors and wallet bugs that make it
impractical even for highly technical users” https://news.bitcoin.com/a-look-
at-what-it-was-like-to-operate-the-lightning-networks-largest-node/
• Bank of England – The emergence of digital currencies (2014)
http://www.bankofengland.co.uk/publications/Documents/quarterlybulletin/2014/
qb14q3digitalcurrenciesbitcoin1.pdf
• WEF – The future of financial infrastructure (Aug 2016)
http://www3.weforum.org/docs/WEF_The_future_of_financial_infrastructure.pdf
• D.Fantazzini, E.Nigmatullin, V.Sukhanovskaya, S.Ivliev. "Everything you always
wanted to know about bitcoin modelling but were afraid to ask". Applied
Econometrics (2017) https://mpra.ub.uni-muenchen.de/71946/
• European Parliament. “Virtual currencies and central banks monetary policy:
challenges ahead” (2018)
http://www.europarl.europa.eu/cmsdata/149900/CASE_FINAL%20publication.pdf
• J.Song. “Why blockchain is hard” (2018) https://medium.com/@jimmysong/why-
blockchain-is-hard-60416ea4c5c
• http://www.mas.gov.sg/News-and-Publications/Speeches-and-Monetary-Policy-
Statements/Speeches/2018/Crypto-Tokens-The-Good-The-Bad-and-The-Ugly.aspx
Useful links
Smart Contracts
Smart contracts
Unlike Bitcoin, which stores only the
transaction log (UTXO = Unspent
Transactions Output), Ethereum stores
both transactions and ledger states.
In addition to ledger state (balances),
Ethereum can store the state of smart
contract variables.
Technical details
https://hackernoon.com/getting-deep-
into-ethereum-how-data-is-stored-in-
ethereum-e3f669d96033
Smart contracts
Smart contracts are created in a high-
level language (Solidity),
they are then compiled into low-level
machine code (bytecode).
Bytecode is loaded into Ethereum by
sending a transaction of a special type
using "Contract creation".
The loaded smart contracts can be
performed on the Ethereum Virtual
Machine (EVM).
https://etherscan.io/addres
s/0xbdf6a89f7c50b15d6b9
b6f35dba58fc240c1bb89#
code
Smart contracts
The Ethereum Virtual Machine
(EVM) is a decentralized
computer that can process
smart contracts, confirming the
changed state of variables on
the blockchain.
All EVM nodes perform smart
contract and validate a definite
output.
Smart contracts
The code is executed up to 100
times slower than locally
The cost of using memory and
storage is at the level of 50-ies of
the 20th century
The outputs can be changed in the
first 60 seconds
Smart contracts
It is the world's first single
computer for the entire planet
It cannot be stopped and it is
independent of states and
corporations
Available wherever there is
Internet
It can perform any calculation that
is possible to perform (Turing
completeness), including infinite
loops
Smart contracts
Gas is a metric to evaluate and limit the use of resources for the EVM. Each
operation (command, variable, etc.) requires a certain amount of gas.
The more there are calculations and storage use, the more gas is required.
When calling any smart contract function, the sender should specify GasLimit and
GasPrice.
If the transaction goes out of GasLimit, it will fail, but a fee will be charged to the
sender:
Fee = Amount of Gas * GasPrice
Useful links
Minimum viable token
Crowdfunding
DAO (Decentralized
Autonomous Organizations)
Dapps (distributed
applications)
https://ethereum.org/token
https://ethereum.org/crowdsale
https://ethereum.org/dao
https://www.stateofthedapps.com/
DeFi
#DeFi
Decentralized Finance (#DeFi) is the
movement that leverages open source
software and decentralized networks to
transform traditional financial products into
trustless and transparent protocols that
operate without unnecessary intermediaries.
Among its core principles are transparency,
accessibility and financial inclusion.
Decentralized Finance participants are able to
reduce counterparty risk via cryptographic
verification on public blockchains.
#DeFi
• Payments (cryptocurrencies, stablecoins)
• Funding (ICO, IEO, STO)
• Borrowing
• Lending
• Decentralized exchanges (DEX)
• Prediction markets
• Asset management / Investments
• Insurance
#DeFi
Tokens
ERC20 Tokens
ERC = Ethereum Request for
Comment
Standard interface to call
such functions as checking
balance, transfer and
withdrawal of tokens
https://github.com/ethereum/ei
ps/issues/20
The vast majority of
Ethereum tokens is
compatible with this
standard
Matrix of balances:
{0x1, 100; 0x2, 250; 0x3, 0,….}
Token transfer function:
transferFrom (0x2, 0x3, 100) will change the state
of the balances variable as follows:
It was {0x1, 100; 0x2, 250; 0x3, 0,….}
It is now {0x1, 100; 0x2, 150; 0x3, 100,….}
Balance inquiry function:
balanceOf(0x2) will give 250 back
Stablecoins
Stablecoins combined: ~$5 bln supply
https://coinmetrics.io/charts/#assets=dai,gusd,pax,usdc,tusd,usdteth,usdt_log=f
alse_left=SplyCur_zoom=1508378538572.8643,1571795370814.0703
Stablecoins
Ex-USDT stablecoins: ~$1 bln
https://coinmetrics.io/charts/#assets=dai,gusd,pax,usdc,tusd,usdteth,usdt_log=f
alse_left=SplyCur_zoom=1508378538572.8643,1571795370814.0703
Funding
5250 ICO (583 in 2019)
1722 successful (33% success)
$26.4b raised ($3.3b in 2019)
https://www.inwara.com/report/
blockchain-crypto-report-h1-
2019
https://icobench.com/reports/IC
Obench_ICO_Market_Analysis
_June_2019.pdf
ICO: party is not over!
Funding
$37m
(2018)
$1.5b
(6m2019)
https://icobench.com/reports/ICObench_ICO_Market
_Analysis_June_2019.pdf
Exchanges in the ICO game: >$1.5b raised in 2019
Funding
2 STO
$22m
(2017)
28 STO
$442m
(2018)
https://cryptovalley.swiss/wp-content/uploads/ch-
20190308-strategyand-ico-sto-report-q1-2019.pdf
https://www.inwara.com/report/blockchain-crypto-
report-h1-2019
57 STO
$420m
(5m2019)
STO ramps up: >$400m in 2019
Funding
https://www.sec.gov/news/press-
release/2019-150
Happy founders
Funding
https://twitter.com/lawmaster/status/1159130591209689088
Angry investors
Median ROI -87%
<11% ICOs ROI>0%
Top-5 ICOs:
- BNB (5,902%)
- IOTA (1,744%)
- Ethereum (1,339%)
- Lambda (962%)
- ChainLink (668%)
#DeFi on Bitcoin
https://defipulse.com/lightning-network
#DeFi on Ethereum
https://defipulse.com/
~$450m locked in
Ethereum DeFi
Dai: Stablecoin + Borrowing
MakerDAO
$78 mln Dai issued
1.3 mln ETH locked in
collateral (1.29% of ETH)
Collateral ratio 320%
13.9k CDPs
105k Dai Holders
~20% lending rate
https://mkr.tools/system
xDai: Stablecoin Payments
xDai
Sidechain with 4 validators
2-way bridge to Ethereum (POA)
5s block time
Capacity up to 1500 tps
13k xDai addresses
<$0.001 fee per tx paid in Dai
ZK for privacy (AZTEC)
https://poa.network/xdai
Borrowing & Lending
Compound, InstaDapp,
Dharma, dYdX, Nuo
$129m value locked
396k ETH locked in
compound as collateral
(0.37% of ETH)
Borrowing & Lending
Compound
Deposits are tokenized
as cTokens (e.g.cDai)
Rate of cToken to
underlying asset varies
with the interest rate
Interest rate varies
dynamically with supply
& demand
Interest accrued ~15s
Borrowing & Lending
https://loanscan.io/reference-rates?interval=3m
Decentralized exchanges
Uniswap, Bancor, Kyber
Onchain orderbook
Zero-KYC
Delivery vs. payment
The spot-swaps of ERC20
tokens via the underlying asset
(ETH, BNC)
Automated price reserves for
liquidity provision
~$3m/day traded volume
Decentralized exchanges
Asset management
Set protocol
Tokenized strategies
Non-custodial baskets of
assets (Dai, WBTC)
Rebalancing with modified
dutch auction
Integration with DEX
Aggregators
Zerion
Access to various protocols
DeFi Portfolio management
Others: InstaDapp, Settle
Asset management
Summary
• Bitcoin wholesale payment and SoV (aka digital gold) is a strong use case
• Ethereum DeFi is vibrant, but still a proof of concept
• Advantages:
- Inclusive (zero KYC, no censorship)
- Non-custodial (no counterparty credit risk)
- Transparent and price efficient
- Global, low cost, fast finality
• Disadvantages:
- Overcollateralized (doesn’t help unbanked to get loans)
- Technical barrier (e.g. Metamask, keys, …)
- Bridge problem
- Still in beta
Useful links
A curated list of awesome decentralized finance projects, software, and resources.
https://github.com/ong/awesome-decentralized-finance
DeFi metrics
https://defipulse.com/
Binance Research report on DeFi
https://info.binance.com/en/research/marketresearch/defi-1.html
Other DApps
Collectibles
Cryptokitties
Digital collection
Slowed down the Ethereum
network: 14k DAU, $12
million (11.12.17)
The collection includes over
900 thousand tokens
The ERC-721 standard (Non-
fungible token, NFT) for
digital assets created
VC (2018): $12 million (a16z)
Dragon
600 ETH
(~$170,000)
Markets
> 1.2 million token cryptocollectibles (game characters, digital art, etc.)
VC (2018): $2 million (YC)
Prediction markets
Augur, Stox
Betting on the outcome of
sports, political and
economic events
Bets and payouts in tokens
and ETH
Competitors: Augur, Gnosis
ICO (2018): 147k ETH
(~$33m, 34 hours)
Social media
Peepeth
Distributed Twitter
No advertising
No censorship
No ability to change
or delete anything
Funding cancelled
Fog Computing
SONM
p2p-marketplace of computing
capacity
Machine learning
Video rendering
Web hosting service
Scientific computing
and so on
Payment in SONM tokens
ICO (2017): $42 million (4 days,
8,774 participants)
Decentralized storage
STORJ
p2p-marketplace of disk space
Backups, archives
Media content
Transfer of large files
Logs
19k farmers, 20k API users
Payment in STORJ tokens
ICO (2017): $30 million (7 days)
Governance
Aragon
DAO/Digital democracy
Unstoppable organizations
Voting
Multisignature wallet
Dividend distribution
Digital identity
uPort
Self-sovereign identity (SSID)
Claims are stored on the
blockchain
Recovery in case of key loss
Integration with the state ID
(Zug)
Similar projects:
Civic, Self-Key
Decentralized applications
Summary:
• 2,000 dapps and several millions of smart contracts on Ethereum alone
• Most popular dapps are DeFi, collectibles, games and gambling
• The total audience of dapps is not very significant yet (~10-50k /day)
• Biggest issues poor user experience, poor token economy, poor
scalability
Thank you!
ivliev@gmail.com

Introduction into blockchains and cryptocurrencies

  • 1.
    Introduction to blockchainsand cryptocurrencies Sergey Ivliev
  • 2.
    • Digital assetsecosystem • Bitcoin • Other blockchains • Smart contracts • DeFi • Other DApps Agenda
  • 3.
  • 4.
    7 ~$265B MCap ~$8B24h volume~2500 assets ~260 exchanges ~3M NFT-tokens Digital assets ecosystem Bitfinex hack SegWit2x/UASF Crypto winter Libra https://coinmarketcap.com/charts/
  • 5.
  • 6.
    Ecosystem overview • Custodial •Private • Hardware • Centralized • DEXes • Fiat on-ramps • ICO/STO • Stablecoins • DeFi • Collectibles • Bitcoin • Ripple • Monero • Ethereum • EOS • TRON • Bitmain • Nvidia • Infura • BloXroute
  • 7.
  • 8.
    "I think thatthe Internet is going to be one of the major forces for reducing the role of government. The one thing that’s missing, but that will soon be developed, is a reliable e-cash, a method whereby on the Internet you can transfer funds from A to B, without A knowing B or B knowing A" Milton Friedman, a Nobel Prize Laureate in Economics (1999)
  • 9.
    • You arenot able to physically give a coin or a bill to two people at the same time • Electronic payment system should be able to prevent double spending, because it is easy to copy electronic records • The centralized payment system is based on a trusted middleman (bank, central bank, PSP, etc.) The double spending problem
  • 10.
    The challenge: • Developa secure and reliable method for updating a public ledger of which there are myriad copies distributed throughout the world • Create the necessary incentives for users to contribute resources to verifying transactions The double spending problem
  • 11.
    Centralized payment systemDecentralized payment system Centralized vs. Decentralized
  • 12.
    • Symmetric encryption(Diffie, Hellman, Merkle, 1975) • Asymmetric encryption (Rivest, Shamir, Adelman, 1977) • Blind Signature Technology (Chaum, 1989) • Digital Signatures (Schnorr, 1989), ECDSA (NIST, 2000) • HashCash, Proof-of-Work (Back, 1997) • Bit gold (Szabo, 1998) • Smart contracts (Szabo, 2003) History
  • 13.
    The story behind https://bitcoin.org/bitcoin.pdf Bitcoinwhitepaper 31 Oct 2008 Genesis block 3 January 2009 Bitcoin code released 9 January 2009 Pizza Day 22 May 2010
  • 14.
    Step 1 —Agreement on transaction Alice is a private person who has bitcoins Bob is an entrepreneur who sells digital content online and accepts bitcoins Alice agreed with Bob to purchase a digital art object for 0.05 BTC How it works…
  • 15.
  • 16.
    Step 2 —Creating a transaction message Alice creates a message that contains: • A link to previous transactions in which she received bitcoins • Recipient address (Bob's address) and • The amount to be paid ...and may contain other conditions (e.g. time delay) How it works…
  • 17.
    Alice's private key L5Ptvbbh6hpXMChRoqLUQAzQn6YoV5Hpi97aGBbjTYfh837fCXp3 Alice'spublic key 025cdade7165c4683e968d6b66459d3c42aa26232e1a7f88d34d0bc283418dd741 Alice's wallet address 1DgM5xyFxUyAVrAhxR1KY2r5uyiGXrKmGc How it works…
  • 18.
  • 19.
    Step 2 —Creating a transaction message Inputs: • 0.1 BTC from Alice. Outputs: • 0.05 BTC to Bob • 0.0001 BTC is a fee for transaction validation • 0.0499 BTC is a change back to Alice's address How it works…
  • 20.
  • 21.
  • 22.
    Step 3 —Signing a transaction As soon as the message is created, Alice signs it to prove that she manages the sender's address. Alice encrypts the message with her private key. This message can be decrypted with a public key, which is also sent with the transaction. How it works…
  • 23.
  • 24.
    Step 4 —Broadcasting Alice distributes her message over the network to validate. How it works… https://blockchain.info/address/1DgM5xyFxUyAVrAhxR1KY2r5uyiGXrKmGc
  • 25.
    Validating nodes (miners)are organized into a peer-to-peer network. The message propagates along the fastest path from the node to its closest neighbors… How it works…
  • 26.
    On average, 8-10thousand full nodes are active daily How it works…
  • 27.
    The first 1,000nodes receive a transaction in 2 seconds on the average… How it works…
  • 28.
    https://bitcoinchain.com/mempool/ The transaction isput on the waiting list (mempool) How it works…
  • 29.
    The number oftransactions in the mempool can be up to 20,000 or more How it works… https://www.blockchain.com/charts/mempool-count
  • 30.
    Step 5 —Transaction verification (mining) Miners receive Alice's transaction and add it along with other transactions to the candidate block. Miners compete with each other who will verify the new block faster. Verification of the block means: • Validation of transactions in the block • Reaching consensus How it works…
  • 31.
    Reaching consensus isa time-consuming process and requires from each miner to demonstrate computing resources, the so- called work (Proof of Work, PoW). How it works… Hashrate ~80 . 1018 H/s 500x top supercomputer
  • 33.
    How it works… Miningallows you to reach consensus on what transactions took place and in what order. When branching (forking), the chain will be selected, which has the largest amount of work for the verification, i.e. the longest one
  • 34.
    Step 6 —Success Clara is a miner, who successfully verified the block with Alice's transaction, receives a reward for the extracted block (12.5 BTC), as well as a commission for the block's transactions. Clara spreads her output among other miners and they add this block to the chain. Bob receives confirmation that the payment has been sent by Alice and initiates the delivery. How it works…
  • 35.
    How it works… Thefirst 1,000 nodes receive a block in 1.1 seconds on the average…
  • 36.
    Outcome Step 6 —Success How it works…
  • 37.
    Viewing the transactionin the blockchain explorer by the hash number How it works…
  • 38.
    The hashrate exceeds80 million TH/s. Power consumption ~13.5 GWh Energy cost 13.5 GW * $0.05/KWh = $675k /hour ($5.9b /yr) Equipment replacement cost 6.4 mln S9 * $2000 = $12,8 b Mining Mining award for 6 blocks * 12.5 BTC = 75 BTC / hour Transaction fee for 6 blocks * 1400 tx * 0.00013 BTC = 1.1 BTC / hour Revenue of miners of 76.1 BTC * $10k ~ $761k / hour ($6.6b /yr)
  • 39.
  • 40.
    12.5 BTC isa block award, 6 blocks per hour => 1,800 BTC are issued daily ($18m) Halving every ~4 years, maximum of 21 million BTC 17.89 million BTC issued => Mcap = $10k * 17.89 million = $178b Mining
  • 41.
    Average transaction volume:~$1 bln/day $73m (2015) $62m (2014) $40m (2013) $1.6m (2012) Metrics $158m (2016)$1.1m (2011) https://blockchain.info/charts/estimated-transaction-volume-usd?timespan=all $1b (2017) Max=$5.6bWU $0.2 bln/day (2016) Paypal $1.25 bln/day (Q3 2017) VISA $24 bln/day (2016) SWIFT $5 trln/day (2016) $1b (8m2019) $1b (2018)
  • 42.
    Transaction rate: ~3.8tps (max 7 tps) 125k (2015) 69k (2014) 53k (2013)23k (2012) Metrics 226k (2016) 5k (2011) https://blockchain.info/charts/n-transactions?timespan=all 285k 3.3 tps (2017) Max=425k 4.9 tps WU 9 tps (2016) SWIFT 130 tps (2016) Paypal 200 tps (2016) Visa 4470 tps (2017) 222k 2.57 tps (2018) 335k 3.9 tps (8m2018)
  • 43.
    Metrics Average transaction fee:~$1.5 WU >$10 (5-10%) Paypal $2.9+0.3% VISA ~0.2% SWIFT $20-40 https://bitcoinfees.info/
  • 44.
    Use cases Alternative paymentsystem: ~600k daily active addresses https://bitinfocharts.com/comparison/bitcoin-activeaddresses.html
  • 45.
    Use cases Store ofvalue Bitcoin Gold Cash Bank deposit Durable Portable Fungible Verifiable Divisible Scarce Established history Censorship resistant
  • 46.
  • 47.
  • 48.
    Use cases Escape fromthe devaluation of the national currency https://coin.dance/volume/localbitcoins
  • 49.
  • 50.
    Use cases Purchase ofillegal goods (~10% of payments) https://papers.ssrn.com/abstract=3102645 Foley, Sean et al. Sex, Drugs, and Bitcoin: How Much Illegal Activity Is Financed Through Cryptocurrencies? (January 15, 2018).
  • 51.
    Use cases Gateway tocrypto + unit of measure for crypto-assets https://coinlib.io/exchange/bittrex
  • 52.
  • 53.
  • 54.
    • Killer app– money • Open protocol, everyone can participate • Operates without trusted parties, censorship is not possible • Strong cryptography and PoW energy secure network • Transactions are (pseudo-)anonymous • Fungible, divisible, portable, scarce (!) • High price volatility: >3% / day • Poorly scalable: <10 tps Summary
  • 55.
  • 56.
    GHOST Y. Sompolinsky, A.Zohar“Secure High-Rate Transaction Processing in Bitcoin”, 2013
  • 57.
    SPECTRE/PHANTOM Y. Sompolinsky, A.Zohar“PHANTOM: A Scalable BlockDAG protocol”, 2017
  • 58.
    Proof-of-Stake • NXT (2012) •Ouroboros (Cardano) • Casper (Ethereum) • Algorand • Based on staking • Lower energy consumption • Wider attack surface
  • 59.
    Proof-of-Identity • Idena (2019) •Time-synced Turing test • 1 human = 1 vote • Use cases: governance, serverless messenger, direct marketing Filter for Live Intelligent People (flip)
  • 60.
    Horizontal scaling • Bigblockers: Bitcoin Cash, DASH, Waves (NG) 100 tps • DAG: Byteball 17 tps, IOTA 100 tps, Nano 300 tps • Committee: Algorand 1k tps • Sharding: Zilliqa 2.5k tps • DPoS: Bitshares, EOS 8k tps • aBFT: Hedera Hashgraph 200k tps
  • 61.
    Permissioned blockchains Permissionless Permissioned Bitcoin,Ethereum, ZCash,… Fabric, Quorum, Corda, Libra Open access (PoW, PoS, …) Membership (consortium) Many validators Few validators Wide range of users Small range of users (B2B) Relatively low performance Relatively high performance Managed by ecosystem Managed by stakeholders “Internet” “Intranet” The subject of this course is open (public) protocols and crypto markets
  • 62.
    Vertical scaling Lightning Network •Micro-payment channel network (Level 2) • Many hubs with many open channels • A channel is a multisig address with a frozen collateral • Micro-payments are made as the exchange of commitment transactions (off-chain), payments can be locked between hubs • Any party can close the channel by publishing the last transaction and receiving the balance to his or her address Joseph Poon, Thaddeus Dryja. The Bitcoin Lightning Network: Scalable Off-Chain Instant Payments, 14 Jan 2016 https://lightning.network/lightning-network-paper.pdf
  • 63.
    Vertical scaling Advantages: • Thetransactions are carried out in milliseconds • Safety is guaranteed by blockchain • Does not require trust between the participants • Scalability is up to 1 million per second or more • Low transaction costs • The possibility to carry out micro-transactions (<$1) • Crosschain atomic swaps, non-custodial DvP trading
  • 64.
  • 65.
  • 66.
    Vertical scaling Disadvantages: • Openingand re-opening channels requires transaction costs • The hub needs to keep the frozen capital in the channels https://www.trustnodes.com/2019/08/20/guy-makes-20-a-month-for-locking-5- million-worth-of-bitcoin-on-the-lightning-network • The average amount of collateral in the channels is small ($20), payments over $5 can be a problem • "Sending payments using the Lightning Network is cheaper than the regular Bitcoin network, but suffers from routing errors and wallet bugs that make it impractical even for highly technical users” https://news.bitcoin.com/a-look- at-what-it-was-like-to-operate-the-lightning-networks-largest-node/
  • 67.
    • Bank ofEngland – The emergence of digital currencies (2014) http://www.bankofengland.co.uk/publications/Documents/quarterlybulletin/2014/ qb14q3digitalcurrenciesbitcoin1.pdf • WEF – The future of financial infrastructure (Aug 2016) http://www3.weforum.org/docs/WEF_The_future_of_financial_infrastructure.pdf • D.Fantazzini, E.Nigmatullin, V.Sukhanovskaya, S.Ivliev. "Everything you always wanted to know about bitcoin modelling but were afraid to ask". Applied Econometrics (2017) https://mpra.ub.uni-muenchen.de/71946/ • European Parliament. “Virtual currencies and central banks monetary policy: challenges ahead” (2018) http://www.europarl.europa.eu/cmsdata/149900/CASE_FINAL%20publication.pdf • J.Song. “Why blockchain is hard” (2018) https://medium.com/@jimmysong/why- blockchain-is-hard-60416ea4c5c • http://www.mas.gov.sg/News-and-Publications/Speeches-and-Monetary-Policy- Statements/Speeches/2018/Crypto-Tokens-The-Good-The-Bad-and-The-Ugly.aspx Useful links
  • 68.
  • 69.
    Smart contracts Unlike Bitcoin,which stores only the transaction log (UTXO = Unspent Transactions Output), Ethereum stores both transactions and ledger states. In addition to ledger state (balances), Ethereum can store the state of smart contract variables. Technical details https://hackernoon.com/getting-deep- into-ethereum-how-data-is-stored-in- ethereum-e3f669d96033
  • 70.
    Smart contracts Smart contractsare created in a high- level language (Solidity), they are then compiled into low-level machine code (bytecode). Bytecode is loaded into Ethereum by sending a transaction of a special type using "Contract creation". The loaded smart contracts can be performed on the Ethereum Virtual Machine (EVM). https://etherscan.io/addres s/0xbdf6a89f7c50b15d6b9 b6f35dba58fc240c1bb89# code
  • 71.
    Smart contracts The EthereumVirtual Machine (EVM) is a decentralized computer that can process smart contracts, confirming the changed state of variables on the blockchain. All EVM nodes perform smart contract and validate a definite output.
  • 72.
    Smart contracts The codeis executed up to 100 times slower than locally The cost of using memory and storage is at the level of 50-ies of the 20th century The outputs can be changed in the first 60 seconds
  • 73.
    Smart contracts It isthe world's first single computer for the entire planet It cannot be stopped and it is independent of states and corporations Available wherever there is Internet It can perform any calculation that is possible to perform (Turing completeness), including infinite loops
  • 74.
    Smart contracts Gas isa metric to evaluate and limit the use of resources for the EVM. Each operation (command, variable, etc.) requires a certain amount of gas. The more there are calculations and storage use, the more gas is required. When calling any smart contract function, the sender should specify GasLimit and GasPrice. If the transaction goes out of GasLimit, it will fail, but a fee will be charged to the sender: Fee = Amount of Gas * GasPrice
  • 75.
    Useful links Minimum viabletoken Crowdfunding DAO (Decentralized Autonomous Organizations) Dapps (distributed applications) https://ethereum.org/token https://ethereum.org/crowdsale https://ethereum.org/dao https://www.stateofthedapps.com/
  • 76.
  • 77.
    #DeFi Decentralized Finance (#DeFi)is the movement that leverages open source software and decentralized networks to transform traditional financial products into trustless and transparent protocols that operate without unnecessary intermediaries. Among its core principles are transparency, accessibility and financial inclusion. Decentralized Finance participants are able to reduce counterparty risk via cryptographic verification on public blockchains.
  • 78.
    #DeFi • Payments (cryptocurrencies,stablecoins) • Funding (ICO, IEO, STO) • Borrowing • Lending • Decentralized exchanges (DEX) • Prediction markets • Asset management / Investments • Insurance #DeFi
  • 79.
    Tokens ERC20 Tokens ERC =Ethereum Request for Comment Standard interface to call such functions as checking balance, transfer and withdrawal of tokens https://github.com/ethereum/ei ps/issues/20 The vast majority of Ethereum tokens is compatible with this standard Matrix of balances: {0x1, 100; 0x2, 250; 0x3, 0,….} Token transfer function: transferFrom (0x2, 0x3, 100) will change the state of the balances variable as follows: It was {0x1, 100; 0x2, 250; 0x3, 0,….} It is now {0x1, 100; 0x2, 150; 0x3, 100,….} Balance inquiry function: balanceOf(0x2) will give 250 back
  • 80.
    Stablecoins Stablecoins combined: ~$5bln supply https://coinmetrics.io/charts/#assets=dai,gusd,pax,usdc,tusd,usdteth,usdt_log=f alse_left=SplyCur_zoom=1508378538572.8643,1571795370814.0703
  • 81.
    Stablecoins Ex-USDT stablecoins: ~$1bln https://coinmetrics.io/charts/#assets=dai,gusd,pax,usdc,tusd,usdteth,usdt_log=f alse_left=SplyCur_zoom=1508378538572.8643,1571795370814.0703
  • 82.
    Funding 5250 ICO (583in 2019) 1722 successful (33% success) $26.4b raised ($3.3b in 2019) https://www.inwara.com/report/ blockchain-crypto-report-h1- 2019 https://icobench.com/reports/IC Obench_ICO_Market_Analysis _June_2019.pdf ICO: party is not over!
  • 83.
  • 84.
  • 85.
  • 86.
    Funding https://twitter.com/lawmaster/status/1159130591209689088 Angry investors Median ROI-87% <11% ICOs ROI>0% Top-5 ICOs: - BNB (5,902%) - IOTA (1,744%) - Ethereum (1,339%) - Lambda (962%) - ChainLink (668%)
  • 87.
  • 88.
  • 89.
    Dai: Stablecoin +Borrowing MakerDAO $78 mln Dai issued 1.3 mln ETH locked in collateral (1.29% of ETH) Collateral ratio 320% 13.9k CDPs 105k Dai Holders ~20% lending rate https://mkr.tools/system
  • 90.
    xDai: Stablecoin Payments xDai Sidechainwith 4 validators 2-way bridge to Ethereum (POA) 5s block time Capacity up to 1500 tps 13k xDai addresses <$0.001 fee per tx paid in Dai ZK for privacy (AZTEC) https://poa.network/xdai
  • 91.
    Borrowing & Lending Compound,InstaDapp, Dharma, dYdX, Nuo $129m value locked 396k ETH locked in compound as collateral (0.37% of ETH)
  • 92.
    Borrowing & Lending Compound Depositsare tokenized as cTokens (e.g.cDai) Rate of cToken to underlying asset varies with the interest rate Interest rate varies dynamically with supply & demand Interest accrued ~15s
  • 93.
  • 94.
    Decentralized exchanges Uniswap, Bancor,Kyber Onchain orderbook Zero-KYC Delivery vs. payment The spot-swaps of ERC20 tokens via the underlying asset (ETH, BNC) Automated price reserves for liquidity provision ~$3m/day traded volume
  • 95.
  • 96.
    Asset management Set protocol Tokenizedstrategies Non-custodial baskets of assets (Dai, WBTC) Rebalancing with modified dutch auction Integration with DEX
  • 97.
    Aggregators Zerion Access to variousprotocols DeFi Portfolio management Others: InstaDapp, Settle
  • 98.
  • 99.
    Summary • Bitcoin wholesalepayment and SoV (aka digital gold) is a strong use case • Ethereum DeFi is vibrant, but still a proof of concept • Advantages: - Inclusive (zero KYC, no censorship) - Non-custodial (no counterparty credit risk) - Transparent and price efficient - Global, low cost, fast finality • Disadvantages: - Overcollateralized (doesn’t help unbanked to get loans) - Technical barrier (e.g. Metamask, keys, …) - Bridge problem - Still in beta
  • 100.
    Useful links A curatedlist of awesome decentralized finance projects, software, and resources. https://github.com/ong/awesome-decentralized-finance DeFi metrics https://defipulse.com/ Binance Research report on DeFi https://info.binance.com/en/research/marketresearch/defi-1.html
  • 101.
  • 102.
    Collectibles Cryptokitties Digital collection Slowed downthe Ethereum network: 14k DAU, $12 million (11.12.17) The collection includes over 900 thousand tokens The ERC-721 standard (Non- fungible token, NFT) for digital assets created VC (2018): $12 million (a16z) Dragon 600 ETH (~$170,000)
  • 103.
    Markets > 1.2 milliontoken cryptocollectibles (game characters, digital art, etc.) VC (2018): $2 million (YC)
  • 104.
    Prediction markets Augur, Stox Bettingon the outcome of sports, political and economic events Bets and payouts in tokens and ETH Competitors: Augur, Gnosis ICO (2018): 147k ETH (~$33m, 34 hours)
  • 105.
    Social media Peepeth Distributed Twitter Noadvertising No censorship No ability to change or delete anything Funding cancelled
  • 106.
    Fog Computing SONM p2p-marketplace ofcomputing capacity Machine learning Video rendering Web hosting service Scientific computing and so on Payment in SONM tokens ICO (2017): $42 million (4 days, 8,774 participants)
  • 107.
    Decentralized storage STORJ p2p-marketplace ofdisk space Backups, archives Media content Transfer of large files Logs 19k farmers, 20k API users Payment in STORJ tokens ICO (2017): $30 million (7 days)
  • 108.
  • 109.
    Digital identity uPort Self-sovereign identity(SSID) Claims are stored on the blockchain Recovery in case of key loss Integration with the state ID (Zug) Similar projects: Civic, Self-Key
  • 110.
    Decentralized applications Summary: • 2,000dapps and several millions of smart contracts on Ethereum alone • Most popular dapps are DeFi, collectibles, games and gambling • The total audience of dapps is not very significant yet (~10-50k /day) • Biggest issues poor user experience, poor token economy, poor scalability
  • 111.