Blockchain
Technology

Andreas Park

Part 1: 30,000 ft

Part 1: 30,000 ft overview

  • Motivation and background
  • Blockchain architecture
  • basic functionality
  • demo of workflow in a blockchain

Part 2: Drilling down

  • components of blockchain transactions
  • keys, signatures, and addresses
  • hashing
  • consensus protocols
  • mining

Part 3: Moving along

  • blockchain privacy & zero knowledge
  • scaling solutions
  • Proof of stake vs proof of work
  • alternative approaches: EOS and Cardano, Linux Hyperledger, Corda

Part 4: Smart contracts

  • ERC20 tokens as a new finance tool
  • basic solidity demo

Schedule of Topics

Learning Objectives

  • most online resources and books are 
    • either too shallow and written by evangelists
    • or too technical and written by & for developers
    • or plainly obnoxious and written by crypto-peddlers 
  • my goal:
    • provide an in-depth intro to the concepts and functioning of blockchains
    • go into detail on key issues
  • desired outcomes
    • solid understanding of key concepts
    • ability to assess pros/cons and possible use cases
    • identify challenges for applications
    • understand basic logic of smart contracts

What this course is not teaching you

  • focus is on public, permissionless blockchains, not "private", permissioned blockchains
  • crypto-trading
  • whether or not Bitcoin is in a bubble

Narrated Version on             

Objectives

  • Understanding how value transfers work today
  • Demo of a blockchain transfer
  • Blockchain as a database
  • Work flow and block/blockchain architecture
  • Demo of workflow 
  • Identifying what areas we need to drill down in

30,000 ft Overview

Big Picture of Main Changes in the Financial Industry

  1. Automation of banking and banking services 
    • building and linking of databases
    • cloud computing to link data and scale power
    • usage of predictive analytics
    • process automation
  2. Disintermediation
    • access to information => fewer intermediaries needed
    • digitization of services
    • digitized infrastructure => blockchain

Sue wants to send Bob money

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

Bottom Line

  • very complex

  • many parties

  • lots of friction

  • expensive

Crazy thought:

Wouldn't it be nice if there was a single ledger?

One more: a stock trade

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

Crazy thought:

Wouldn't it be nice if the money and stock transfer could be arranged on the same ledger?

Blockchain as a Database

Blockchain

=

Ledger

Ledger

=

append-only database

Current world: many databases that need to be reconciled for value transfers

Central database would be most efficient

  • hacking/security/redundancy
  • who controls the database?
  • how would this work across multiple countries?

One thought: distributed database

  • how does updating work?
  • who gets to write?
  • who regulates/sets rules?

blockchain is a distributed database that

  • anyone can read
  • anyone can write to
  • operated by voluntary participation
  • open to anyone
  • regulated by no=one
  • knows no borders

Basic Operation

think of blockchain as

  • a cloud database of accounts
  • where info is stored under IDs; mine is 0x91C44E74EbF75bAA81A45dC589443194d2EBa84B
  • that you access and use with a software called "wallet"

Quick detour: how do you get cryptocurrencies

Step 1:

send dollars to (say) coinbase using a bank transfer of a credit card

Step 2:

convert dollars to cryptocurrency at 

Step 3:

send crypto to blockchain address

0xA69958C146C18C1A015FDFdC85DF20Ee1BB312Bc

0x91C44E74EbF75bAA81A45dC589443194d2EBa84B

0x4E3996EEae8Bb4BC0f041Fd9ead61e639B29167A

Here follows an in-class demonstration of a transfer

Public Information about my address

In class demonstration of token generation

In class demonstration of EtherDelta token trading

Needless to say, you can also use it "differently" ...

Blockchain transaction work flow

Step 1: address

 composes and signs transaction

digitally signed

transaction:

0x4E3996EEae8Bb4BC0f041Fd9ead61e639B29167A

sends 0.002 Ether to

0x91C44E74EbF75bAA81A45dC589443194d2EBa84B

Step 2: send transaction to P2P network of validators

Step 3: validators validate that signer owns has sent transaction and owns Ether

Step 4: transactions are bundled with others in "block" and appended to the existing blocks

Simplified Architecture of a Block

Header:

  • link to past block
  • block number
  • coinbase
  • time stamp
  • Merkle root
  • nonce

 

Main part

  • transactions

 

 

 

transaction:

0x4E3996EEae8Bb4BC0f041Fd9ead61e639B29167A

sends 0.002 Ether to

0x91C44E74EbF75bAA81A45dC589443194d2EBa84B

transaction:

0x4E3996EEae8Bb4BC0f041Fd9ead61e639B29167A

sends 0.002 Ether to

0x91C44E74EbF75bAA81A45dC589443194d2EBa84B

transaction:

0x4E3996EEae8Bb4BC0f041Fd9ead61e639B29167A

sends 0.002 Ether to

0x91C44E74EbF75bAA81A45dC589443194d2EBa84B

transaction:

0x4E3996EEae8Bb4BC0f041Fd9ead61e639B29167A

sends 0.002 Ether to

0x91C44E74EbF75bAA81A45dC589443194d2EBa84B

Simplified Architecture of a Blockchain

  • link to past block
  • block 23456 
  • coinbase
  • nonce

 

 

 

transaction:

0x4E3996EEae8Bb4BC0f041Fd9ead61e639B29167A

sends 0.002 Ether to

0x91C44E74EbF75bAA81A45dC589443194d2EBa84B

transaction:

0x4E3996EEae8Bb4BC0f041Fd9ead61e639B29167A

sends 0.002 Ether to

0x91C44E74EbF75bAA81A45dC589443194d2EBa84B

