1 of 30

�BLOCKCHAIN SECURITY��Session 02

Dr. Christian Seifert

cseifert@seattleu.edu

Twitter: @cseifert

Telegram: christian_forta

Discord: � Christian | Forta#0582

2 of 30

Outline

  • CPSC 5011: Object-Oriented Concepts
  • Student Project Assignments
  • Announcements – Github Repro
  • Blockchain introduction and history
  • Bitcoin
  • Break
  • Ethereum 
  • Blockchain Use Cases

Page 2

3 of 30

EARLY DIGITAL PAYMENTS

The rise of computers and the internet changed the way money works forever

1955 – Bank of America unveils the ERMA computer for check processing, reducing processing time by 80%

1973 – Visa first digitizes credit cards, reducing processing time to less than 1 minute

1990 – Tim Berners-Lee creates the world’s first-ever website

1994 – Pizza Hut starts accepting order payments online

1996 – OP Financial Group becomes one of the first online banks

1997 – Coca-Cola starts offering the first mobile payments using text

Today, electronic payments make up two-thirds of all non-cash payments.

The wiring in an ERMA machine

First e-commerce payments

Slide Credit: “Michael Lewellen, Blockchain Education Course, Tarski Technologies, LLC”

4 of 30

ORIGINS OF BITCOIN

  • Activists advocated for social and political change using cryptography
  • Began in the 1980’s with a manifesto published by Eric Hughes in 1993
  • Their proposed ideas included a “digital cash”. Many members would later contribute to Bitcoin’s creation

Page 4

Cypherpunks

Advocating online freedom & privacy

  • DigiCash – company founded by David Chaum for anonymous online money backed by cryptography
  • B-money – paper published by Wei Dai in 1998 with another digital cash concept
  • In 1999, the economist, Milton Friedman, predicted the eventual creation of a “reliable e-cash”

Early attempts at e-money

Digital cash pioneers before Bitcoin

  • In 1997, Hashcash is created as an anti-spam mechanism for emails
  • Hal Finney later improves on Hashcash with Reusable Proof of Work (RPoW)
  • Bitgold – published by Nick Szabo in 2004 which built on Finney’s RPOW

Building blocks for Bitcoin

Technologies later used in Bitcoin

Economist, Milton Friedman

John Gilmore, early cypherpunk participant

Slide Credit: “Michael Lewellen, Blockchain Education Course, Tarski Technologies, LLC”

5 of 30

BYZANTINE GENERALS PROBLEM

The Byzantine Generals Problem is a game theory problem, which describes the difficulty decentralized parties have in arriving at consensus without relying on a trusted central party. In a network where no member can verify the identity of other members, how can members collectively agree on a certain truth?

The game theory analogy behind the Byzantine Generals Problem is that several generals are besieging Byzantium. They have surrounded the city, but they must collectively decide when to attack. If all generals attack at the same time, they will win, but if they attack at different times, they will lose. The generals have no secure communication channels with one another because any messages they send or receive may have been intercepted or deceptively sent by Byzantium’s defenders. How can the generals organize to attack at the same time?

Page 5

https://river.com/learn/what-is-the-byzantine-generals-problem

6 of 30

BITCOIN WHITE PAPER

On 31 October 2008, a paper authored by Satoshi Nakamoto was posted to a cryptography mailing list titled: Bitcoin: A Peer-to-Peer Electronic Cash SystemSatoshi cited both Hashcash and B-Money in the paper.

In short, the Whitepaper proposed a digital cash solution with:

  • Peer-to-peer payments with no financial institutions involved.
  • A way to solve to double-spending in a P2P network
  • A chain of transactions or “blocks” secured with Proof of Work.
  • Introduces incentives to secure the network; also solves how bitcoin are created

Page 6

Slide Credit: “Michael Lewellen, Blockchain Education Course, Tarski Technologies, LLC”

APPLY(S,TX) -> S’ or Error

Use Cases:

  • Transfer of value/ payments
  • Store of value

