什么是区块链的“智能合约”

资讯 2024-06-27 阅读:167 评论:0
关注区块链就会经常听到“智能合约”的术语,那么如何理解“智能合约”?它从何而来,它如何运作?它有什么优缺点?本文适用于初学者。Focusing on block chains often h...
美化布局示例

欧易(OKX)最新版本

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

APP下载   全球官网 大陆官网

币安(Binance)最新版本

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

APP下载   官网地址

火币HTX最新版本

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

APP下载   官网地址

关注区块链就会经常听到“智能合约”的术语,那么如何理解“智能合约”?它从何而来,它如何运作?它有什么优缺点?本文适用于初学者。

Focusing on block chains often hears the term “smart contract”, so how do you understand “smart contract”? Where does it come from, how it works? What are its advantages and disadvantages? This applies to beginners.

我们经常会听到区块链技术的流行语,如“去中心化网络”“智能合约”等。有些人投资的时候,可能不会去关注项目的复杂细节,但不少成功的投资者对于“智能合约”等重要术语非常熟悉,对加密货币背后的具体技术理解透彻。

We often hear popular language about block chain technologies, such as “decentralized networks” and “smart contracts.” Some people invest in projects that may not focus on the complex details, but many successful investors are familiar with important terms such as “smart contracts” and have a thorough understanding of the specific techniques behind encrypted money.

我们可以从智能合约的历史到智能合约的应用一一阐述。首先要提到的是,本文不涉及任何投资建议。本文主要是阐述智能合约的关键部分以及它对区块链和加密货币的潜在重要性。

We can go from the history of smart contracts to the application of smart contracts. First of all, the paper does not deal with any investment proposals.

在全面阐述什么是智能合约之前,我们先回顾一下它创建的历史背景,有助于理解它的重要性。

Before giving a comprehensive account of what a smart contract is, let us look back at the historical context in which it was created and help to understand its importance.

1994年,计算机科学家和密码学家Nick Szabo首次提出“智能合约”概念。它早于区块链概念的诞生。Szabo描述了什么是“以数字形式指定的一系列承诺,包括各方履行这些承诺的协议”。虽然有它的好处,但智能合约的想法一直未取得进展——主要是缺乏可以让它发挥出作用的区块链。

In 1994, computer scientists and cryptographers Nick Szabo first proposed the concept of “smart contracts”. It predates the conception of a block chain. Szabo describes “a series of commitments designated in digital form, including agreements between the parties to fulfil them.” Despite its benefits, the idea of smart contracts has not progressed — mainly because of the lack of a chain of blocks that can make it work.

直到2008年,第一个加密货币比特币才出现,同时引入了现代区块链技术。区块链最初是以比特币的底层技术出现的,各种区块链分叉导致发生很大的变化。智能合约在2008年依然无法融入比特币区块链网络,但在五年后,以太坊让它浮出水面。从此,涌现出了各种不同形式的智能合约,其中以太坊智能合约使用最广。

In 2008, the first encrypted currency, bitcoin, did not appear until 2008, when modern block chain technology was introduced. The block chain was originally based on the bottom of bitcoin, and the multi-block chain splits led to significant changes. Smart contracts could not be integrated into the Bitcoin block chain network in 2008, but five years later, it was brought to the surface.

智能合约的概念可以追溯到1994年,由Nick Szabo提出,但直到2008年才出现采用智能合约所需的区块链技术,而最终于2013年,作为以太坊智能合约系统的一部分,智能合约首次出现。

The concept of a smart contract dates back to 1994 and was proposed by Nick Szabo, but it was not until 2008 that the block chain technology required for the introduction of a smart contract emerged, and eventually in 2013 the smart contract emerged for the first time as part of the Etherno Smart Contract System.

上面提到了历史背景,下面从多个角度继续探讨。智能合约是一种特殊协议,旨在提供、验证及执行合约。具体来说,智能合约是区块链被称之为“去中心化的”重要原因,它允许我们在不需要第三方的情况下,执行可追溯、不可逆转和安全的交易。

