区块链智能合约介绍

资讯 2024-07-12 阅读:35 评论:0
作者:qinyutong、chengyueqiangQinyutong, Chenyueqiang智能合约 (smart contract) 是一种由事件驱动的、具有状态的代码合约和算法合同&nbs...
美化布局示例

欧易(OKX)最新版本

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

APP下载   全球官网 大陆官网

币安(Binance)最新版本

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

APP下载   官网地址

火币HTX最新版本

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

APP下载   官网地址

作者:qinyutong、chengyueqiang

Qinyutong, Chenyueqiang

智能合约 (smart contract) 是一种由事件驱动的、具有状态的代码合约和算法合同  [11],随着以比特币为代表的区块链技术的蓬勃发展, 区块链技术已经开始逐步超越可编程货币时代而进入智能合约时代。智能合约作为区块链的核心部分,在技术中得到广泛应用,也是令区块链成为具有一定颠覆性技术的原因之一。本文通过对智能合约的背景知识以及流程介绍,总结出当前智能合约的特点和应用领域,从而为区块链智能合约技术的发展提供一定参考。

Smart contract (smart contract) is an event-driven, state-of-the-art code contract and algorithm contract   & nbsp; [11], with the dynamic development of block chain technology represented by bitcoin,   block chain technology has begun to leapfrog into smart contract age as a central part of the block chain, which is widely used in technology and is one of the reasons why block chains become a sort of subversive technology. This paper provides a useful reference for the development of smart contract technology through background knowledge and process presentations of smart contracts, which capture the characteristics and applications of current smart contracts.

1、引言 

1, Introduction and nbsp;

区块链利用分布式节点共识算法对数据进行生成和更新,使用由自动化脚本代码组成的智能合约来编程和操作数据的一种全新的分布式基础架构与计算范式[10],本身具有去中心化的特性。

Block chains generate and update data using distributed node consensus algorithms, using an intelligent contract consisting of automated script codes to program and operate data in a completely new distributed infrastructure and computational paradigm [10], which is decentralized in itself.

区块链的发展主要分为三大阶段[6],第一阶段为以比特币为首的可编程货币,第二阶段为以智能合约为首的可编程金融,第三阶段为以去中心化应用为首的可编程社会。比特币发展迅速,区块链发展阶段逐渐向第二阶段过渡,以以太坊为首的智能合约技术得到了广泛关注。

The development of the block chain is divided into three main stages [6], the first one being a programmable currency headed by bitcoin, the second by smart contracts, and the third by decentralised applications. Bitcoin is growing rapidly, and the development phase of the block chain is gradually transitioning to the second phase, with widespread attention being paid to smart contract technology led by the Tails.

1995 年,由密码学家 Szabo 提出智能合约这一概念,由于当时缺少可信的执行环境,智能合约并没有被应用到实际产业中。比特币诞生后,由于比特币的底层技术区块链具有去中心化的特性,满足智能合约所需的可信的执行环境,区块链可以提供参与的各个节点的互信。

In 1995, Szabo, a cryptographer, proposed the concept of a smart contract, which was not applied to the real industry because of the lack of a credible enforcement environment. After Bitcoin’s birth, because of the decentralized nature of the bottom technical block chain in Bitcoin, which meets the credible implementation environment required for a smart contract, the block chain could provide mutual trust among the various nodes involved.

智能合约是一种计算机协议,在协议制定和部署后,不需要外加人为干预,即可实现自我执行和自我验证[4]。从技术角度来说,智能合约可以被看作一种计算机程序,这种程序可以自主地执行全部或部分和合约相关的操作,并产生相应的可以被验证的证据,来说明执行合约操作的有效性。在部署智能合约之前,与合约相关的所有条款的逻辑流程就已经被制定好了。智能合约通常具有一个用户接口,以供用户与已制定的合约进行交互,这些交互行为都严格遵守此前制定的逻辑。得益于密码学技术,这些交互行为能够被严格地验证,以确保合约能够按照此前制定的规则顺利执行,从而防止出现违约行为。

A smart contract is a computer protocol that allows self-execution and self-certification without the need for additional human intervention after the agreement has been developed and deployed[4]. From a technical point of view, an intelligent contract can be seen as a computer program that performs all or part of the contract-related operations autonomously and produces the corresponding verifiable evidence to demonstrate the validity of the execution of the contract. Before the deployment of the smart contract, the logical process of all the terms related to the contract has been developed. Smart contracts usually have a user interface that allows users to interact with the contract that has been developed, and these interactions strictly follow the logic that was developed.

图片1.png

表 1: 传统合约和智能合约的比较

 智能合约是在传统合约基础上对安全性、唯一性进行改进的一种合约,用数字形式定义的承诺来保障合约参与者的协议安全可靠。