transaction:

0x4E3996EEae8Bb4BC0f041Fd9ead61e639B29167A

sends 0.002 Ether to

0x91C44E74EbF75bAA81A45dC589443194d2EBa84B

transaction:

0x4E3996EEae8Bb4BC0f041Fd9ead61e639B29167A

sends 0.002 Ether to

0x91C44E74EbF75bAA81A45dC589443194d2EBa84B

  • link to past block
  • block 23457
  • coinbase
  • nonce

 

 

 

transaction:

0x4E3996EEae8Bb4BC0f041Fd9ead61e639B29167A

sends 0.002 Ether to

0x91C44E74EbF75bAA81A45dC589443194d2EBa84B

transaction:

0x4E3996EEae8Bb4BC0f041Fd9ead61e639B29167A

sends 0.002 Ether to

0x91C44E74EbF75bAA81A45dC589443194d2EBa84B

transaction:

0x4E3996EEae8Bb4BC0f041Fd9ead61e639B29167A

sends 0.002 Ether to

0x91C44E74EbF75bAA81A45dC589443194d2EBa84B

transaction:

0x4E3996EEae8Bb4BC0f041Fd9ead61e639B29167A

sends 0.002 Ether to

0x91C44E74EbF75bAA81A45dC589443194d2EBa84B

  • link to past block
  • block 23458
  • coinbase
  • nonce

 

 

 

transaction:

0x4E3996EEae8Bb4BC0f041Fd9ead61e639B29167A

sends 0.002 Ether to

0x91C44E74EbF75bAA81A45dC589443194d2EBa84B

transaction:

0x4E3996EEae8Bb4BC0f041Fd9ead61e639B29167A

sends 0.002 Ether to

0x91C44E74EbF75bAA81A45dC589443194d2EBa84B

transaction:

0x4E3996EEae8Bb4BC0f041Fd9ead61e639B29167A

sends 0.002 Ether to

0x91C44E74EbF75bAA81A45dC589443194d2EBa84B

transaction:

0x4E3996EEae8Bb4BC0f041Fd9ead61e639B29167A

sends 0.002 Ether to

0x91C44E74EbF75bAA81A45dC589443194d2EBa84B

}

}

So many items that require clarification!

digitally signed

transaction:

0x4E3996EEae8Bb4BC0f041Fd9ead61e639B29167A

sends 0.002 Ether to

0x91C44E74EbF75bAA81A45dC589443194d2EBa84B

  • where does the address 0x4E3996EEae8Bb4BC0f041Fd9ead61e639B29167A come from?
  • what does "digitally sign" mean?

Header:

  • link to past block
  • block number
  • coinbase
  • time stamp
  • Merkle root
  • nonce

 

Main part

  • transactions

 

 

 

transaction:

0x4E3996EEae8Bb4BC0f041Fd9ead61e639B29167A

sends 0.002 Ether to

0x91C44E74EbF75bAA81A45dC589443194d2EBa84B

transaction:

0x4E3996EEae8Bb4BC0f041Fd9ead61e639B29167A

sends 0.002 Ether to

0x91C44E74EbF75bAA81A45dC589443194d2EBa84B

transaction:

0x4E3996EEae8Bb4BC0f041Fd9ead61e639B29167A

sends 0.002 Ether to

0x91C44E74EbF75bAA81A45dC589443194d2EBa84B

transaction:

0x4E3996EEae8Bb4BC0f041Fd9ead61e639B29167A

sends 0.002 Ether to

0x91C44E74EbF75bAA81A45dC589443194d2EBa84B

  • How do you "link" to the past block and why?
  • What is a coinbase? Does that relate to the firm?
  • What is a Merkle root?
  • What is a nonce?

So many items that require clarification!

  • All these questions will be answered in detail. 
  • Today, we will cover the principles only so you can see why it's all used

Time for a Demonstration

  • here follows an in-class demonstration of 
    • hashing,
    • mining,
    • and their relation to the architecture of a blockchain
  • this demonstration uses Anders Brownworth's excellent demo at
    • anders.com/blockchain

This is a link to Anders Brownworth's Demo Video

Summary of the Demonstration

  1. A block is in essence just text
  2. A Hash is
    • a function that produces a collection of letters and numbers
    • that is deterministic (same text => same hash)
    • impossible to invert (you can guess, but there is no inverse function)
  3. A nonce is
    • a special piece of text that 
    • combined with the hash of the rest of block produces a new hash that starts with 4 zeros (in the demo)
  4. Blocks are linked
    • by including a hash of the last block in the header of the new block
  5. The block-link is secure because
    1. tampering with the past alters the hashes of past info
    2. would be inconsistent with current state (expressed as a hash)

Objectives

  • Understanding how value transfers work today
  • Demo of a blockchain transfer
  • Blockchain as a database
  • Work flow and block/blockchain architecture
  • Demo of workflow 

Summary: 30,000 ft Overview

What we now need to understand and drill down to:

  1. Blocks are linked by hashes => what is a hash
  2. Transactions are associated with addresses? => What is an address?
  3. Transactions are signed? => How does signing work?
  4. Block validation requires a "nonce" => what is that all about?

Blockchain Module Part 1: 30,000 ft

By Andreas Park

Blockchain Module Part 1: 30,000 ft

This deck is for the first of four lectures on Blockchain technology in finance, taught at the Rotman School of Management, Spring 2018. A narrated version is on my YouTube channel (please subscribe!) https://www.youtube.com/watch?v=SZzETQW_cVk&list=PLTmzBTSqnXdtm9qq9H3sRgfTmlX55qZER

  • 1,354