The above refers to the historical context, which continues to be discussed from several angles. Smart contracts are special agreements designed to provide, authenticate, and enforce contracts. In particular, smart contracts are important reasons why block chains are called “decentralized” and allow us to carry out retroactive, irreversible and safe transactions without the need for third parties.

智能合约包含了有关交易的所有信息,只有在满足要求后才会执行结果操作。智能合约和传统纸质合约的区别在于智能合约是由计算机生成的。因此,代码本身解释了参与方的相关义务。

Smart contracts contain all information about transactions, and result operations are performed only when the requirements are met. Smart contracts and traditional paper-based contracts are distinguished by the fact that smart contracts are generated by computers.

事实上,智能合约的参与方通常是互联网上的陌生人,受制于有约束力的数字化协议。本质上,智能合约是一个数字合约,除非满足要求,否则不会产生结果。

In fact, intellectual contracts typically involve strangers on the Internet, subject to binding digital protocols. Smart contracts are essentially a digital contract that does not produce results unless they meet the requirements.

很多区块链网络使用的智能合约功能类似于自动售货机。智能合约与自动售货机类比:如果你向自动售货机(类比分类账本)转入比特币或其他加密货币,一旦输入满足智能合约代码要求,它会自动执行双方约定的义务。

A lot of block-chain networks use smart contract functions similar to those used in vending machines. Smart contracts are similar to vending machines: if you transfer to a vending machine (similar ledger) to bitcoin or other encrypted currency, it automatically executes the obligations agreed upon by the parties once it is entered to meet the code requirements of an intelligent contract.

义务以“if then”形式写入代码,例如,“如果A完成任务1,那么,来自于B的付款会转给A。”通过这样的协议,智能合约允许各种资产交易,每个合约被复制和存储在分布式账本中。这样,所有信息都不能被篡改或破坏,数据加密确保参与者之间的完全匿名。

Obligations are written in the form of “if then”, for example, “If A accomplishes its task 1, then payments from B are transferred to A.” Through such an agreement, intelligent contracts allow for various asset transactions, each contract being copied and stored in a distributed account book. In this way, all information cannot be tampered with or destroyed, and data encryption ensures complete anonymity between participants.

虽然智能合约只能与数字生态系统的资产一起使用,不过,很多应用程序正在积极探索数字货币之外的世界,试图连接“真实”世界和“数字”世界。

While smart contracts can only be used with the assets of digital ecosystems, many applications are actively exploring the world beyond digital currencies and attempting to connect the “real” and “digit” worlds.

智能合约根据逻辑来编写和运作。只要满足输入要求,也就是说只要代码编写的要求被满足,合约中的义务将在安全和去信任的网络中得到执行。

Smart contracts are built and run logically. As long as the input requirements are met, that is, as long as the code writing requirements are met, the obligations in the contract will be implemented in a secure and trusted network.

为了编写智能合约,你必须使用智能合约语言(SCL)。这些是直接编写智能合约或编译成智能合约的编程语言。Solidity是一种编写智能合约的编程语言,它在以太坊虚拟机上运行。它是一种面向合约的高级语言,其语法类似于JavaScript,主要针对以太坊EVM。

In order to write a smart contract, you must use the smart contract language (SCL). These are the programming languages for directly writing a smart contract or for translating it into a smart contract. Solidity is the programming language for writing a smart contract, which operates on the Etherton virtual machine. It is a high-level contract-oriented language, similar to JavaScript, whose syntax is directed primarily at the Etherm EVM.

以太坊虚拟机(EVM)是以太坊上智能合约的运行环境。它实际上是完全隔离的,这意味着在EVM上运行的代码无法访问网络、文件系统和其他进程。智能合约对其他的智能合约的访问权也有限,在区块链网络上单独运作。