7 of 30

WHAT IS IT?

Page 7

Bitcoin is distributed, secure, immutable ledgers where participants are inherently not trusted

Sender

Recipient

Amount

 

John

1 BTC

John

Christian

0.1 BTC

John

Dani

0.25 BTC

Account

Balance

John

0.65 BTC

Christian

0.1 BTC

Dani

0.25 BTC

8 of 30

BLOCKCHAIN PROPERTIES

Page 8

  • Immutability ensures that transactions are never deleted, modified or otherwise tampered with once added to a block
  • Hash functions can easily detect the smallest changes to protect data integrity
  • Provides censorship-resistance and transparency

Immutable

Transactions can’t be tampered with

  • Verifiability ensures that transactions must always follow the established rules, or they will be rejected
  • Digital signatures automate the process of verifying that the correct party sent a transaction
  • Provides guarantees of ownership and other enforceable rules

Verifiable

Transaction rules are guaranteed

  • Anyone in the network can store and update the ledger to ensure it is always available and auditable

  • Decentralization doesn’t just come from running nodes but also network governance and open-source software

  • Provides reliability, accessibility and incentivizes collaboration

Decentralized

No single point of failure

Slide Credit: “Michael Lewellen, Blockchain Education Course, Tarski Technologies, LLC”

9 of 30

MINING

Page 9

BLOCK1

HASH XYZ�TX1�TX2

BLOCK1

HASH ABC

PHASH XYZ�TX3�TX4

BLOCK1

HASH DDD

PHASH ABC�TX5�TX6

Network Nodes and Miners

Cryptographic Puzzle Solution

Sha256 (      )Starts with X 0s

PHash

Nonce

Sha256 (      )= 00000837361d1b1…. db61

ABC

“182”

Miner receives 6.25 BTC (approx. 125K USD) as a reward

How does this prevent double spending?

10 of 30

MEMPOOL

  • Temporary queue of transactions; Miners fetch transactions from mempool that create the most profit
  • http://ethviewer.live/

Page 10

11 of 30

BITCOIN HASHING POWER

Page 11

12 of 30

BITCOIN Creation and early usage

Nakamoto released the Bitcoin software as open-source code in January 2009

On January 3rd, 2009, the bitcoin network was created when Nakamoto mined the first block of the chain, known as the genesis block.

  • Embedded in the coinbase of this block was the text "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks".

Early Bitcoin users included Hal Finney, Wei Dai, and Nick Szabo.

On May 21st, 2010, the first commercial transaction with Bitcoin occurred when Laszlo Hanyecz bought two Papa John's pizzas for ₿10,000.

  • In case you’re wondering, that’s worth $93 million as of July 5th, 2020

Nakamoto disappeared in 2010, handing control over to Gavin Anderson . Gavin would later serve as Lead Developer of the Bitcoin Foundation and decentralize control over future development.

Page 12

Slide Credit: “Michael Lewellen, Blockchain Education Course, Tarski Technologies, LLC”

13 of 30

Bitcoin History

After 2010, Bitcoin began to see markets established as adoption grew

Mar 2010 – The first bitcoin exchange starts trading at $.003

Feb 2011– The Silk Road black market starts using bitcoins as payment, Bitcoin reaches $1

Mar 2013 – First regulatory guidance issued by FinCEN for "virtual currencies" �

Oct 2013 – FBI shuts down the Silk Road, Bitcoin starts to enter the mainstream media

Nov 2013 – Following a massive bull run, Bitcoin’s price peaks at $1,242

Feb 2014 – Mt. Gox, the largest Bitcoin exchange, collapses and causes a price drop

July 2014 – Despite price volatility, acceptance grows as Wikipedia allows Bitcoin donations.

Silk Road Website

Mt. Gox Bitcoin Exchange

Slide Credit: “Michael Lewellen, Blockchain Education Course, Tarski Technologies, LLC”

14 of 30