& nbsp; Smart Contract is a contract that improves security and exclusivity on the basis of a traditional contract that guarantees the security of the agreement of the participants by defining the commitment in digital form.

区块链的智能合约最早建立在以太坊,用一段代码来实现条款在处理硬件和软件中的应用,这段代码运行在以太坊的虚拟机中,按照特定程序执行操作,在相应的时间节点完成条款内容。

The smart contract for the block chain was first established in Etheria, with a code for the application of clauses in hardware and software processing, which operates in the Etheraya virtual machine, operates according to a specific procedure and completes the terms at the corresponding time node.

以太坊是一个开源的具有智能合约功能的公共区块链平台,以太坊项目借鉴了比特币区块链的技术,对它的应用范围进行了扩展。如果说比特币是利用区块链技术的专用计算器,那么以太坊就是利用区块链技术的通用计算机。简单地讲,以太坊 = 区块链 + 智能合约。

Ether is an open-source public block chain platform with smart contract functions that has expanded its application by drawing on the technology of the Bitcoin block chain. If Bitcoin is a dedicated calculator using block chain technology, Ether is a generic computer using block chain technology. Simply put, Ether has & nbsp; = & nbsp; & nbsp; + & nbsp; smart contracts.

与比特币相比,以太坊最大的不同点是:它可以支持更加强大的脚本语言,即使用一套图灵完备的脚本语言来建立应用,允许开发者在上面开发任意应用,实现任意智能合约,这也是以太坊的最强大之处。作为平台,以太坊可以类比于苹果的应用商店,任何开发者都可以在上面开发应用,并出售给用户。

The biggest difference compared to Bitcoin is that it can support a stronger script language, that is, a fully fledged script language for applications that allows developers to develop whatever they want to use it to achieve whatever intellectual contracts they want. As a platform, it can be compared to apples’ application stores, where any developer can develop applications and sell them to users.

2、智能合约类型 

2, Smart Contract Type 

智能合约分为广义智能合约和狭义智能合约。广义的智能合约是指运行在区块链上的计算机程序,适用范围较广。狭义的智能合约是运行在区块链基础架构上,基于约定规则,由事件驱动、具有状态、能够保存账本上资产,利用程序代码来封装和验证复杂交易行为,实现信息交换、价值转移和资产管理,可自动执行的计算机程序[9]。

Smart contracts are divided into broad smart contracts and narrow smart contracts. A broad smart contract is a computer program that operates on a block chain and has a broader scope of application. A narrow smart contract is an automated computer program that operates on the block chain infrastructure, is based on contractual rules, is event-driven, has a state and is capable of preserving the assets on the books, uses program codes to encapsulate and validate complex transaction behaviour, and achieves information exchange, value transfer and asset management.[9]

2.1 脚本型智能合约

2.1 Script-type smart contracts

将比特币中的智能合约称为脚本型智能合约。由于比特币中的脚本仅包含指令和数据两部分,其中涉及到的脚本指令只需要完成有限的交易逻辑,不需要复杂的循环、条件判断和跳转操作,功能有限但编写较为容易,支持的指令不到 200 条。

A smart contract in Bitcoin is called a script-type smart contract. Since the script in Bitcoin contains only two parts of instructions and data, the script instructions involved simply complete a limited transaction logic, do not require complex loops, conditional judgement and jump operations, have limited functionality but are easier to write, and support less than 200 commands.

2.2 图灵完备型智能合约

2.2 The Turing Smart Contract

将主要运行在以太坊和超级账本中的智能合约称为图灵完备型智能合约。脚本语言被设计成为仅在有限范围内执行有限功能的简单执行语言,是非图灵完备的语言。使用脚本语言编写的交易指令虽然能够满足比特币应用,但无法适应以太坊平台的开发需求。目前,以太坊主要使用 Solidity 和 Serpent 两种智能合约开发语言。

The script language is designed to be a simple implementation language for limited functions only on a limited scale, not a fully developed language. Trade instructions in script language, while able to accommodate bitcoin applications, cannot be adapted to the development needs of the portal. At present, the script language is mainly used as the language of intellectual contract development for Solidity and Serpent.

2.3 可验证合约型智能合约

2.3 validated contractual intelligence contracts

将正在研发中的 kadena项目中的智能合约称为可验证合约型智能合约。可验证语言的语法类似于 Lisp语言,用于编写运行在区块链 Kadena上的智能合约,可实现合约的数据存储和授权验证等功能。为防止在复杂合约的编程过程中可能存在的安全漏洞以及因此而带来的风险,可验证合约型语言采用非图灵完备设计,不支持循环和递归。该语言编写的智能合约代码可以直接嵌入在区块链上运行,不需要事先编译成为运行在特定环境(如以太坊 EVM)的机器代码。

