Blockchain


Bitcoin

  • a cryptocurrency;
  • a form of electronic cash;
  • a decentralized digital currency w/o central bank or single admin
  • can be sent from user to user on peer-to-peer bitcoin network w/o the need for intermediaries

 

Possession

Q:如何保证来源真实性?

  • digital signature: transaction || signature
  • digital signature using Alice’s private keytransaction || Encpriv(hash(transaction))  

验证:hash(transaction) == Decpub(Encpriv(hash(transaction))) ?

 

Uniqueness

Q: Is Alice paying two bitcoins? or is it a replay attack?

Serial number – 唯一标识

Any caveats:

  • Is sn1 really belonging to Alice?
  • Who issues serial numbers?
  • What if Alice pays sn1 to Charlie as well?

transaction = I, Alice, am giving Bob bitcoin sn1.

transaction = I, Alice, am giving Charlie bitcoin sn1.

Q: Is sn1 really belonging to Alice?

Ledger = blockchain

  • everyone keeps complete record of which bitcoin belongs to which person, showing all bitcoin transactions;
  • make everyone collectively the bank.
  • 每个人都拥有银行的记录。

  • follow transaction order, a block points to its previous transaction’s block

Q: Who issues serial numbers?

Hash of a block

  • maybe more transactions in a block;
  • specify the exact transaction for use;

Q: What if Alice pays sn1 to Charlie as well?

Double spending

Case 1:What if Alice first pays sn1 to Bob, and after a while, pays sn1 to Charlie?

  • sn1 appears in two [in] fields in prev blocks
  • 交易时会检测是否存在重复

Case 2:What if Alice simultaneously pays sn1 to Bob and Charlie?

  • some users validate Alice-Bob;
  • some Alice-Charlie
  • follow the longest fork
    • accept the transaction until at least 5 more blocks follow it

Case 3: What if Alice simultaneously puts sn1 related Alice-Bob and Alice-Charlie in Block B?

  • what if Alice pays sn1 to Bob, wait till accepted; then repays sn1 to Charlie, compute another longer fork?

Proof-of-work

[工作量证明]

  • make validating a block computationally costly;
  • require enormous computation power to forge;

Example: find a nonce x, such that h(msg,x) leads with 10 zeros (hex). 找到一个随机数X,这样H(MSG,X)用10个零(HEX)引导。

find a nonce x, such that h(blockheader,x) <= target.

51% attack

(a group of) attacker controls more than 50% of the network’s computing power;

  • 为了攻击需要消耗大量的算力

 

proof of stake

every participant joins blockchain by paying stake

when choosing creator of a block, more stake with high probability

creator gets stake reward if created block passes verification

creator gets stake reward if created block passes verification; otherwise, penalty

  • only one creator per block;
  • no huge computation waste.

validate 验证

simultaneously 同时地

forge 计算

incredible 不可思议的

malicious 恶意的


0 条评论

发表评论

Avatar placeholder