NEW INDUSTRY IS BORN

  • After Mt. Gox, many bitcoin exchanges tightened security and pursued better regulatory compliance
  • Total exchange volumes for the month of Jan 2020 was reported at $600 billion
  • Despite massive growth and better practices, AML is still a growing concern

Page 14

Exchanges and Wallets

Mining Operations

Altcoins and DApps

A new class of financial services

PoW turns into a race for hardware

New cryptocurrencies enter the scene

  • Mining difficulty quickly grew as more miners joined the network
  • ASICs eventually replaced standard hardware with early manufacturers such as Bitmain
  • Mining is now highly competitive as operators compete for the best hardware and lowest power costs
  • Bitcoin’s code was soon used to create new “altcoins” including Litecoin while Bitcoin itself was forked into several competing versions such as Bitcoin Cash�
  • Ehereum and later blockchain platforms were created to support decentralized applications (DApps)

  • Today, thousands of cryptocurrencies now exist, all based on Bitcoin

Slide Credit: “Michael Lewellen, Blockchain Education Course, Tarski Technologies, LLC”

15 of 30

NEW INDUSTRY IS BORN

  • All data is public!
  • Investment tools to analyze on-chain activity. (e.g. glassnode, lookintobitcoin)
  • Threat intelligence and AML companies (e.g. chainanlysis)

Page 15

Analytics Firms

On-chain analysis

16 of 30

LIGHTNING NETWORK

  • Bitcoin Transactions are slow and expensive
  • Not suitable for micropayments
  • Lightening network
    • Instant payments (no block confirmations)
    • Scalable
    • Low Cost

Page 16

https://zipmex.com/learn/what-is-lightning-network/

17 of 30

BITCOIN TODAY

  • Market Cap – 700B USD
  • Users – 20M unique users
  • Hashrate – 220M TH/s
  • Legal Tender in El Salvador
  • Institutional adoption
  • Criticism
    • Energy Consumption
    • Price volatility
    • Used by Criminals
    • Centralization
    • Few Use Cases

Page 17

https://www.bitpanda.com/academy/en/lessons/what-is-the-purpose-of-mining-pools-and-how-do-they-work/

18 of 30

BITCOIN HALVING CYCLES

  • As of June 2022, 19.07 Million BTC have been mined out of a total of 21 Million BTC

Page 18

19 of 30

BITCOIN STOCK TO FLOW MODEL

  • Invented by crypto analyst PlanB in March 19, 2021
  • Predicts the future price of Bitcoin based on its circulating supply relative to the amount of coins mined each year

Page 19

  • Currently BTC is below the stock-to-flow model. Price operates in a macro environment

20 of 30

BITCOIN MAXIMALISTS

Bitcoin maximalists believe that Bitcoin, which is the world's most popular cryptocurrency, is the only digital asset that will be needed in the future. Maximalists believe that all other digital currencies are inferior to Bitcoin.

In Defense of Bitcoin Maximalism by Vitalik Buterin

  • “We live in a dangerous world”
  • We need a “robust and defensible security stack” and “robust and defensible culture”
  • ”Currency is not "just the first app". It's by far the most successful one.”
  • In general, the earliest projects in an industry are the most "genuine"
  • “Intolerance is good”
  • “Be brave. Fight for your values. Be a maximalist.”

Page 20

21 of 30

Security and Exchange Commission

The Howey Test refers to the U.S. Supreme Court case for determining whether a transaction qualifies as an "investment contract," and therefore would be considered a security and subject to disclosure and registration requirements under the Securities Act of 1933 and the Securities Exchange Act of 1934.

Four Criteria:

  • An investment of money
  • In a common enterprise
  • With the expectation of profit
  • To be derived from the efforts of others

Page 21

22 of 30

ETHEREUM

  • Vitalik Buterin & Co
  • World of Warcraft
    • WoW patch 3.1.0 made him ‘realize what horrors centralized services can bring’
  • Expanded beyond payment/ crypto currency
  • Introduced the Ethereum Virtual Machine and a world computer

