【比特币】Ethereum: Smart Contract

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

时间: 2024-08-27 00:09:41

【比特币】Ethereum: Smart Contract的相关文章

Using APIs in Your Ethereum Smart Contract with Oraclize

Homepage Coinmonks HOMEFILTER ▼BLOCKCHAIN TUTORIALSCRYPTO ECONOMYTOP READSCONTRIBUTEFORUM & JOBS Go to the profile of Matt Solomon Matt Solomon Apr 20 Getting data from an outside source onto the blockchain is a non-trivial problem, and one solution

Smart Contract - Hello World

[编写Smart Contract] 1.包含头文件. #include <eosiolib/eosio.hpp> #include <eosiolib/print.hpp> 2.使用命名空间 using namespace eosio; 3.实现一个空的合约 class hello : public contract { public: using contract::contract; }; 4.合约中添加一个action class hello : public contra

【翻译】A Next-Generation Smart Contract and Decentralized Application Platform

原文链接:https://github.com/ethereum/wiki/wiki/White-Paper 当中本聪在2009年1月启动比特币区块链时,他同时向世界引入了两种未经测试的革命性的新概念.第一种就是比特币(bitcoin),一种去中心化的点对点的网上货币,在没有任何资产担保.内在价值或者中心发行者的情况下维持着价值.到目前为止,比特币已经吸引了大量的公众注意力, 就政治方面而言它是一种没有中央银行的货币并且有着剧烈的价格波动.然而,中本聪的伟大试验还有与比特币同等重要的一部分:基于

超级账本HyperLedger旗下项目介绍

说明 超级账本HyperLedger视频教程汇总:HyperLedger Fabric的视频讲解--"主页"中可领优惠券 超级账本HyperLedger旗下有很多的项目,对这些项目进行了简单的了解. As an open consortium, Hyperledger incubates a range of business blockchain technologies, including distributed ledger frameworks, smart contract

区块链(二)--Bitcoin、Ethereum、Hyperledger Fabric

在区块链(一)这个博文里面呢,我是简单的介绍了一下区块链和数字货币(Bitcoin),接下来我们这片文章呢讲一下这个Ethereum(以下简称以太坊). ================================================================== 本人建议大家可以先看一下以太坊白皮书,这个非常有用,看完了白皮书可以看一下黄皮书(黄皮书就是很细节性的文档了,包括数据结构算法之类的 ,看之前做好心理准备).看完这两个估计你也就不想看我在这胡扯了... ...

(转)写文章 以太坊(Ethereum)创世揭秘 以太坊(Ethereum)创世揭秘

什么是以太坊(Ethereum) 以太坊(Ethereum)是一个基于区块链技术,允许任何人构建和使用去中心化应用的区块链平台.像比特币一样,以太坊是开源的,并由来自全世界的支持者们共同维护.与比特币仅提供了有限功能的脚本不同,以太坊提供了一个"图灵完备"的虚拟机,称为以太坊虚拟机(Ethereum Virtual Machine),简称EVM,用户可以在EVM上创建智能合约(Smart Contract).以太坊平台中的通用货币为以太币(Ether),简称ETH,以太币可用于账号间的

基于Ethereum Wallet的Solidity HelloWorld

基于Ethereum Wallet的Solidity HelloWorld智能合约(Smart Contract) 相信大家都有学习各种开发语言的经历,一般学习任何一门语言都会先从最简单的HelloWorld开始,所以本篇文章,我们将编写一个最基本的合约代码,并且一步步讲解如何通过Ethereum Wallet将合约部署到区块链,同时我们将通过本demo的演示如何通过发送数据和接收数据和合约进行交互. Solidity合约的语法和面向对象编程语言非常相似,一个合约有我们能够调用的方法(函数)和能

比特币深层技术原理浅析

摘要: 这是一篇主要针对技术小白的文章.本文尽量使用通俗易懂但又不失要义的文字,带你深入剖析当前备受追捧的比特币背后的深层技术原理,最后会简要介绍一下业界市场的现状. 这是一篇主要针对技术小白的文章.本文尽量使用通俗易懂但又不失要义的文字,带你深入剖析当前备受追捧的比特币背后的深层技术原理,最后会简要介绍一下业界市场的现状. 目前加密货币这个圈子可简要分为币圈和链圈,币圈专注于投资炒币,而链圈专注于区块链(blockchain)技术的创新发展.虽然币圈是高回报的利益驱动,但也正是他们的天使资金推

ethereum/EIPs-725

https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md eip title author discussions-to status type category created 725 Proxy Identity Fabian Vogelsteller (@frozeman) https://github.com/ethereum/EIPs/issues/725 Draft Standards Track ERC 2017-10