The smart contract in the ongoing development of the kadena project is called a verifiable contract smart contract. The authenticable language is similar to the Lisp language, which is used to prepare an intelligent contract running on the block chain, Kadena, which achieves such functions as data storage and authorization of the contract. In order to prevent possible security gaps in the process of programming complex contracts and the risks associated with them, the proven contract language is designed in a non-tulent manner and does not support recycling and regression. The intellectual contract code developed in that language can be directly embedded in the block chain and does not need to be translated in advance into machine codes operating in a given environment (e.g., Etherton EVM).

3、智能合约语言

3, smart contract language

3.1 Solidity

Solidity 可以用来开发合约并编译成以太坊虚拟机字节代码,运行在Etheream 虚拟机(EVM)之上。是静态类型语言,支持继承、库和复杂的用户定义类型等特性。虽然 Solidity 语法与  Javascript 较为接近,是一种面向对象的语言,但是两者又有许多不同:

Solidity can be used to develop contracts and translate them into an Etheeam virtual byte code, running on the Etheam virtual machine (EVM). It is a static language that supports properties such as inheritance, library, and complex user definition types. While the Solidity syntax is closer to   Javascript is a target-oriented language, there are many differences between the two:

由于语言内嵌框架是支持支付的,所以可以提供如payable之类的关键词,实现在语言层面直接支持支付,更为简便;

As the language embedded framework is supportive of payments, key words such as Payable can be provided to achieve direct support payments at the language level, which can be made easier;

由于以太坊底层是基于账户而非 UTXO,故存在特殊类型Address,可以用于定位用户和合约,并定位合约的代码; 

Since the bottom of Etheria is based on accounts rather than UTXO, there are special types of Address that can be used to locate users and contracts and to locate contract codes; & nbsp;

由于智能合约是将原来的一个简单函数调用变成了网络节点中的代码执行,故在去中心化的网络运行环境中,会更加强调合约或函数执行的调用方式;

Since an intelligent contract is a code execution that calls an original simple function into a network node, greater emphasis is placed on the way the contract or function is executed in a decentralised network operating environment;

由于为了保证合约执行的原子性,以避免中间状态出现的数据不一致,Solidity的异常机制一旦出现异常,所有执行都会被回撤。

In order to guarantee the atomic nature of the contract implementation in order to avoid inconsistencies in the data from the intermediate state, all implementations would be withdrawn in the event of anomalies in the unusual mechanism of Solarity.

常用的 Solidity  集成有  Remix、Visual studio  Extension  等。以编译器  Remix  为例,Remix  是基于浏览器的IDE,集成了编译器和 Solidity运行时的环境,不需要额外的服务端组件。这里用 Solidity开发“HelloWorld”。

Commonly used Solidity & nbsp; integrated with   Remix, Visual studio & nbsp; Extension & nbsp; etc. by compiler & nbsp; Remix & nbsp; for example, Remix & nbsp; IDE based on browser, integrated into the compiler and the environment during the operation of Solidity, which does not require additional service-end components.

可以看到,在 decoded output 中返回 HelloW orld ! 。

As can be seen, returns HelloW orld in decoded Output!

图片2.png

图1: 使用Solidity 开发“Hello World”

 

3.2 Serpent

Serpent和Python 类似,使用用 LLL 编译,最终会被编译为 EVM 字节码。可以用于开发合约编译成以太坊虚拟机字节代码。Serpent 是一种分组加密算法,更加简洁,将低级语言在效率方面的优点和编程风格的操作简易相结合,同时合约编程增加了独特的领域特定功能。

Serpent, similar to Python, is compiled using LLL, which will eventually be compiled as an EVM byte code. It can be used to develop a contract compilation for translation into an eBay virtual byte code. Serpent is a group encryption algorithm, which is more concise, combining the efficiency advantages of lower-level languages with the simple operation of programming styles, while contract programming adds a unique field-specific function.

3.3 Lisp LikeLanguage

LispLikeLanguage(LLL)是和 Assembly类似的低级语言。更为简单,本质上只是直接对以太坊虚拟机的一点包装。是一门 Lisp风格的底层编程语言,持续更新,并且与 Solidity同属一个资源库。

LipLikeLanguage (LLL) is a low-level language similar to that of Assembly. It's simpler, it's essentially just a little package for the Etherno virtual machine. It's a bottom programming language like Lip, which is continuously updated, and is a resource base with Solidity.

4、智能合约运行机制

4, Smart Contract Operating Mechanisms

以以太坊开发平台为例,智能合约运行机制主要包含以下阶段:

In the case of the Taiwan development platform, the smart contract operating mechanism consists mainly of the following stages:

