版权声明
Copyright
首发自微信公众号:新个体
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.
一、智能合约的定义
智能合约”(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.
三、智能合约原理
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;
整个智能合约系统的核心就在于智能合约以事务和事件的方式经过智能合约模块的处理,出去还是一组事务和事件;智能合约只是一个事务处理模块和状态机构成的系统,它不产生智能合约,也不会修改智能合约;它的存在只是为了让一组复杂的、带有触发条件的数字化承诺能够按照参与者的意志,正确执行。基于区块链的智能合约构建及执行分为如下几步:
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.
四、智能合约的应用
这里以租房为例,说明智能合约的一个简单应用。
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.
注册有任何问题请添加 微信:MVIP619 拉你进入群
打开微信扫一扫
添加客服
进入交流群
发表评论