欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

笔记 MIT6.824 Lecture 19: Bitcoin

程序员文章站 2022-03-15 17:02:08
...

前言

讲的是比特币,一个去中心化的例子,谈到了相关的技术与问题


一、Bitcoin

1.1 去中心化

peer-to-peer有很多参与者,且它们中会有malicious,需要有新的解决方法

1.2 digital currency 的challenges

  1. outright forgery - 造假
  2. double spendig
  3. theft

1.3 idea: signed sequency of transactions

  1. 有bunch of coins, 有owners
  2. 每个coin都是有完整的交易记录
  3. 每个coin最近一次的交易indicates its owners

1.4 transaction record

pub(user1) : public key of new owner
hash(prev): hash of this coin’s previous transaction record
sig(user2): signature over transaction by previous onwer’s private key

笔记 MIT6.824 Lecture 19: Bitcoin

  Y owns a coin, previously given to it by X:
    T6: pub(X), ...
    T7: pub(Y), hash(T6), sig(X)
  Y buys a hamburger from Z and pays with this coin
    Z sends public key to Y
    Y creates a new transaction and signs it
    T8: pub(Z), hash(T7), sig(Y)
  Y sends transaction record to Z
  Z verifies:
    T8's sig(Y) corresponds to T7's pub(Y)
  Z gives hamburger to Y

1.5 prevent double-spending

publish a log of all transactions
ensure everyone sees the same log (in same order!)
ensure Y can’t un-publish a transaction

result:
  Z will see Y->Z came before Y->Q, and will accept Y->Z
  Q will see Y->Z came before Y->Q, and will reject Y->Q
  a "public ledger"

二、the BitCoin block chain

the goal: agreement on transaction log to prevent double-spending
the block chain contains transactions on all coins
有很多peers
– 有完整的chain
– TCP 链接
– 新的block以及transactions会by TPC通知给各个peers

new block every 10 minutes containing xactions since prev block payee doesn’t accept transaction until it’s in the block chain

为什么要create each new block

2.1 how is a fork resolved?

会有Fork的可能性,但是会有一个会在后面接更多的blocks,然后多的那个就会变成主要的,之后的mining都会在这个上进行,这个叫做winning fork。

在没有决定谁是winning fork的时候,transaction是不可靠的,所以需要等待后面有多个Bolcks才能确保交易被成功记录在winning fork上


三、weak points

– too bad it’s a new currency as well as a payment system
– transaction confirmation takes at least 10 minutes, or 60 for high confidence
– flooding limits performance, may be a point of attack
– maximum block size plus 10 minutes limits max transactions per second
– users have trouble securing private keys


总结

通过ledger账本去中心化是一个greate idea,但是block以及transactions速度的限制不利于频繁大规模地交易,也就有很多不适用的场景

相关标签: 课堂笔记 6.824