Blockchain 101 · 2018. 4. 1. · Bitcoin • Introduced in 2008 by Satoshi Nakamoto • Bitcoin: A...

Post on 07-Sep-2020

1 views 0 download

Transcript of Blockchain 101 · 2018. 4. 1. · Bitcoin • Introduced in 2008 by Satoshi Nakamoto • Bitcoin: A...

Blockchain 101

Contents• Introduction

• Blockchain Overview

• Hash and Cryptography

• Blockchain Consensus Algorithm

• Challenges

• Next Generation Blockchains

Introduction• Transaction

• An instance of buying or selling something

• Based on mediation from a trusted arbiter

• Fiat money

• Bank or credit

• What happens if the trusted arbiter fails?

Bitcoin• Introduced in 2008 by Satoshi Nakamoto

• Bitcoin: A Peer-to-Peer Electronic Cash System

• No financial institution

• Open source

• Blockchain is a technology implementing Bitcoin protocol

Blockchain AbstractCase study: Bob buys a house from Alice

Transaction• Alice sends 1 house to Bob

• Contract is verified with signature

• Validation

• Conventional system

• Notary, lawyers, government, etc.

• Blockchain

• Every participant in the network

• Gets the copy of contract

Decentralised Ledger• Validation of transaction

• Fault-tolerant

• Exists backup copy of the ledger

• Security

• Difficult manipulate the transaction record

• Information sharing

• Distribution of power

Packaging Transactions• Block

• Packaging transactions in fixed interval

• E.g. 10 minutes for Bitcoin

• Blockchain

• Pile of blocks in chronological order

• Solves the problem of double spending

Preliminary

Hashing• A function generating a fixed size output

• Examples

• Modulo 7

• MOD7(10) = 10%7=3

• SHA-256(Secure Hash Algorithm)

• SHA-256(10) = 4A44DC15364204A80FE80E9039455CC1608281820FE2B24F1E5233ADE6AF1DD5

• Collision: MOD7(17)

• One-way

Public Key Cryptography• Provides secure communication channel

• Pair of keys

• Public key

• Encrypts the content

• Shared with the public

• Private key or secret key

• Decrypts the content

• Secret

• Digital signature

Public Key Cryptography• Signing

• Who is sending the data?

• Confidentiality

• Nobody knows what is in the transit

• Tamper-proofing

• No one can manipulate the data in transit

Public Key Cryptography• Sender(S) wants send data(D) to

receiver(R)

• Sender generates digital signature

• SHA-256(D) = D_HASH

• Enc(S.sk, D_HASH) = S.DS

• Sender encrypts data and signature with receiver’s public key

• Enc(R.pk, D + S.DS) = D_ENC(confidentiality)

• Sender sends D_ENC to receiver

• Receiver receives D_ENC

• Receiver decrypts received data with private key

• Dec(R.sk, D_ENC) = D + S.DS

• Receiver checks sender’s signature

• Dec(S.pk, S.DS) = D_HASH

• Receiver generates SHA-256 of received data and compare it with received hash

• SHA-256(D) == D_HASH(signing, tamper-proofing)

Blockchain Consensus Algorithm

Proof-of-Work

Transaction• Verification with digital signature

• A complete history of transaction or Ledger

• Cryptocurrency

Decentralised Ledger• Transactions are announced in the network

• Transactions are packaged into a block

• New block is chained with the previous block

• Question

• Who is making a new block?

• Where is the most recent valid ledger?

Mining• Act of gathering transaction and producing a

block

• Anyone can generate a block as long as it meets the requirement

• Number of leading zero bits in the block header

• Reward 12.5BTC = 119,150,000KRW

Proof-of-Work• The most recent valid ledger is the one with the

longest chain

• Longest chain means majority of resources(work)

Block

Merkle Tree

Nonce and Difficulty

Next Generation Blockchains

Average Number of Transactions Per Block

Mining Factory

Mining Pool

Challenges• Small block size and long interval

• Bitcoin blockchain handles 2 transactions where VISA system at peak Handels 4,700 transactions per sec

• Increase block size >1MB

• Decrease block production interval <10minutes

• Proof-of-Work

• Waste of resources

• Exchanges

Next Generation• Smart contract

• DAO (Decentralized Autonomous Organization)

• Sharding

• Divide packaging workload

• Lightning network or Raiden

• Delayed packaging

• Delegated proof-of-stake

• Limiting number of block producers

End