The Etheraya Virtual Machine (EVM) is an operating environment for the Taiyo Smart Contract. It is in fact completely isolated, which means that codes running on EVM do not have access to networks, file systems, and other processes. Smart contracts also have limited access to other smart contracts and operate separately on the block chain network.

在以太坊网络上编写智能合约有三个主要步骤:

Three major steps have been taken to create a smart contract on the Etherms network:

  1. 用以太坊高级语言编写
  2. 用EVM编译器编译成字节码
  3. 用以太坊客户端上传到区块链网络

对于智能合约和开源编码感兴趣的人,广为人知的资源之一是GitHub。这是开发人员托管软件代码的在线平台。你的每段代码会存在存储库中,存储库基本上是一个存储所有代码组件的文件夹。

One of the well-known resources for people interested in smart contracts and open source codes is GitHub. This is an online platform for developers to host software codes. Each segment of your code will be stored in a repository, which is essentially a folder for all code components.

很多人把其他人的存储库复制和粘贴到自己的账户中,然后进行微调整,变成自己的。通过搜索项目和存储库来浏览页面,可以帮你构建自己的项目。一旦找到你所需要的存储库,打开它并搜索内容,会包含大量有用代码的复杂内容。使用上述程序和资源,你也可以创建自己的智能合约。

Many people copy and paste other people's repositories into their accounts, and then fine-tune them to themselves. By browsing the pages, you can build your own projects. Once you find the repository that you need, open it and search for content, it contains a lot of complex content that is useful. With these programs and resources, you can also create your own smart contracts.

智能合约是用SCL编写的,以太坊智能合约功能归功于以太坊虚拟机。这是以太坊上智能合约的运行环境。

Smart contracts are written by SCL, thanks to the Etheraya virtual machine. This is the operating environment for the Etheraya smart contracts.

就像任何其他新的系统协议一样,智能合约并不完美。使用智能合约有几个优点和缺点,包括更高的效率和缺乏监管。具体来说:

Like any new system agreement, smart contracts are not perfect. There are several advantages and disadvantages to using smart contracts, including greater efficiency and lack of regulation. Specifically:

使用智能合约的一些主要优势包括在处理文档时的更高效率。这归功于它能够采用完全自动化的流程,不需要任何人为参与,只要满足智能合约代码所列出的要求即可。结果是,会节省时间,降低成本,交易更准确,且无法更改。

Some of the main advantages of using smart contracts include more efficient processing of documents. This is due to its ability to adopt fully automated processes, without any involvement, as long as it meets the requirements set out in the smart contract code. The result is that it saves time, reduces costs, makes transactions more accurate, and cannot be changed.

此外,智能合约去除任何第三方干扰,进一步增强了网络的去中心化。

In addition, the decentralization of the network is further enhanced by the removal of any third-party interference from smart contracts.

另一方面,智能合约的使用也会产生不少问题。一些缺点包括:人为错误、完全实施有困难、不确定的法律状态。

On the other hand, there are a number of problems associated with the use of smart contracts. Some of the disadvantages are human error, difficulty in fully implementing the law, and uncertainty.

虽然很多人把智能合约的不可逆转特性看作是它的主要好处,但也有人认为一旦出现问题无法修改。因为人类会犯错误,在创建智能合约时也一样,一些绑定协议可能包含错误,而它们是无法逆转的。

While many view the irreversible nature of smart contracts as its main benefit, there are also those who believe that problems cannot be changed when they arise. Because humans make mistakes, as they do when they create smart contracts, some binding agreements may contain errors that are irreversible.

此外,智能合约只能使用数字资产,在连接现实资产和数字世界时会出现问题。最后也是最重要的是,智能合约缺乏法律监管,只受制于代码约定的义务。缺乏法律监管可能会导致一些用户对网络上交易持谨慎态度,特别是它很重要的话。

Moreover, smart contracts can only use digital assets, which can be problematic when connecting real assets to the digital world. Finally, and most importantly, smart contracts lack legal regulation and are subject only to code-negotiated obligations.

