Blockchain Technolgy and Decentralized Finance

Instructor:           Andreas Park
 

 

Rotman – Master in Financial Risk Management

Financial Innovation

Agenda for the three lectures

  1. What is blockchain technology, what is DeFi, where this is coming from, why, how does it work,  and why should you care.
  2. Decentralized Finance applications:
    • trading
    • borrowing and lending
    • derivatives
  3. Blockchain assets: cryptocurrencies, utility tokens, stablecoins, governance tokens, NFTs
  4. Some related developments:
    • Diem
    • Central-bank issued digital currencies
  1. What is blockchain technology, what is DeFi, where this is coming from, why, how does it work,  and why should you care.
  2. Decentralized Finance applications:
    • trading
    • borrowing and lending
    • derivatives
  3. Blockchain assets: cryptocurrencies, utility tokens, stablecoins, governance tokens, NFTs
  4. Some related developments:
    • Diem
    • Central-bank issued digital currencies

5-minute version:
What is a blockchain?

blockchain=

an infrastructure for digital resource transfers

5-minute version:
What is a cryptocurrency?

cryptocurrency = 

internal payment mechanism to pay for operation of a blockchain

5-minute version:
What is Decentralized Finance?

decentralized finance =
provision of financial services without the necessary involvement of a traditional financial intermediary based on blockchain technology

in practice: new financial infrastructure that will be a common resource

payments

stocks, bonds, and options

swaps, CDS, MBS, CDOs

insurance contracts

Application: decentralized trading

Application: Decentralized Lending

\(\vdots\)

dapp-linking, Defi-Legos and flash loans

Source: Harvey, Ramachandran, and Santoro (2020)

Silos vs Common Infrastructures

Illustration of Infrastructure Frictions: money transfers

Version 1: They use the same bank

Change ledger entry locally

Version 2: They use different banks but the banks have a direct relationship

Sue's bank transfers from Sue's account to Bob's bank's account

Bob's bank transfers from its account to Bob's account

Version 3: They use different banks that have no direct relationship

Sue's bank transfers from Sue's account to its own account

Bob's bank transfers from its account to Bob's account

Central Bank

Central bank transfers from Sue's bank's account to Bob's bank's account

International transfers

Sue's bank transfers from Sue's account to its own account

Bob's bank transfers from its account to Bob's account

use the Swift network of correspondent banks

Source: Wendy Rotenberg's Payments lecture

Bottom Line

very complex

many parties

lots of frictions and points of failure

very expensive

Crazy thought: Wouldn't it be nice if there was a single ledger/common resource?

Existing solutions

Problem:
power concentration/Monopoly

Distributed Ledger/Blockchain Technology

  • "joint, single system" "shared resource" "common infrastructure"
  • Features:
    • secure storage of information and transfer of value
    • guaranteed execution of code
  • Promise
    • open platform
    • global reach
    • frictionless finance

How does it all work and why?

How do we establish trust in commerce?

trustworthy People

long-term Relationships

reputation

contract law

institutions

How do we get trust in an open system with anonymity?

What's needed for trust in  anonymous deals?

Authority

Execution

Continuity

Authority

Do you have the item?

Do you have power over it?

Tool: "key" cryptography

Execution

Can we agree that it happened?

Tool:
consensus algorithm

Security and Continuity

Are the records immutable?

restricted permissions

really difficult to hack

premise of blockchain

no trusted parties needed

everything
in code

open to
anyone

platform or network

commerce thrives

How?

A deep dive into the "How?"

Cryptography: only Sue can spend her money

Authority

Simplest case: symmetric encryption:
public key P = private key S

Small detour: sending a encrypted message

Pb

Sb

Pb

Sb

Small detour: sending a encrypted message

Modern encryption: asymmetric encryption
public key \(P_b\), private key \(S_b\)

Alice wants to send Bob a message and provide proof that its her.

What we really need: digital signatures

Sa

Pa

Pa

Execution

Security

Immutability

Problem: double-spending

How can we trust that

  1. sale happened and
  2. $$ only spent once?

Cryptography
\(\Rightarrow\) signature cannot be hacked

Proof of Work Protocol

A Byzantine Fault Tolerant Algorithm

This Hash starts with a pre-specified number of zeros!

B3

B1

B2

B4

B5

Contains transaction from Alice to Bob

Question: Can Alice rewrite history?

Immutability

B3

B1

B2

B4

B5

B6