生成代码:智能合约一般具有值和状态两个属性,代码中用If-Then和What-If语句预置了合约条款的相应触发场景和响应规则,在合约各方面内容都达成一致的基础上,评估确定该合同是否可以通过智能合约实现,即“可编程”,然后由程序员利用合适的开发语言将以自然语言描述的合同内容翻译为成为可执行的机器语言;

Generating code: A smart contract typically has both value and status attributes, in which the corresponding trigger scenario and response rules for the terms of the contract are pre-arranged in the If-Then and What-If terms, assessing, on the basis of agreement on all aspects of the contract, whether the contract can be achieved through an intelligent contract, i.e., “programmable”, and then translated by the programmer into an enforceable machine language, using the appropriate development language, the content of the contract described in the natural language;

编译:利用开发语言编写的智能合约代码一般不能直接在区块链上运行,而需要在特定的环境(以太坊为 EVM, 超级账本为 Docker容器)中执行,所以在将合约文件上传到区块链之前需要利用编译器对原代码进行编译,生成符合环境运行要求的字节码。;

Compiling: Smart contract codes written in the language of development cannot normally run directly on the block chain, but need to be performed in a given environment (with Taiping as   EVM,   superbook as   Docker container), so the original code needs to be compiled using compilers to generate bytes that meet environmental performance requirements before uploading the contract documents to the block chain.

提交:智能合约的提交和调用是通过“交易”完成,当用户以交易形式发起提交合约文件后,通过  P2P  网络进行全网广播,各节点在进行验证后存储在区块中;

Submission: The submission and call for an intelligent contract is done through a “transaction”, and     P2P    web-based broadcasting, with nodes stored in blocks after validation, when the user initiates the submission of the contract document;

确认:被验证后的有效交易被打包进新区块,通过共识机制达成一致后,新区块添加到区块链的主链。根据交易生成智能合约的账户地址,之后可以利用该账户地址通过发起交易来调用合约,节点对经验证有效的交易进行处理,被调用的合约在环境中执行。

Confirms that valid transactions that have been validated are packaged into new blocks, which, when agreed through a consensus mechanism, are added to the main chain of block chains. The account address from which the transaction generates the smart contract can then be used to call the contract by initiating the transaction, nodes are processed for transactions that have proven to be effective, and the contracts that are transferred are executed in the environment.

图片3.png

图 2: 合约运行机制

5、智能合约项目

5, Smart Contract

最简单的合约是:信息上传区块链——双方签字确认——双方达成共识——合约被存储。

The simplest contracts are: the chain of information uploading blocks — the signature of the parties confirming — the agreement of the parties — the contracts are stored.

图片4.png

图 3: 合约基本模型  

Language  Language是一种安全稳定的分布式语言,符合  Szabo  对智能合约设计理念的特点,所有的远程通信会被加密。

Language & nbsp; Language is a secure and stable distributed language that corresponds to   Szabo & nbsp; features of smart contract design concepts, all remote communications are encrypted.

Hawk  Hawk 是一种去中心化的智能合约系统,是一个用智能合约构建隐私保护的框架[2],在这个系统中不会以明确的方式将金融交易存储在区块链中,Hawk 编译器负责将程序编译为区块链和用户之间的加密协议。OpenBazzar    OpenBazzar  平台是一家利用比特币进行交易的去中心化电商平台,是一个开源平台,直接将用户与用户连接开展交易,实现点对点交易网络,买卖双方可以直接进行交易,不需要借助中心化平台,保证了隐私。Ethereum    Ethereum  是具有图灵完备编程语言的区块链平台,包含了公有链和私有链,可以创建任何应用。使用共识机制中的 PoW 机制,拥有更高的处理速度和精度,可以在没有处理所有交易的情况下验证应用状态,目标成为分布式应用平台的脊梁。但区块的构造时间受到交易处理速度的影响,建块速度受到很大影响。

HawkHawk  Hawk is a decentralised smart contract system, a framework for the construction of privacy protections with smart contracts [2], where financial transactions are not stored in the block chain in a clear way, and Hawk compiles the program into an encryption protocol between block chains and users. OpenBazzar          &nenBazzar & nbsp; platform for decentralization trading with bitcoins; & nbsp; & nbsp; directly linking users to users; point-to-point trading network; buyers and sellers can deal directly, without the need to use a central platform to secure privacy; Etherean and nbsp; & & & & & & nbsp; the power-to-to-to-to-to-to-to-to-to-to-to-to-to-to-t-to-to-to-to-to-to-to-to-the-to-to-to-the-to-to-to-to-to-the-to-to-to-the-to-to-to-to-to-the-to-to-to-to-to-to-to-to-to-to-to-to-to-to-to-to-to-use....

Codius  Codius 是由 Ripple 实验室发布的智能协议,具有去中心化、安全性高等特点,可以实现点对点交易网络,是一种开源平台,应用于 Ripple 平台上,实现的功能是引导货币流通。