使用智能合约的优点是处理交易时效率更高,不可逆转,安全的交易以及全自动化流程。另外一个方面,缺点就是缺乏法律监管,人为的错误和实施有困难。

The advantage of using smart contracts is that they are more efficient, irreversible, secure, and fully automated. On the other hand, the disadvantage is the lack of legal regulation and the difficulty of human error and enforcement.

智能合约已在各种区块链网络中得以实施,其中最重要和最受欢迎的依然是比特币和以太坊。虽然比特币网络以使用比特币执行交易闻名,它的协议也可以用来创建智能合约。比特币实际上提供的是一种编程语言,允许创建自定义智能合约,比如支付通道。

Smart contracts have been implemented in a variety of block-chain networks, the most important and popular of which are Bitcoin and Etheria. Although the Bitcoin network is known for trading with bitcoin, its agreements can also be used to create smart contracts. Bitcoins actually provide a programming language that allows for the creation of custom smart contracts, such as payment channels.

以太坊则是目前为止最引人注目的智能合约框架,因为它是专门为支持智能合约的使用创建的。用Solidity语言编程,以太坊智能合约框架有助于促进去中心化网络,便于用智能合约处理交易。

Ether is the most visible intellectual contract framework to date, as it was created specifically to support the use of smart contracts.

除了加密货币之外,在不同行业的也有用户场景,例如选举、供应链优化、电子商务中可有效利用智能合约。

In addition to encrypted currency, there are user scenes in different industries, such as elections, optimized supply chains, and efficient use of smart contracts in e-commerce.

因此,加密爱好者看到了最近智能合约的发展,它与区块链技术携手合作,致力于改变数字化世界。

As a result, cryptographers have seen recent developments in smart contracts, working with block chain technology to change the digital world.

智能合约可以用比特币和以太坊创建。各行各业可以从智能合约发展中受益,包括选举、供应链和电子商务等。

Smart contracts can be created in Bitcoin and Etheria. Industries can benefit from intelligent contract development, including elections, supply chains, and e-commerce.

智能合约真的智能吗?它让区块链网络上执行的交易效率更高,同时,由于它是无法修改的,也由此要谨慎查看协议。

A smart contract is really smart. It makes transactions executed on a block chain network more efficient, and, as it cannot be modified, it allows for careful viewing of protocols.

无论你如何看待智能合约,越来越多的项目正在寻找驾驭它的方法,它们很多是从以太坊智能合约开始的。随着对智能合约的研究不断推进,可以关注它取得的进展,但最重要的是,不要忘记智能合约在执行交易方面的重要性,交易在区块链网络上是安全的、无须信任和分布式的。

Regardless of how you look at smart contracts, a growing number of projects are looking for ways to manage them, many of them starting with the Etherton smart contracts. As research on smart contracts progresses, attention can be paid to its progress, but above all, not to forget the importance of smart contracts in carrying out transactions that are secure, untrustworthy and distributed in the network of block chains.

——

风险警示:蓝狐笔记所有文章都不构成投资推荐,投资有风险,投资应该考虑个人风险承受能力,建议对项目进行深入考察,慎重做好自己的投资决策。

Risk Alert: All Blue Fox notes do not constitute investment recommendations, they are risky, they should take into account individual risk tolerance, and it is recommended that projects be thoroughly examined and their investment decisions carefully taken.

 

原文作者:CoinBundle Team

Image by Flickr user CoinBundle Team.

原文地址:medium.com

Original address: medium.com

译者:由蓝狐笔记社群“Leo”翻译

This post is part of our special coverage Human Rights Watch.

本文由 @蓝狐笔记社群“Leo” 翻译发布于人人都是产品经理。未经许可,禁止转载。

This post is published by the @Blue Fox Notebook community “Leo” as a product manager for everyone.

题图来自 Pixabay,基于 CC0 协议

The title is from Pixabay, based on the CC0 protocol.

美化布局示例

欧易(OKX)最新版本

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

APP下载   全球官网 大陆官网

币安(Binance)最新版本

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

