5分钟区块链 | 理解智能合约

资讯 2024-06-17 阅读:97 评论:0
美化布局示例

欧易(OKX)最新版本

【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   全球官网 大陆官网

币安(Binance)最新版本

币安交易所app【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

火币HTX最新版本

火币老牌交易所【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

版权声明

Copyright Declaration

首发自微信公众号:新个体

It's a new person. It's a new person.

作者:飞帅

Author: Flying Handsome

智能合约是区块链中一个绕不开的概念,尤其是在以太坊诞生之后,以太坊的智能合约开启了区块链2.0时代。前段时间火热的ICO就是基于智能合约而诞生的,因为以太坊的智能合约诞生后,开发“代币”变就成一件很简单的事情,于是区块链世界里就出现了大量的代币。下面详细了解一下智能合约。

Smart contracts are an inexorable concept in the block chain, especially after the birth of Etherton, which opened the block 2.0 era. The ICO, which was hot for the previous period, was born on the basis of smart contracts, because the development of “demons” became a simple thing after Ether’s intellectual contract was born, and so a large number of intergenerationals emerged in the world of the block chain.

image

一、智能合约的定义

i. Definition of an intelligent contract

智能合约”(smart contract)这个术语至少可以追溯到1995年,是由多产的跨领域法律学者尼克·萨博(Nick Szabo)提出来的。他在发表在自己的网站的几篇文章中提到了智能合约的理念。他的定义如下:

The term smart contract (smart contract) dates back at least to 1995 and was proposed by the multi-productive cross-cutting legal scholar Nick Szabo. He mentioned the idea of smart contracts in several articles published on his website. His definition is as follows:

“一个智能合约是一套以数字形式定义的承诺(promises),包括合约参与方可以在上面执行这些承诺的协议。”

“A smart contract is a set of numerically defined commitments (promises), including agreements where the parties to the contract can implement them.”

通俗来说,智能合约就是计算机中的一段代码,这段代码定义了一个协议,就像现实世界中的合同。当满足一定条件时间后(比如合同到期,乙方违约等),合约自动执行,中间无需第三方参与。

Generally speaking, an intelligent contract is a code in a computer that defines a protocol, like a contract in the real world. When a certain period of time is met (e.g., contract expiration, breach of contract by party B, etc.), the contract is executed automatically without third-party involvement.

二、智能合约与区块链

智能合约看上去就是一段计算机执行程序,满足可准确自动执行即可,那么为什么用传统的技术为何很难实现,而需要区块链技术等新技术呢?传统技术即使通过软件限制、性能优化等方法,也无法同时实现区块链的特性:

Smart contracts seem to be a computer-executable program that can be executed accurately and automatically, so why is it so difficult to achieve with traditional technologies that new technologies, such as block chain technologies, are needed? Traditional technologies, even through software limitations and performance optimization, do not achieve the characteristics of block chains at the same time:

基于区块链技术的智能合约不仅可以发挥智能合约在成本效率方面的优势,而且可以避免恶意行为对合约正常执行的干扰。将智能合约以数字化的形式写入区块链中,由区块链技术的特性保障存储、读取、执行整个过程透明可跟踪、不可攥改。同时,由区块链自带的共识算法构建出一套状态机系统,使得智能合约能够高效地运行。

Smart contracts based on block chain technology not only allow for the advantage of smart contracts in terms of cost efficiency, but also avoid malicious behavior that interferes with the proper execution of contracts. Smart contracts are digitized into block chains, where the characteristics of block chain technologies guarantee storage, reading, transparency of the process and non-reformability.

image

三、智能合约原理

III. Smart contract principles

智能合约系统根据事件描述信息中包含的触发条件,当触发条件满足时,从智能合约自动发出预设的数据资源,以及包括触发条件的事件;

Smart contract systems automatically release predefined data resources from smart contracts when the trigger conditions are met, and events including trigger conditions, based on the trigger conditions contained in the event description information;

image

整个智能合约系统的核心就在于智能合约以事务和事件的方式经过智能合约模块的处理,出去还是一组事务和事件;智能合约只是一个事务处理模块和状态机构成的系统,它不产生智能合约,也不会修改智能合约;它的存在只是为了让一组复杂的、带有触发条件的数字化承诺能够按照参与者的意志,正确执行。基于区块链的智能合约构建及执行分为如下几步:

The heart of the entire smart contract system lies in the fact that the smart contract is handled by the smart contract module in a transactional and event-based manner and is a group of transactions and events; the smart contract is a service processing module and a status agency system that does not generate the smart contract or modify the smart contract; it exists only to allow a complex set of digital commitments with trigger conditions to be properly executed in accordance with the will of the participants. The smart contract built and executed on the block chain is divided into the following steps:

1、多方用户共同参与制定一份智能合约;

1. Multi-user participation in the development of a smart contract;

2、合约通过P2P网络扩散并存入区块链;

2. Contract proliferation through the P2P network and placement in block chains;

3、区块链构建的智能合约自动执行。

3. Smart contracts for block chain construction are performed automatically.

image

四、智能合约的应用

iv. Application of smart contracts

这里以租房为例,说明智能合约的一个简单应用。

This is an example of a simple application of an intelligent contract.