Codius    Codius  by   Ripple  smart protocols issued by laboratories with high decentralisation and security features that enable point-to-point trading networks, are open-source platforms for   on the Ripple platform, the function is to direct currency flows.

Hyperledger Hyperledger是一种 Linux 基金会下的区块链开源平台,以容器的形式运行智能合约,具有较高安全性。

Hyperledger  Hyperledger is a block open-source platform under the Linux Foundation that operates smart contracts in container form with a high level of safety.

6、智能合约基本特点

6, Basic Characteristics of Smart Contracts

6.1 优势

6.1 Strengths

可信性 智能合约的承诺包含两方面,一是自动,无需信任和公正地执行合约;二是直接,在合约执行的各个环节中取消中间人这一角色[5]。智能合约的所有条款和执行过程是提前制定好的,并由计算机绝对执行。因此所有执行的结果都是准确无误的,不会出现不可预料的结果。

Credibility & nbsp; the promise of an intelligent contract consists of two things: automatic, non-trustful and fair execution of the contract; and direct elimination of the role of an intermediary at all stages of the contract’s execution [5]. All terms and procedures of an intelligent contract are developed in advance and implemented absolutely by a computer. The results of all enforcement are therefore accurate and do not lead to unforeseen results.

交易无需第三方  智能合约不需要中心化的权威来仲裁合约是否按规定执行,合约的监督和仲裁都由计算机来完成[1]。在一个区块链网络中一般不存在一个绝对的权威来监督合约的执行,而是由共识机制来判断合约是否按规定执行,监督方式通常由PoW 或 PoS 技术实现。由于智能合约的数字化特点,数据被存储在区块链中,使用加密代码强制执行协议,保证交易可追踪和不可逆转。

A transaction does not require a third party & nbsp; & nbsp; an intelligent contract does not require centralized authority to arbitrate whether or not the contract is executed as required, and the monitoring and arbitration of the contract is done by computers [1]. In a network of blocks, there is generally no absolute authority to supervise the implementation of the contract, but rather a consensus mechanism to determine whether the contract is executed as required, usually in the form of PoW or Pos technology. Because of the digital features of an intelligent contract, data are stored in a block chain, using encryption codes to enforce the agreement to ensure that the transaction is traceable and irreversible.

高效的实时更新  由于智能合约的执行不需要人为的第三方权威或中心化代理服务的参与,其能够在任何时候响应用户的请求,大大提升了交易进行的效率。用户只需通过网络对业务进行办理,节省了人力、物力。

Efficient real-time updates & nbsp; & nbsp; since the implementation of smart contracts does not require the involvement of artificial third-party authority or centralised proxy services, they are able to respond to users’ requests at any time and significantly improve the efficiency of transactions. Users simply need to handle their business online, saving human and material resources.

更低成本 智能合约具有去人为干预的特点,其能够大大减少合约履行、裁决和强制执行所产生的人力成本,要求合约制定人能够将合约的各个细节在合约建立之初就确定下来。

Lower & nbsp; smart contracts are characterized by dehumanizing interventions that can significantly reduce the human costs of contract performance, adjudication and enforcement, and require contractmakers to be able to determine the details of the contract at the outset of the contract.

6.2 目前存在的问题

6.2 Current problems

不可撤销性 智能合约自动履行合约内容,但在现实生活中,合同可能会因为一些不可抗力、违法等原因解除。合同法中,对于合同的要求是避免律师预测和协商可能出现结果的灵活性。但由于区块链的不可修改性,智能合约一旦触发就会自动履行,不可撤销,具有一定的僵化特性。

Non-revocability & nbsp; smart contracts automatically perform the content of the contract, but in reality the contract may be dissolved for reasons of force majeure, illegality, etc. In contract law, the requirement is to avoid the flexibility of counsel to predict and negotiate possible outcomes.

法律效力 智能合约的起草需要通过第三方计算机程序员,而在合约出现问题时若判定是第三方计算机程序员的责任,那么对于错误的算法应该如何追究责任。在法律管辖权问题上,智能合约作为一种新兴合约方式,哪些法院可以受理诉讼、现有的法律条款应该如何修改等问题都是亟待解决的。

Legal & nbsp; Smart contracts need to be drafted through third-party computer programmers, and how faulty algorithms should be held accountable if a problem arises in a contract with a third-party computer programmer. In the matter of legal jurisdiction, smart contracts are an emerging form of contract, which courts are open to litigation, how existing legal provisions should be amended, etc.

