首页 > 其他 > 详细

【比特币】Ethereum: Smart Contract

时间:2016-08-18 16:01:40      阅读:362      评论:0      收藏:0      [点我收藏+]

Introduction

History

There is a payment called P2SH( pay to script hash) in bitcoin. With this feature, you can compile many interesting scripts( the original form of contract) like this wiki and this.

Here more sample for P2SH:

  • Hash Locked Tx on ZKCP
OP_SHA256
<Y> OP_EQUAL
OP_IF
  <Seller Pubkey>
OP_ELSE
  <block_height+100> OP_CHECKLOCKTIMEVERIFY OP_DROP
  <Buyer Pubkey>
OP_ENDIF
OP_CHECKSIG

But for more complex logical control on contract, such as colored bitcoin, and stake IPO, Bitcoin has no these abilities.

More Inventions

  • Powerful script: a Turing-Complete VM and interperter

  • State stroage: MPT as a database

  • Protection of network from abusing of the powerful script: Gas

Experiment on Ethereum private network

  • Construct a Private network

what happens on block-chain

  • Install a script interpreter: Solidity for example

  • Fund a EOA with ether

  • Create Contract from this EOA

    • write a script
    • compile
    • deploy
    • get address of this contract

what happens on block-chain

  • Call the contract

what happens on block-chain

【比特币】Ethereum: Smart Contract

原文:http://blog.csdn.net/hacode/article/details/52241745

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!