Where to add a new block \(B_7\)?

  • Add to \(B_3\)?
    • future block \(B_8\) more likely to be added to \(B_6\)
    • \(\to\) lose "coinbase" reward
    • \(\to\) add to \(B_6\)

Detour: Longest chain rule

Equilibrium for "the longest chain"? - Yes!

  • "Blockchain Mining Games" by Kiayias,Koutsoupias, Kyropoulouz, and Tselekounis, Proceedings of the 2016 ACM Conference on Economics and Computation, 2016
  • "The blockchain folk theorem" by Biais, Bisière, Bouvard, and Casamatta, RFS 2018

Note: 

  • accidental "forks" can happen, in particular in fast chains (because of system latencies)
  • \(\to\) need several block confirmations to accept as transaction as settled

B3

B1

B2

B4

B5

  • be faster
  • be able to block confirmations

B8

B7

B9

B10

B6

Contains transaction from Bob to Alice

Bob wants to undo the transaction by rewriting history with B6

Selfish Mining Attack

How?

\(\to\)
create predictability of mining

\(\to\)
have 51% of mining
(= confirmation) power

Back of the envelope calculation (based on 2018)

  • hashrate: 25,000,000 TH/s
  • best GPUs have 2.5GH/s per card=0.0025 TH/s
  • => need 25,000,000 x 400 x 0.5 = 5,000,000,000 GPUs
  • 1 GPU costs around $200
  • =>Cost = $1,000,000,000,000
  • Note from 2020: this cost has not gone down

NB: there is a slightly more subtle view of  selfish mining in which the miner creates a block but holds it back to keep mining exclusively on a part of the chain. Sapirshtein,  Sompolinsky, and Zohar (2015) show that 23.21% of mining power is sufficient for such an attack

related model: Budish (2018)

Selfish Mining Attack

  • cost of mining a block: \(c\)
  • number of miners: \(N\)
  • block reward: \(B\)

basic economics:

expected gain of mining \(\ge\) cost of mining

\(\Rightarrow\) probability of winning \(\times\) block reward \(\ge\) cost

\frac{1}{N}\times B\ge c

\(\to\) holds for all miners

\(\to\) in equilibrium: aggregate cost of mining \(=\) aggregate benefit

\Leftrightarrow~c\cdot N=B

related model: Budish (2018)