假如一家租赁公司或是房东有一处房子需要出租,房子的电子锁和网络关联,可以通过网络设置电子锁的密钥。再假设租赁公司或是房东在某一个区块链平台发布了一个智能合约,合约的规则是:

If a rental company or landlord has a house to rent, the electronic lock of the house and the connection to the network can be used to set the key to an electronic lock on the web.

1. 房租每个月的费用是 3000;

1. The monthly cost of the rent is 3000;

2. 房租的交付形式是压一付一;

2. The payment of rent takes the form of a lump sum;

3. 每个月的 16 号交房租;

3. Rent paid on the 16th of each month;

4. 租赁公司或是房东和租户都必须在自己账户地址缴纳一定数额的保证金,并且在房屋租赁合同时期内,任何一方都不允许释放保证金;

4. The leasing company, or the landlord and the tenant must pay a certain amount of security at their account address, and neither party shall be permitted to release the bond during the period of the lease contract;

5. 如果租户按时缴纳房租,房屋密码会重新更新给租户;否则密码重置,根据合约自动扣除租户账户地址的保证金——将保证金转移给租赁公司或是房东;

If the tenant pays the rent on time, the home code will be renewed to the tenant; otherwise the password will be replaced by an automatic deduction of the security of the tenant's account address under the contract, which will be transferred to the leasing company or to the landlord;

6. 如果租赁公司或是房东违约,合约就扣除保证金——将保证金转移给租户。

In the event of default by the leasing company or the landlord, the contract deducts the bond, which is transferred to the tenant.

美化布局示例

欧易(OKX)最新版本

【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   全球官网 大陆官网

币安(Binance)最新版本

币安交易所app【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

火币HTX最新版本

火币老牌交易所【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址
文字格式和图片示例

注册有任何问题请添加 微信:MVIP619 拉你进入群

弹窗与图片大小一致 文章转载注明

分享:

扫一扫在手机阅读、分享本文

发表评论
平台列表
美化布局示例

欧易(OKX)

  全球官网 大陆官网

币安(Binance)

  官网

火币(HTX)

  官网

Gate.io

  官网

Bitget

  官网

deepcoin

  官网
热门文章
  • 从 IPFS社区Meetup谈谈2020年的IPFS的发展历程

    从 IPFS社区Meetup谈谈2020年的IPFS的发展历程
    8月3日, IPFS社区Meetup 如期举办,这一次的社区Meetup由交流与演讲和闪电演示两部分组成,其实该会议主要带领我们回顾了IPFS在2020年的发展历程(包括项目进展、IPFS生态发展等),展示了IPFS及其生态。2020年对于IPFS而言是不平凡的一年,其唯一激励层Filecoin的主网即将上线,这让IPFS和Filecoin在全球范围内得到了前所未有的关注,也推动了IPFS的高速发展。接下来,我们一起走进IPFS在20...
  • 超10万人爆仓,比特币跳水,发生了什么

    超10万人爆仓,比特币跳水,发生了什么
    现货比特币ETF上市第二日,数字货币再迎来抛售。比特币一度跌破42000美元/枚,截止1月13日内跌幅超7%,报42562.1美元/枚。The current Bitcoin ETF is on the second day of the market and the digital currency is sold again. Bitcoin fell by over 7% to $4562.1 on 13 January.现货比特币ETF普遍跌6%左右。其中,DEFI跌...
  • 兴业基金调研远光软件、东芯股份

    兴业基金调研远光软件、东芯股份
    根据6月6日公布的公开市场信息和机构研究,世界安全基金会最近对下列两家上市公司进行了一项研究: 1) 光电软件(工程师基金参与公司专项研究) 其中一个亮点是该公司深入参与建造南方网中心和技术平台,导致南网市场在 " 九天 " 平台产品方面取得重大突破;该公司的Won-宇宙大厅已上线,而且,除了Won-宇宙之外,远洋宇宙的应用现已扩大到Won-宇宙发射、Won-宇宙-教师和政党建设-宇宙;该公司的Far-O-Cloud平台已经实现了完全成熟的国家生产,也可以在全国云中运作。...
  • 0.00003374个比特币等于多少人民币/美金

    0.00003374个比特币等于多少人民币/美金
    0.00003374比特币等于多少人民币?根据比特币对人民币的最新汇率,0.00003374比特币等于2.2826 1222美元/16.5261124728人民币。比特币(BTC)美元(USDT)人民币(CNY)0.00003374克洛克-0/22216.5261124728比特币对人民币的最新汇率为:489807.72 CNY(1比特币=489807.72人民币)(1美元=7.24人民币)(0.00003374USDT=0.0002442776 CNY)。汇率更新于2024...
  • $DOG暴涨400%,加密货币或许正在重新定义和计量“价值”

    $DOG暴涨400%,加密货币或许正在重新定义和计量“价值”
    近/克洛克-0/5,Meme币狗?走吗?去哪?那个?MOON($ DOG)连续上涨超过230%,突破前期高点,达到0.0062美元。在同一时期,比特币生态的许多主流L2协议代币下跌了50%以上。这些就是我们所说的“价值币”。虽然大起大落不能说明什么,但从过去的牛市来看,领头羊MemeCoin表现非凡。在上一轮牛市中,$DOGE的价格上涨了超过150倍,其市值接近900亿美元。还有其他MemeCoin,如$Shib、$People、$ELON、$AKITA等。2 vkwmkpm...
标签列表