CS/블록체인응용

Lec 1: Introduction to Blockchain

호프 2023. 10. 19. 15:31

Simple Introduction to Blockchain

History

  • Satoshi Nakamoto released the white paper in 2008: "purely peer-to-peer version of electronic cash"
  • Bitcoin was offered up to the open source community in 2009
  • Around 2014, blockchain technology becomes more than cryptocurrency
  • In 2015, Ethereum launched: can be used to build smart contract

Cryptocurrency is just application using blockchain. Blockchain has more potential

 

Definition

Blockchain is a network of a decentralized database that is spread across multiple entities that are kept in sync, where there is no single owner or controller of data.

  • permits transactions
  • cryptographically chains blocks (content in database) in chronical order
  • allows the resulting ledger (history of changes) to be accessed by different servers

 

Centralized System

Trusted Arbiter (Centralized Authority)

  • which is controlling everything in the middle -> all users believe that a single trusted arbiter
  • ex. Banking system: bank == trusted arbiter

Client-server network (ex. Web)

  • Data is stored on servers, clients can access the data
  • clients trust the data is definitive
  • very efficient, and a traditional model in computing

Problems of Centralized system

  • Single point of failure
    • A failure in a centralized authority is a failure in the entire system
  • Concentration of power
    • A centralized authority easily can manipulate the current state.

 

Decentralized System

Decentralisation

  • authoritative location or group are distributed or delegated away from the central

Decentralized computing

  • allocation of resources, both HW or SW, to each individual workstation

Peer-to-peer network

  • Each peer has 100% of the data (or as close to it as possible)
  • Updates are shared around.
  • Data are replicated many times -> a lot of noisy gossip
  • ex. File sharing applications - BitTorrent network

Pros and Cons of Decentralized System

  • Cons
    • less efficient than client-server network due to the data replication and a noisy gassip
  • Pros
    • each peer in network is more independent, it can continue operating even if it loses connectivity to the rest of the network
    • more robust -> closing down peer-to-peer networks is harder

 

Problems of agreement

In P2P models, ther can be a problem of agreement or consensus

-> How do you determine the 'real' or 'true' state of the data with no trusted arbiter?

-> so, it was consisdered not to be suitable for a system requiring a high-level of trust such as money transfer

 

Example: Alice and Bob playing chess online in P2P network

  • They should agree the current state of the system to play a game
  • If they agree on history, they agree on the present state
  • Blockchain contains a history of individual transactions: Initial state + history = Current state
  • Blockchain is the technology letting Bob and Alice agree on the state of the system, even if they don't believe each other
    • In Blockchain, all users get a functionality of a trusted arbiter without having a real one.
Blockchain is a decentralized system and entities in blockchain don't believe each other, however, they want to agree the history of changes. --> HOW?

Technical Background

Chaining blocks

A block is a sequence of hash-chained records.

  • Once a new record is ahshed and chained, the past records cannot be modified.

Cryptographic Hash-function

  • Message Digest: It can take any size of inputs (arbitrary length) and outputs a fixed length value.
  • Preimage Resistant: Given v such that Hash(d) = v, finding value of d is infeasible (=almost impossible)
  • Collision Resistant: It is infeasible to find the two distinct d and d' such that Hash(d) = Hash(d')

Hashchain

  • Hashchain is a sequence of the records in which each record contains the hash of the previous record for the chain, and the hash of all current record's contents.
  • It provides the integrity of the all sequence of the past transitions.
  • If you change one block's payload, it changes not only the value of the forthcoming block but also changes whole blocks, which will appear after.

Every block has the information of all previously committed blocks. -> Accepting the most recent block means locking all previous commitments.
Because the payload can be a arbitrary length, it can be used for wide range of applications such as Smart contract or DApp.

 

Hash cash (PoW)

Building a Block

  • How can blockchain accept the next block without having a trusted entity?
  • Proof-of-work is needed to limit the rate of new blocks and make attempts to add invalid blocks to the chain expensive
  • Concept of PoW was introduced from HashCash

Hashcash

  • It is originally suggested a PoW system for spam filtering, but it is used in Bitcoin as a part of the mining algorithm.
  • How to generate nonce in the hashchain system
  • How to impose proper computing efforts to send a mail => Proof of Work
    • Mail server gives a sender a challenge C and limit L, then it asks to find the counter value
      Hash(C || counter) < L (If L is bigger, the easier)
    • There is no short cut to compute it. It should find the counter by increasing it one-by-one
    • However, the recipient can easily verify it by computing Hash(C || counter) and it stores the hash value to avoid that the sender reuses the hash value.
    • But PoW is not environment friendly