安全漏洞 智能合约的漏洞分为交易顺序依赖漏洞、时间戳依赖漏洞、处理异常漏洞和可重入缺陷漏洞 [3],依赖性漏洞是由于智能合约的执行正确与否与以太坊的状态有关,而有效的交易可能会影响以太坊的状态。当一个新的区块含有两笔交易时,交易的先后顺序可能会引起以太坊的最终状态不同,而交易的顺序取决于矿工,从而导致智能合约的执行依赖于矿工的操作 [8]。时间戳依赖漏洞是由于某些智能合约是根据区块中的时间戳所执行的,而时间戳是由矿工根据自身的时间所设置的,若时间被攻击者所修改,可能会导致产生一定风险。在不同的智能合约相互调用时可能出现处理异常漏洞,若被调用的合约产生错误返回值却没有被正确验证时,可能会遭受到攻击。若一个函数在执行完成前被调用了数次,导致发生意料不到的行为时,可重入漏洞就可能出现,可重入缺陷漏洞是指攻击者可以利用调用了智能合约而状态未改变的中间状态对合约进行反复的调用。

When a new block contains two transactions, the order of transactions may give rise to a difference in the final state of the court, depending on the miners, which leads to the operation of the miners & nbsp;[8] Time-stamp reliance is due to the fact that certain smart contracts are executed on the basis of the timing of the block and that the timing of the contract is based on the timing of the miner’s own situation, and that an effective transaction may affect the state of the court. When a new block contains two transactions, the order of transactions may lead to a difference in the final state of the court, while the order of transactions depends on the miners, and the execution of the contract depends on the operation of the miner & nbsp;[8] Time-stamp reliance is due to the fact that some smart contracts are executed on the basis of the timing of the block, which is set by the miner’s own time, which may result in a risk if the person is modified by the time of the striker’s time, which may result in a breach of the contract’s not-to-use condition, which may be used.

7、智能合约应用场景

7, smart contract application

7.1 法律方面

7.1 Legal aspects

在法律层面,区块链智能合约可以被看作为智能合同[10],即运用区块链技术来实现法律合同,将书面化的法律语言转化为可被自动化执行的技术。

At the legal level, block chain intelligence contracts can be seen as smart contracts [10], i.e., the application of block chain technology to achieve legal contracts and the translation of written legal language into technologies that can be automated.

以数字版权保护为例,类似于自由文化影响下的知识共享协议的开放式版权协议不断出现,如何保证版权的实用行为,是数字版权保护的核心问题。由于传统的版权保护具有时间、空间的限制,在版权登记、监管机制等方面容易受到影响,而数字版权保护的出现极大改善了这一问题,更好适应了数字资产形式变化多样、易传播的特点。

In the case of digital copyright protection, for example, the emergence of open copyright agreements similar to knowledge-sharing agreements under the influence of a free culture, and practical action to secure copyright, are central to digital copyright protection. Traditional copyright protections are time- and space-limited, and are susceptible to influence in terms of copyright registration, regulatory mechanisms, etc. The emergence of digital copyright protections greatly improves the problem and better adapts to the diverse and easy-to-dissemination features of digital asset forms.

在版权登记方面,利用区块链技术原理中计算值的唯一性和不可篡改性,对不同的作品生成不同的计算值,将计算值视为作品的一种代表方式进行关联,可以减少作品追溯和存储的成本,简化作品查询流程。在署名方式方面,使用数字身份对计算值对应的作品进行署名,使用加密技术对数字作品进行保护,保障作品不会被篡改。根据合约代码和自然语言的比例,智能合约有以下几种表现形式:1、完全以代码形式编写的合约;2、以代码和自然语言两种形式书写的合约。如果法律认为无论是以自然语言书写还是以计算机语言编写,都视为合同的书面形式,法律效力是相同的,那么两种语言编写的合约构成了完整的合同。智能合同可能面临的问题有,第2 种合同是以两种语言表现的,如果这两个版本合约内容上有冲突,以哪一个版本为准,无论是以自然语言版本为准还是以代码语言为准,都需要法律进一步明确并给出司法解释。 

In the area of copyright registration, the uniqueness and inflexibility of the computational values in the technical principles of the block chain are used to create different computational values for different works, linking them to a representative form of the work, reducing the cost of retroactive and storage of the work and simplifying the search process for the work. In the form of signature, digital identity is used to sign the work corresponding to the value, encryption is used to protect the digital work, and the work is not tampered with. According to the ratio between contract codes and natural languages, smart contracts take the following forms: (1) contracts written exclusively in code form; (2) contracts written in both code and natural languages. If the law considers that writing in both natural and computer languages is the written form of the contract, the legal effect is the same, the contracts prepared in both languages constitute a complete contract.

7.2 金融方面

7.2 Financial aspects