APP下载   官网地址

火币HTX最新版本

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

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

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

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

分享:

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

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

欧易(OKX)

  全球官网 大陆官网

币安(Binance)

  官网

火币(HTX)

  官网

Gate.io

  官网

Bitget

  官网

deepcoin

  官网
热门文章
  • 支付領域投下震撼彈!美國數位銀行Chime疑與GuardPay 神盾支付合作!

    支付領域投下震撼彈!美國數位銀行Chime疑與GuardPay 神盾支付合作!
    2020年,新冠肺炎(COVID-19)疫情加速數位貨幣進展。例如:2019年4月,國際清算銀行(BIS)的調查顯示,在全球66家中央銀行中,沒有一家計畫發行跨境支付的數位貨幣。惟到了2020年10月,BIS支付委員會主席康利夫(Jon Cunliffe)指出,肺炎疫情拉高民眾對無現金支付的需求,迫使各國加快數位貨幣的研發進程日本與韓國於2021年進入數位貨幣試驗階段。直到2019年12月,美國聯邦準備理事會(Fed)都尚無數位貨幣規劃,惟到了2020年2月,Fed已開始研擬...
  • 区块链:交易系统开发指南

    区块链:交易系统开发指南
    播报编辑《区块链:交易系统开发指南》使用通俗易懂的语言,从技术的角度详细介绍了区块链交易系统应有的功能架构及工作原理,让人们能够张开双臂轻松地拥抱区块链技术,享受区块链交易系统带来的惊喜与成就感。《区块链:交易系统开发指南》共分 7 章,第 1~2 章主要介绍区块链及数字货币的基本概念,以及各种公有链的 API 接口;第3~5 章主要介绍区块链交易系统的分类架构及功能; 6 章主要介绍区块链交易系统面临的问题及演进方向;第 7 章对全书做了总结。《区块链:交易系统开发指南》是...
  • 5.14加密货币价格:BTC突破6.2万美元以太坊和山寨币反映市场情绪

    5.14加密货币价格:BTC突破6.2万美元以太坊和山寨币反映市场情绪
    今天,随着比特币(BTC)的价格突破62 000美元的门槛,顶级加密货币的价格反弹了。 此外,以铁大幅上涨,维持在2 900美元的水平。 此外,其他顶尖山硬币,如索拉纳(SOL )、XRP、卡达诺(ADA )也大幅上涨。    今天密钥加密货币价格 1. 比特币价格    在5月14日星期二撰写本文时,比特币价格上升了2.57%,达到62 487.50美元。 另一方面,在过去24小时内,交易量从65.26 % 急剧上升至277亿美元。 与此同时,加密货币的市场价值为...
  • OKEx回应用户质疑:合约交易非期货 平台无机器人

    OKEx回应用户质疑:合约交易非期货 平台无机器人
       热点点 自选股份 数据中心 数据中心 研究和资料中心 资金流动 模拟交易 客户客户 具体来说,OKEx回答用户的问题:合同交易不是期货,平台不是机器人。 金融同步化,3月22日。    昨天下午,OKEx公司就维护先前用户线下的权利问题对同步财务公司作出了回应,指出OKEx公司提供的合同交易不是期货交易,在旗下的业务中没有正式的机器人。 同时,OKEX称,它不会以非法为由对任何投资损失索赔作出答复。 答复全文如下: 同步你的财务! 近日来,...
  • 0.00006694个比特币等于多少人民币/美金

    0.00006694个比特币等于多少人民币/美金
    0.00006694比特币等于多少人民币?根据比特币对人民币的最新汇率,0.00006694比特币等于4.53424784美元/32.5436 16人民币。比特币(BTC)美元(USDT)人民币(CNY)0.000066944.53424784【比特币密码】32.82795436 16比特币对人民币的最新汇率为:490408.64 CNY(1比特币=490408.64人民币)(1美元=7.24人民币)(0.00006694USDT=0.0004846456 CNY)汇率更新时...
标签列表