Introduction to Crypto and Cryptocurrencies week two 笔记和个人理解

来源:互联网 发布:java程序员工作业绩 编辑:程序博客网 时间:2024/06/05 02:00

Lecture 2.1

作者: bao_zijian@163.com
Centralization vs decentralization
such as e-mail:
     decentralized protocol,but dominated bu centralized webmail services

aspects of decentralization in Bitcoin:
1.who maintains ledger?
2.who has authority over which transactiona are valid?
3.who creaters new bitcoins?
4.who determines how the rules of the system change?(wait next lecture)
5.how do bitcoins acquires exchange values?(金融来解决)

Beyond the protocol: exchangers,wallet software,service providers

aspects of decentralization in Bitcoin:
          1.p2p network
               open to anyone,low barrier to entry
          2.mining
               open to anyone, but inevitable concentration of power
               often seen as undesirable
          3.updates to softwate:
               core developers trusted by community,have great power.





Lecture 2.2

作者: bao_zijian@163.com
Distributed consensus
Why consensus protocols?
Traditional motivation:reliability in distributed systems
Distributed key-value store enables various applications:
DNS,public key directory,stock trades

Distributed consensus protocol. ​
There aren​nodes that each have an input value. Some of these
nodes ​ are faulty or malicious. A distributed consensus protocol has the following two properties:
● It must terminate with all honest nodes in agreement on the value
● The value must have been generated by an honest node

How consensus could work in Bitcoin
     At any given time :
  • All nodes have  a sequence of blocks of transactions they have reached consensus on 
  • Each node has a set of  outstanding transactions(没有写到区块中的) it is heard about

Why consensus is hard 
     nodes may crash
     nodes may be malicious
Network is imprefect
  •      not all pairs of nodes connected 
  •      faults in network
  •      latency

Many impossibility results
     Byzantine generals problem
     Fischer-Lynch_paterson(deterministic nodes):
          consensus impossible with a single faulty node





Lecture2.3

作者: bao_zijian@163.com
Consense without identitiy:the block chain
why identity?
        Pragmatic:some protocols need node IDs 一些分布式协议需要ID最小的identitiy去做事
        Security:assume less than 50% malicious
因为这些比特币的一致性有些困难,但为什么没有identity?
1.点对点的去中化系统没人可以赋值给ID——会有sybil attack
2.使用假名是比特币的一个goal

Most common heuristic: 6 confirmations
double-spend probability decreases exponentially with# of confirmations



Lecture 2.4

作者: bao_zijian@163.com
Incentives and proof of work
bitcoin 去中心化 一部分是技术机制 一部分是工程激励机制
Assumption of honesty for behaving honestly?
can we give nodes incentives for behaving honestly?

Incentive 1:  block reward
Creator of block gets to 
  •      include special coin-creation transaction in the block(把一个创币记录放入block中)
  •      choose recipient adddress of this transaction
Value is fixed :currently 25 BTC,halves every 4 years
Block creator gets to "collect" the reward only if the block ends up on long-term consensus branch.

Incentive 2:  transaction fees(小费)
Creator of transaction can choose to make output value less than input value.
Remainder is a transaction fee and goes to block creator.

Remianing problems
  1. How to pick a random node?
  2. How to avoid a free-for-all due to rewards?(有激励的情况下怎么解决混战问题?)
  3. How to prevent Sybil attack?(女巫攻击,创建很多数量的合法节点,试图破坏共识过程)
解决这3个问题?
     proof of work 工作量证明
     To approximate selecting a random node:
          select nodes in proportion to a resource that no one can monopolize(we hope)
     In proportion to computing power : proof-of-work
     In proportion to ownership : proof-of-stake

Hash puzzles
     To create block, find nonce s.t.
H(nonce || prev_hash || tx || ... || tx ) is very small

if hash function is secure:
      only way to succeed is to try enough nonces until you get lucky.

POW property 1: difficult to compute
about 10的20次方 hashes/block
Only some nodes bother to compete ——miners.
POW property 2: parameterizable cost(成本能够参数化)
Nodes automatically re-calculate the target every two weeks.
Goal: avarage  time between blocks = 10minutes
     prob(Alice wins next block) = fraction of global hash power she controls

Key security assumption
Attacks infeasible if majority of miners weigted by hash power follow the protocol.
POW property 3: trivial to verify(简单)
 很容已验证他是正确的。




Lecture 2.5

作者: bao_zijian@163.com
Putting it all together
mining economics 
if mining reward (block reward + tx fees)(bitcoin) > hardware electricity cost(dollars)——》profit
complications:
     fixed vs variable costs
     reward depends on globle hash rate

Recap
identities            Block chain&consensus          Transactions
P2P network       Hash puzzles&mining

Bitcoin has three types of consensus
  •      value
  •      state
  •      rules (硬软分叉)

What can a 51% attacker do? 不行
Steal coins from existing address?
Suppress some transactions?
     From the block chain      yes
     From the P2P network     no
Change the block reward?         no(比特币的奖励是写在挖矿人的软件上的)
Destory confidence in bitcoin?     yes 失去信心

Remaining questions
     how do we get from consensus to currency?
     what else can we do with consensus?











0 0
原创粉丝点击