在金融层面,因为智能合约可以在区块链中运作,从而充当很多角色。智能合约可以作为经济参与者,接受信息、存储信息,消除人工参与,降低成本,保证合约交易的高效。以物联网为例,当前社会物联网包括数十亿个通过互联网共享数据的节点,通过物联网、区块链以及智能合约技术的融合应用,物联网支持的物理设备或财产,如公寓、汽车、停车场、自行车等,都可以允许人们在没有中间商的情况下出租、出售或共享[7]。当前租房市场在押金方面存在很多争议,一些不良房东在收到押金后就卷钱跑路。将智能合约引入到租房押金中, 在所有者设定出租房屋的金额后,用户通过交易向区块链支付押金,从而触发许可,获得房屋的智能锁权限。与此同时,押金被锁定在区块链中,直到用户决定向区块链发送另一个交易来返回虚拟密钥(如支付租金),智能合约自动执行,在扣除押金中的租金后将剩余金额发送给所有者,交易完成。这一过程将缩减不必要的时间,只需要通过手机进行操作,提高效率的同时降低风险。但智能合约可能会带来新的金融犯罪行为和风险,例如机密信息泄漏、加密密钥被盗等犯罪行为,而当前的法院和监管机构暂时很难跟上这一技术的发展步伐,由于智能合约具有一定的复杂性,在一些消费者眼里是难以理解的,这也是智能合约实施中需要解决的问题之一。

At the financial level, because smart contracts can operate in block chains, they can play many roles. Smart contracts can allow people to rent, sell or share [7] without middlemen. There are a lot of disputes about the price in the current rental market, with some bad landlords rolling their way back to virtual key (e.g. rents) after receiving a deposit. After all have set the amount of rent in a rental home, the user pays a deposit to a block through a transaction, thereby triggers a licence, acquires a smart lock in a house, such as an apartment, a car, a parking lot, a bicycle, and so on.

7.3 公益慈善

7.3 Public good philanthropy

在公益慈善层面,当前面临的最大问题是资金流向不透明,导致很多人并不会使用众筹平台来进行慈善捐款。众筹是一种通过互联网方式发布筹款项目并筹集资金的方式,众筹更为开放,具有门槛低、依靠大众力量等特点。如何解决资金信息公开透明,加强监管和监督,成为当前公益慈善的热点讨论之一。区块链是遗传使用密码学方法产生关联的数据块,每一个数据块中都涵盖了一定时间的交易信息,每个数据块都包含上一个块的哈希值,以用于验证其信息的有效性 [12]。智能合约可以通过代码合约实现对众筹系统价值流的控制,将众筹业务流转换为智能合约代码。区块链的不可更改和共识机制保证了数据的真实和可靠性,可以提高众筹平台的公信力。

At the level of public good philanthropy, the biggest problem now is that financial flows are not transparent, resulting in many people not using public fund-raising platforms for charitable donations. Public fund-raising is a way of publishing fund-raising projects and raising funds via the Internet, and is more open, low-threshold and popular.

图片5.png

photo 5.png

 图4: 子系统节点部署

众筹区块链总体设计包含双数据系统、双私有链设计、高速与信誉机制、智能合约设计、审计与监督设计、可扩展链式设计。由于区块链的分布式存储架构,可以在不同用户处放置不同权限的节点,让不同用户参与到管理中,对于发布的消息实现可追踪和不可修改。通过不断互联,使区块链形成互联链、链中链,按照统一标准进行管理监管,解决慈善公益的监管和监督问题。 

The overall design of the crowd-sourcing blocks chain includes dual data systems, dual-private chain design, high-speed and credit mechanisms, smart contract design, audit and oversight design, and scalable chain design. Because of the distributed storage structure of the block chain, different nodes of access can be placed in different user locations, with different users involved in management, and messages published can be traceable and non-modifiable. Through continuous interconnection, the block chain can be connected, interlinked, managed according to uniform standards, and the regulation and supervision of charitable public goods can be addressed.

参考文献

References

[1] Bartoletti, M.,and Zunino, R.  Bitml:  A calculus for bitcoin smart contracts.  pp.83–100.

[2] Kosba, A., Miller, A., Shi, E., Wen, Z., and Papamanthou, C. Hawk: The blockchain modelof cryptographyandprivacy-preservingsmartcontracts.pp.839–858.

[3] Luu, L., Chu, D.-H., Olickel,  H.,  Saxena, P.,  and  Hobor, A.  Making smart contractssmarter.  pp.254–269.

[4]  Mourouzis, T., and Tandon,  J. Introduction to decentralization and smart contracts, 03    2019.

[5]  Pfitzmann,  B.,  Schunter, M.,  and  Waidner,  M. Optimal efficiency of optimistic contractsigning.

[6]  V.Buterin.  Anext-generation smart contract and decentralized application platform.  white paper     (2014).

