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

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

Lecture 3.1

作者: bao_zijian@163.com
Bitcoin Transactions
  • Append-only ledger
  • Decentralized consensus
  • Miners to validate transactions

Lecture 3.2

作者: bao_zijian@163.com
Bitcoin scripts
Output "addresses" are really scripts
把output中的地址转换为合约
the secret is that the input address is also a script
实际上   input scripts  called scriptsig
            output scripts called scriptPublickey
forth language.    is a stack-based language    no loops
一种类似forth的语言   :简单,但是support for pretty sophistcated cryptography
there are special purpose instructions to do compute hash functions and to compute signatures and verigy signatures

Bitcoin script instructions 
256 opcodes total (15disabled,75 reserved)
         可以做的运算: Arithmetic    if/then      logic/date handling     Crypto


Lecture 3.3

作者: bao_zijian@163.com
Applications of Bitcoin scripts

Example 1:Escrow transactions(第三方交易)
a third party and do ascrow transactions
MULTIGIS  多重签名技术

Example 2:Green addresses
有个bank的存在
现实中有两家公司:Instawaller and mount Gox 

Example 3:Efficient micro-payments
problem : Alice wants to pay Bob for each minue of phone service . She doesn't want to incur a transaction fee every minute.
solution: low value transaction every minute

multi-palyer lotteries

Lecture 3.4

作者: bao_zijian@163.com
Bitcoin blocks
why bundle transactions together?
  • single unit of work for miners
  • limit length of hash-chaina of blocks
    • faster to verify history



Lecture 3.5

作者: bao_zijian@163.com
The bitcoin network
let us talk about how Bitcoin blocks get put together.
Bitcoin P2P network
  • ad-hoc protocol(runs on TCP port 8333)
  • Ad-hoc network with random topology
  • all nodes are equal
  • new nodes can join at any time
  • Forget non-responding nodes after 3 hr
should I relay a proposed transaction?
  •      Transaction valid with current block chain
  •      script matches a whitelist 
    •      avoid unusual scripts
  •      Haven't seen beford
    •      avoid infinite loops
  •      doesn;t conflict with others I've relayed
    •      avoid double-spengs
Race conditions
  • Default behavior:accept what you hear first
  • Network position matters
  • miners may implement other logic!

How big is the network?
  •      impossible to measure exactly
  •      estimates-up to 1M 1P addresser/month
  •      Only about 5-10k "full nodes"
    • Permannently connected
    • Fully-validate
  •      this number may be dropping!

Lecture 3.6

作者: bao_zijian@163.com
Limitations & improvements
10min.average creation time per block
1M bytes in a block

Througput limits in Bitcoin
7 transactions/sec
compare to :
     VISA,PayPal

Cryptographic limits in Bitcoin
     only 1 signature algorithm(ECDSA/P256)
     Hard-coded hash functions

Hard-forking changes to Bitcoin

Next week, we will talk about  Human beings aren't work for people, not nodes
  • How do people interact with the network?
  • How do people exchange bitcoins for cash?
  • How do people securely store bitcoins?
Currency needs to work for people, not nodes.










1 0
原创粉丝点击