Selfish Mining Attack

  • value of attack: \(V\)
  • to gain 50% control, pay: \(c\cdot N\)
  • need to gain \(A>1\): (\(A/(A+1)>.5\)
  • block confirmation convention: \(t\)

\(\to\) cost of attack: \(t\cdot A\cdot c\cdot N\)

total benefit of attack

  • attack value \(V\)
  • block rewards \(t\cdot B\)

\(\to\) for unattractive attack: cost \(>\) benefit

t\cdot A\cdot \underbrace{c\cdot N}_{=B} >V+t\cdot B
t\cdot B(A-1)> V
\Rightarrow \exists \mathbb{V} \text{~s.t.~} \forall \tilde{V}>\mathbb{V}~~\tilde{V}>t\cdot B(A-1)

means amounts above \(\mathbb{V}\) cannot be secured

Double spend attack prevention

  • Validation rewards are taken as given, but they are crucial in
    • determining incentives to participate,
    • to support the chain, and
    • to expense electricity and computing power

Basic idea of competitive equilibrium

aggregate mining cost = aggregate reward

Double spend - selfish mining attack

  • win \(N\) block rewards until confirmation block
  • ability to double-spend
     

condition that prevents it
(Chiu & Koeppl RFS 2018)


 

\text{mining reward} \times (N+1)N > \text{double spend amount}

Selfish Mining Attack

HOWever! with attacking don't you
shoot yourself in the foot?

  • First attack in May 2018
  • double spent of $18 million worth of Bitcoin Gold
  • \(\to\) Loss of confidence in Bitcoin Gold and decline in exchange rate
  • Only 1/6 of pre-attack value
  • transactions \(\searrow\) one-third

G

  • models:  per period flow cost of mining
  • Prat & Walter (2019): 2/3 of mining cost are fixed costs.

    G

HOWever! with attacking don't you
shoot yourself in the foot?

Garrat & van Oordt (WP 2020)

HOWever! with attacking don't you
shoot yourself in the foot?

Garrat & van Oordt (WP 2020)

drop in exchange rate S

=loss

What can it for finance, what are problems and obstacles?

Obvious application: trading

Sue wants to sell ABX

Bob wants to buy ABX

sell order

buy order

Clearing House

Stock Exchange

Broker

Broker

3rd party tech

custodian

custodian

record beneficial ownership

central bank for payment

Evolution

With Blockchain: single ledger for money and securities

0xA69958C146C18C1A015FDFdC85DF20Ee1BB312Bc

0x91C44E74EbF75bAA81A45dC589443194d2EBa84B

0xA65D00Eda4eEB020754C18e021b1bF4E66C9Ed90

  • blockchain 1.0
  • first solution to double spending
  • clunky, slow, expensive
  • huge following and computing power

vs

  • blockchain 2.0
  • smart contract platform
  • highly flexible
  • foundation for many private initiatives
     

"Let me just say how impressed I am with Ethereum...If Bitcoin is email ––a one-trick pony, so to speak, but obviously revolutionary–– Ethereum goes far beyond that; it's more like the Internet...The whole idea of DeFi really is, number one, it’s obviously revolutionary, and I think at the end of the day could lead to a massive disintermediation of the financial system and the traditional players."

Heath P. Tarbert, CFTC Chairman, October 2020

Usage of blockchain in financial industry

Areas of applications

moving value (remittances)

digital money: real-time settlement, reduced reserves

tokenization of assets

automization of contract payments

securitization

systems and infrastructure reorganization

digital identity

new forms of financial contracts, assets, and forms of financing

What Changes in Business Models can Blockchain Technology bring?

What does blockchain do?

peer to peer value transfers

self-powered platforms

contract execution

disintermediation

Who do you dis-intermediate, and then who is your customer?

issuer

investor

broker-dealer

The Business challenge of dis-intermediation

investment advisor

economics of Platforms are tricky

  • is it worth it for me to engage at all?

  • is the desired action of the platform the best for me?

Not everything that can be measured matters and not everything that matters can be measured

  • must be aligned with long-run goal of platform

  • must be under the control of platform participant

What does the platform need people to do?

Is there a suitable performance metric?

Utility tokens fail \(\Rightarrow\) not good platform tokens

Equity tokens fail too!

Observation: many Decentralized Apps = platform for  two-sided, dis-intermediated market

Question 3: Do you need to incentivize the establishment of trust?

Question 2: What kind of incentives can you provide?

Question 1: What role does the intermediary play, what service does it provide?
 

  • Trust

  • Matchmaking

  • Time/size intermediation

  • marketing
     

Challenges

Proof of Work uses unsustainable amounts of energy

Source: Cambridge Bitcoin Energy Consumption Index https://cbeci.org/

Ethereum is full and using it is expensive

Scalability projects for Ethereum

  • Ethereum blocks have no size limit
     
  • but: gas limit imposes computation  limit and thus transaction limit
     
  • note: in contrast to Bitcoin, Ethererum always announced that it would eliminate proof-of-work eventually

     

Root Problem

  • Side Channels:
    • Keep two-party interactions off the main chain and use chain only for terminal settlement
  • Sharding
    • instead of storing all info on all nodes, break up the blockchain into shards
    • \(\to\) hard problem!

Solutions

https://blog.stephantual.com/what-are-state-channels-32a81f7accab

a better blockchain: Conflux

  • Current networks (Bitcoin, Ethereum, etc.) have limited throughput
  • Unclear long-term economic sustainability
    • Vulnerability to double spending attack once block rewards phase out
  • Inefficient use of storage space
    • Inactive smart contracts occupies state storage
  • Vulnerable to fairness attack
    • An attacker with more than 23.21% computation power can potentially obtain rewards disproportional to its computation power by selfish mining

Conflux: Consensus with TreeGraph

•Blocks are organized in a directed acyclic graph (DAG)

•No concurrent blocks are discarded, leading to higher throughput

a better blockchain: Conflux

Greedy Heaviest Adaptive SubTree (GHAST) algorithm

  • Blocks are assigned a weight according to the topologies
  • Exists a deterministically heaviest chain called pivot chain
  • An epoch contains one pivot chain block and its reachable blocks

Transaction Processing

  • Blocks are processed sequentially ordered by epoch, topological order and id
  • Only the first occurrence of the transaction is processed
  • up to 4,000 tps for simple payment transactions
  • Note: runs Solidity \(\to\) 100\% compatible with all Ethereum smart contracts

Disclaimer: token design strongly influenced by yours truly

going back to Budish (2018)

Selfish Mining Attack in CONFLUX

Serial Chain

Conflux Chain

In Conflux, withholding a block leads to greater anti-cone size

Intuition: Anticone = blocks created without properly referencing others blocks in its vicinity

Selfish Mining/Double-Spent Attack in CONFLUX

Key problem of Proof-of-Stake:

How to incentivize support of longest chain?

B3

B1

B2

B4

B5

B6

Where to add a new block B7?

  • PoW: only longest chain
  • PoS: could add both at B3 and  B6 (nothing-at-stake)
    • solution: punish deviations!

My personal problem: I have not yet seen a convincing theoretical model of PoS

economic result: Fahad Saleh (2021) Review of Financial Studies, "Blockchain Without Waste: Proof-of-Stake" shows that PoS is an equilibrium

current state: 

  • promised since 2014
  • secondary PoS chain in operation
  • merger of chains expected in late 2021

From Snowflake to Avalanche - Emin Gün Sirer

a better consensus mechanism: avalanche

now in operation in Athereum (fork of Ethereum)

Reality Check: Capacity

transactions per second T per 12 hours (business day)
Bitcoin 7 302,400
Ethereum 30 1,296,000
Algorand 2000 86,400,000
Conflux 4000 172,800,000
Athereum 5000 216,000,000
Payments Canada ACSS 648 28,000,000
US retail 7639 330,000,000
Canada number of equity trades 46 2,000,000
Orders on Canadian equity markets 3588 155,000,000
  • Tweaks: lighting network (BTC) or side chains, SegWit, blocksize possible, but there are limits

  • microtransactions, IoT, and other smart contract use cases place very high demands

Miner extractable value and High Priority Gas Auctions

Private Sector Solutions

Private vs. public

some key questions

Who gets to update?

Can a higher body prevent
transactions?

Can the past be altered?

consensus

immutability

censorship resistence

Public Blockchains provide

Main private blockchain systems

Features of Private vs. public blockchains

open to anyone

no one can be excluded

past cannot be changed

Public Blockchains

private Blockchains

high visibility of transactions

open-access eco-system

slow governance

privacy only at a cost

joint control and governance

straightforward KYC and AML

tech support

transaction secrecy simpler

rely on corporate development

compliance with law (reversion)

can keep competition out

The most controversial entrant of them all ...

Partnerships

"new financial infrastructure"

(now called Diem btw)

The One the world is talking about

What is Libra and how does it work? 

issued by a consortium of firms (e.g., Facebook, Stripe, Lyft) and not-for-profits (Creative Destruction Lab)

two types of coin: single-currency stablecoins and multi-currency stablecoin, fully backed by reserves

  • central banks will retain control on how Libra network is used in their countries
  • envisioned integration of CBDCs

The One the world is talking about

Multi-Currency coin 

idea is conceptually similar to IMF Special Drawing Rights (pegged to USD, EUR, YEN, GBP, YUAN)

in Libra, this coin is a composite, not separate asset

not "pegged", but will fluctuate relative to any other currency (a bit like an ETF)

  • reserve:
          \(\sum\) cash or cash-equivalents, very short-term government securities
    \(=\sum\) face value of Libra Coins in circulation
  • Administration: transparent to the public and auditable. 
  • \(+\) capital buffer.

The One the world is talking about

Aspiration

  • open technology standard with incumbents and startups competing
  • Open and transparent membership criteria
  • Low switching costs, low barriers to entry and high interoperability

Governance

  • Founding Members for
    • early utility and adoption
    • standard setting
  • Ultimately: governance=distributed

The One the world is talking about

Long-Term Goal

  • eventually transition to a permissionless system.

  • Problem: perimeter control - can unknown participants take control of the system and remove key compliance provisions?

  • \(\to\) not happening

Long-Term Network

  • Modeled after mutually owned stock exchanges

  • Expanding membership with competition for slots

  • hope: replicate key economic properties of a permissionless system through an open, transparent, and competitive market for network services and governance.

Survey Info on Libra

Would you use Libra/Money issue by Tech Firm?

If we ask explicitly for Facebook vs Tech Firm

Scaled to yes/maybe/no. About 20% say: "Need more info"

Will people use Libra?

Source: Will Libra Succeed? Results of a Global Randomized Survey Experiment; by Danielle Goldfarb and yours truly

     

 

Enter BigTech

cellphone data from 2018 (NewZoo), inflation from 2020 (World Population Review)

Evolution

DIEM = "new financial infrastructure"

Why does BigTech enter the finance game?

They have ZERO interest in becoming a financial institution/bank

\(\rightarrow\) no expertise

\(\rightarrow\) competitive market

\(\rightarrow\) one of the most regulated business environments

My take

They are trying to deal with frictions that impede their business

They aim to collect data which will vastly improve their business

Lay the groundwork for the next step of the digital evolution: the "Metaverse"

5-minute version:
Finance, Metaverse, and Non-Fungible Tokens

metaverse =
marriage of the digital and physical world

sale price: $69,000,000

What is an NFT?

  • "unique" token
  • digital ownership certificate
  • ERC-721 standard (also ERC-1155)

Why bother with an NFT?

  • difficult legal question: what do you actually own?
  • allows royalty payments
  • could be used in other tools (e-book readers)
  • NFTs can be tokenized (partial ownership)
  • used as collateral in DeFi

Metaverse application

  • ownership in the digital world
  • payment for digital experiences

Related Development: Central Bank-Issued Digital Currencies

Evolution

CBDCs

Newest Developments: CBDC

CBDC = Central Bank issued Digital Currency

not a cryptocurrency \(\to\) just a "normal" liability on central banks balance sheets

  • BIS Jan 2019: "Proceed with caution"

  • BIS Jan 2020: "Impeding Arrival"

Is it coming?

players (inter alia) 

  • China: in test mode; provinces prep own initiatives, coming next year

  • U.S.: has bigger problems and is always a last mover

  • UK: preparing

  • Canada: contingency planning (it'll happen within two years)

players (inter alia) 

Source: CBDCTracker.org

What's the problem and what should a CBDC look like?

current problems

future concerns

crib sheet

too slow

too expensive

not flexible

lack of competition

disintermediation
by new players (DIEM)

data harvesting
with no way out

ineffectiveness
of monetary policy

demise of the Loonie

two-tiered world in Canada

fast

cheap

flexible/programmable

universally accessible
 

Possible CBDC architectures

Source: BIS Quarterly Review, March 2020

What is "disintermediation"?

two types of money

government:

  • reserves

  • cash

commercial

  • each commercial loan \(\to\) deposit

cash withdrawl

convert commercial money into government money

lowers bank's balance sheet

disintermediation \(=\)

Would a CBDC destabilize the banks?

BoC analysis (August 2020):

  • [banks] are well-positioned to absorb potential temporary negative effects on profitability and liquidity
  • Banks[can] absorb the shock under plausible adoption scenarios.
  • [No] threat to the stability of the financial system or to banks’ competitiveness in terms of ROE.
  • banks will maintain healthy liquidity levels, and liquidity could become a concern only in the most extreme scenario.

Why issue a CBDC?

  1. Would a CBDC  improve the efficiency of its currency function?
     

  2. Would CBDC improve the efficiency and safety of both retail and large-value payment systems?
     

  3. Is CBDC an appropriate policy response to payment innovations such as privately issued e-money and digital currency to achieve its monetary policy goals and to implement policies promoting financial stability?

"Central Bank Digital Currencies: A Framework for Assessing Why and How " Fung and Hallaburda 2016, BoC Working Paper

  • the use of bank notes were to continue to decline to a point where Canadians no longer had the option of using them for a wide range of transactions; or
  • one or more alternative digital currencies—likely issued by private sector entities—were to become widely used as an alternative to the Canadian dollar as a method of payment, store of value and unit of account.

When would the BoC issue a CBDC?

Contingency Planning for a Central Bank Digital Currency (BoC website)

Risks and open problems

  • many apps are still experimental, many kinks need ironing, and tech progress is needed
     
  • smart contract risk: 
    • detecting problems with code
    • detecting problems with economic incentives
    • foreseeing unforeseen contract contingencies
    • contract contagion risks
       
  • governance of decentralized organizations
     
  • role of regulators

Agenda for the remaining two lectures

  1. Decentralized Finance applications:
    • trading
    • borrowing and lending
    • derivatives
  2. Blockchain assets: cryptocurrencies, utility tokens, stablecoins, governance tokens, NFTs
  3. Some related developments:
    • Diem
    • Central-bank issued digital currencies

MFRM: Blockchain and Decentralized Finance Intro - Part 1

By Andreas Park

MFRM: Blockchain and Decentralized Finance Intro - Part 1

This slide desk is the intro for the MFRM2020 RSM6313 Blockchain segment of the Financial Innovation course.

  • 1,021