[7]  刘德林.  区块链智能合约技术在金融领域的研发应用现状、问题及建议. 海南金融 000, 10(2016),27–31.

em>[7]  Laudelin.  & nbsp; status of R & D applications, problems and recommendations in block chain smart contract technology in the financial field. & nbsp; Hainan Finance & nbsp; 000, & nbsp; 10 (2016), 27–31.

[8]  张杰. 区块链安全综述. 西安文理学院学报 (自然科学版)(2020),42–55.

em>[8]  Zhang Jie.  safety overview of block chains. < & nbsp;

[9]  王群, 李馥娟, 王振力, 梁广俊, and 徐杰. 区块链原理及关键技术. 计算机科学与探索, 1–24.

em>[9]  Wang Qun, Li Xing, Wang Zhen, Liang Guangjun, & nbsp; and Xu Jie.& nbsp; principles of block chains and key technologies.    computer science and exploration,   1-24.

[10] 贺小苗. 区块链技术的应用: 智能合约及法律问题前瞻. 现代商业000, 16(2018),153–154.

em> [10]; application of block chain technology:   forward looking for smart contracts and legal issues. <000,   16 (2018), 153–154.

[11] 贺海武, 延安, and陈泽华. 基于区块链的智能合约技术与应用综述. 计算机研究与发展55, 11(2018),112–126.

em> [11] Hae-wu,   Yanan,   and Chen Zehua.  overview of smart contract techniques and applications based on block chains.  55,   11 (2018), 112–126.

[12] 黄洁华, 高灵超, and许玉壮. 众筹区块链上的智能合约设计. 信息安全研究 (2017).

em> [12] yellow water,     and Xu Yuqiang. & nbsp; smart contract design on the mass-moved block chain.   information security study & nbsp; (2017).


本文原创自百度安全实验室,转载请注明出处。

美化布局示例

欧易(OKX)最新版本

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

APP下载   全球官网 大陆官网

币安(Binance)最新版本

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

APP下载   官网地址

火币HTX最新版本

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

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

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

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

分享:

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

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

欧易(OKX)

  全球官网 大陆官网

币安(Binance)

  官网

火币(HTX)

  官网

Gate.io

  官网

Bitget

  官网

deepcoin

  官网
热门文章
  • 美国可以使用什么加密货币交易所_前10名比特币交易平台名单

    美国可以使用什么加密货币交易所_前10名比特币交易平台名单
    美国可以使用什么加密货币交易所?What is an encrypted currency exchange that the United States can use?随着加密货币的普及,加密货币交易所也越来越多。对于美国的加密货币交易者而言,选择一个可靠、安全且易于使用的交易所是十分重要的事情。那么,美国可以使用哪些加密货币交易所呢?以下是前10名比特币交易平台名单:The choice of a reliable, secure, and easy-to-use...
  • 2017比特币已经挖出,比特币是什么?

    2017比特币已经挖出,比特币是什么?
    20 17比特币已经挖出了目录。20 17比特币被挖出来了。比特币是什么?比特币在20 17达到挖矿上限。在20 17中,比特币达到了挖矿上限,这意味着比特币的总数达到了2 1 100,000。比特币挖矿会越来越少。由于比特币挖矿的奖励每四年减半一次,未来比特币挖矿的数量将减少,比特币的价格可能会上涨。影响比特币市场的主要因素。除了挖矿上限和奖励减半之外,比特币市场还受到供需、投资者情绪和监管政策等因素的影响。比特币的未来前景。随着全球对比特币的认知度越来越高,比特币的前景仍...
  • 2015年宝马3系二手车价格多少钱

    2015年宝马3系二手车价格多少钱
    爱你一生不变心6558 2022-04-28 13:20:03 二手车能不能买主要看车况,如果车况好就可以考虑,车况不好价格再低也别考虑,像2015款宝马3系目前行情价是在18.32万这样,如果低...
  • Coinbase:财富100强企业过去一年的Web3采用率增长39%

    Coinbase:财富100强企业过去一年的Web3采用率增长39%
    随着比特币、以太坊等主流加密货币在web2世界的认可度变得越来越高,许多web2传统公司也积极拥抱web3,加速采用和开发区块链产品的速度和应用层面。With ˂a style= "max-width": 90%" href=https://m.php.cn/zt/21172.html" target="_blank" bitcoin, ˂a style="color:#f60; text-decoration: unde...
  • 区块链技术原理(转载)

    区块链技术原理(转载)
    转自:https://cloud.tencent.com/developer/article/1838661From: https://clud.tencent.com/development/article/1838661 本文主要是对区块链进行概念分析和组成技术解析,从哈希运算、数字签名、共识算法、智能合约、P2P网络等技术在区块链中的应用进行综合分析This paper focuses on conceptual analysis and technical com...
标签列表