Blockchain Overview

What is Blockchain?

Let’s forget currency for now:

  • Ledger style DB
  • Distributed
  • Open network
  • Token
  • Smart contracts

Ledger Style DB

DB by history accumulation

B1 → B2 → B3 → B4 → ..

  • S0 = ∅
  • S1 = B1(S0)
  • Sn = Bn(Sn-1) = Bn(Bn-1(..(B1(S0))))

Examples

  • Bankbook
  • Version control system: Git

Distributed DB

Multiple DB nodes, each carries a replica of the DB:

  • Fault tolerance
  • Load balancing

Distributed DB: conflicts

How to resolve conflicts?

Consensus Algorithm

Algorithm to resolve conflicts between nodes.

Bad news: There is no such algorithm [FLP85].

Every protocol has the possibility of non termination,
even with only one faulty node.

Good news: Paxos

It may not terminate, but practically it is OK.

  • Voting between nodes
  • Only for closed network with fixed nodes.

Closed Network

If you are happy with it, you do not need “Blockchain”.

Open Network

Permissionless public network,
where anyone can join with a node.

  • Decentralized, therefore neutral
  • Almost impossible to hack
  • Low cost

Problem of Open Network Consensus

Consensus control and inhibition by Sybil attack: produces fake identities to dominate the network.

   👊😈👊

😎😎😎😎😎😎😎😎😎 😧😬😩
😎😎😎😎😎😎😎😎😎 😓😳😑
😎😎😎😎😎😎😎😎😎 😕😫😨

Satoshi Nakamoto and Bitcoin

Prevent Sybil attacks i.e. infinite identity creations:

  • Requirement of real world resource: computation power (PoW)
  • Rewards: incentive to provide the resource and behave honestly.
  • The rewards are recorded in the DB.

Birth of cryptocurrency

Cryptocurrencies

A solution to Sybil attacks against open networks.

Smart Contracts

Ledger DB can carry not only account balance,
but any data, even program code.

Code attached to an account is executed when it receives a transaction.

  • Automatic execution of financial/non-financial contracts
  • Distributed application (dAPPs) framework, neutral and cost efficient without requirement of central DB managers.

Gas cost

Smart contracts cannot run infinitely.

To prevent DoS attacks, the caller
must pay the running cost to the miner:

Gas limit, out of gas
Contract calls fail if its runtime cost exceeds the declared gas cost or the system gas limit.
VM model
To calculate the gas cost, smart contract language is often implemented as a VM.

What is Blockchain

  • Ledger DB
  • Distributed
  • Open network
  • Token for incentives
  • Smart contracts