Page 22

23 of 30

SMART CONTRACTS

Page 23

Ethereum is a blockchain that incorporated the concept of smart contracts that are executed on the Ethereum Virtual Machine. It’s a deterministic piece of code that is executed by the miner during block creation. Smart contracts can hold and operate on digital assets and even create new digital assets.

  • Smart Contracts are pieces of code that get executed deterministically by each node on the network to modify the Ethereum Blockchain state
  • Smart Contracts can hold digital assets
  • Smart Contracts have no inherent randomness
  • Smart Contracts operate within the state of the Ethereum blockchain (i.e. it is not operate on state on the Internet natively)

What could you do with such a system?

24 of 30

DEVELOPING DAPPS

  • DAPP – Decentralized App usually consists of:
    • An on-chain component, aka smart contracts
    • An off-chain component, such as a web site that allows users to interact with your smart contracts
  • Ethereum Smart contracts can be developed in multiple languages, such as Solidity and Viper
    • Compiler translates the smart contract into Ethereum Virtual Machine (EVM) byte code
    • Read operations are free
    • Write operation cost transaction fees (aka gas)
  • Transaction Fees
    • Each Opcode is associated with a fixed cost measured in gas; some opcodes are more expensive than others (e.g. perm storage modifications cost more than simple calculations)
    • Many operations will increase overall transaction cost
    • Gas cost in GWEI (a unit of ETH) is determined based on network congestion

Page 24

25 of 30

NOTABLE TOKEN STANDARDS

  • ERC – Ethereum Request For Comments is a set of improvements/ standards to aid with interoperability of blockchain applications
  • ERC-20 Fungible Token Standard
    • Create a new non-native fungible token with some use case/ utility
    • Fungible means its divisible and non-distinguishable, like the US Dollar
  • ERC-721 Non-Funglible Token Standard (NFT)
    • Create a new fungible token with some use case/ utility
    • Non-fungible means, each token is unique, like a unique piece of art

Page 25

26 of 30

USE CASES & DEMO

Page 26

Remittances

Stablecoins/ CBDCs

Exchanges

Derivatives

Decentralized Finance

Passive Income

Options

Store of Value

Payment

NFTs

Metaverse

Games

Art/ Collectibles

Loyalty Rewards

Access

Identity

Tokenization of Real World Assets

Governance

Supply Chain

Public Goods Funding

Social Media

File Storage

Compute

?

27 of 30

Blockchain TRILEMMA

Page 27

Scalability

Security

Blockchain TRILEMMA

Decentralization

How many transactions can be processed?

How many nodes?

How decentralized is it?

How resistant is �it to attacks?

Why would you give up security for scalability?

28 of 30

BLOCKCHAIN HISTORY TIMELINE

Page 28

2010

First Bitcoin Mined

2022

Bear Market due to regulatory pressures and macro economic climate

2013 �Bitcoin Surpasses 1B Market Cap

2013 �Vitalik Releases Ethereum Whitepaper

2015�Ethereum Genesis Block

2016�The DAO exploited for $72M USD

Ethereum hard forks splitting into Ethereum and Ethereum Classic

2018�BTC Lightning Network Beta Launched

2017�Bull Market that put BTC on the map,

BTC ATH of 20K

2018�Bear Market�BTC plummets to 3K

2020�DeFi Summer

2021�NFT Boom

�Bull Market (BTC $69K)�

Total Crypto Market Cap almost $3T

2022

LUNA Blockchain Implodes through Market Manipulation

2022�Layer 2 Rollup Chains Launch on Ethereum

29 of 30

DEFI TVL

Page 29

DEFILama.com

30 of 30

CONCLUSION

  • We are at the beginning!
  • There is tremendous amount of innovation and experimentation.
  • Think what you could do with blockchain once its fast and ties in real world assets
  • Did you think about Uber as a use case when Netscape introduced the first browser?

Page 30