最有看点的互联网金融门户

最有看点的互联网金融门户
区块链国际资讯

到底什么是智能合约?

最近,我问了我一个朋友他对“智能合约”的看法。他是一名开发者,我想他可能会有一些有趣的见解。令我惊讶的是,他并不知道智能合约是什么。我感到特别惊讶,因为我们讨论了一年多的加密货币、美国证券交易委员会(SEC)以及许多与区块链相关的其他事情。在计算机领域深耕的人怎么可能会不知道智能合约是什么?

事实上,相比区块链行业的其它概念,智能合约可能会更令加密货币爱好者们感到困惑。因此,要解释这个概念并不容易,尤其是向那些刚刚理解区块链是什么的人解释更不容易。因此,这一概念依旧十分神秘。希望这篇文章可以清楚地解释好这一概念。

什么是智能合约?

想象一下,如果你需要卖掉一栋房子,那么这将是一个复杂而艰巨的过程,不但需要处理大量的文书工作、与不同公司和人员进行沟通,而且还得冒着各类高风险。这就是为什么绝大多数房屋卖家决定寻找房地产经纪,来帮助处理所有文书工作、推销房产,并在协商开始时充当中介、监督交易直至交易结束。

此外,该经纪机构还提供委托付款服务,这在此类交易中尤其有用,因为此类交易所涉及的金额通常很大,你将无法完全信任将要与你进行交易的人。然而,在交易成功完成之后,卖方和买方的经纪机构将获得房产卖出价格的7%作为佣金。这对卖方来说是相当大的经济损失。

在这种情况下,智能合约就可以真正派上用场,可以有效地变革整个行业,同时也减少了所需流程。或许最重要的是,智能合约能解决信任问题。智能合约基于“If-Then”(“如果-那么”)原则,这意味着只有商定的金额被发送到系统时,房屋的所有权才会被转移给买方。

智能合约也可以作为委托付款服务,这意味着资金和所有权都将被存储在系统中,并在同一时间被分发给各参与方。此外,该交易被数百人见证和验证,因此保证了交付是无差错的。由于双方之间不再存在信任问题,因此也不再需要中介。所有房地产经纪能做的都可以预先编程为智能合约,这同时也为卖方和买方节省了大量资金。

这只是智能合约潜在用途的一个例子。智能合约能够帮助货币、财产和其他任何有价值的东西的交易,确保交易过程完全透明,其不但无需中介服务及其附带费用,还消除了双方之间的信任问题。特定智能合约的代码包括了各方商定的所有条款和条件,有关交易本身的信息则被记录在区块链中,即去中心化的分布式公共账本。

智能合约是如何运作的?

简而言之,智能合约很像自动售货机。你只需将所需数量的加密货币放入智能合约中,而你所交易的,房屋所有权等就会自动存入你的账户。所有的规则和处罚不仅在智能合约预先定义了,而且也由智能合约强制执行。

相互依存

智能合约可以独立运行,但也可以与任何其他智能合约一起运行。当它们彼此依赖时,它们可以以某种方式被设置。例如,成功完成一个特定的智能合约可以触发另一个智能合约的启动,依此类推。从理论上讲,整个系统和组织完全可以依靠智能合约运行。某种程度上,这已经在各种加密货币系统中实现了,在这些系统中,所有的规则都是预先定义好的,因此,网络本身可以独立自主地运行。

智能合约的对象

从本质上讲,每个智能合约都有三个不可或缺的部分(也称为对象)。第一个对象是签署方(两方或多方使用智能合约,同意或不同意使用数字签名的协议条款)。

第二个对象是合约的主题。它只能是智能合约环境中存在的对象。或者,智能合约必须可以不受阻碍地直接访问该对象。尽管智能合约早在1996年就被讨论过,但正是这一特定对象阻碍了智能合约的发展。这个问题直到2009年出现第一个加密货币后才得到部分解决。

最后,任何智能合约都必须包含特定条款。这些条款都需要使用数学方法及适用于特定智能合约环境的编程语言进行完整描述。这些条款包括了所有参与方的预期要求以及与所述条款相关的所有规则、奖励与惩罚。

环境

为了使智能合约能够正常运行,智能合约必须在特定的合适环境中运行。首先,智能合约环境需要支持公钥加密,这使得用户能够使用其独特的、专门生成的加密代码来签署交易。这正是绝大多数现有加密货币所用的系统。

其次,它们需要一个开源和去中心化的数据库,合同各方都可以彼此完全信任,并且履约流程完全自动化。此外,为了实现智能合约,整个环境必须自身是去中心化的。区块链,尤其是以太坊区块链,是运行智能合约的理想环境。

最后,智能合约所使用的数据,来源必须完全可靠。这就需要使用根SSL安全证书、HTTPS和其他已经广泛被使用并在大多数现代软件上自动实现的安全连接协议。

智能合约带来了什么?

自治——智能合约消除了对第三方中介的需求,基本上使你能够完全控制合约。

信任——任何人都无法窃取或弄丢你的文件,因为它们已被加密并安全地存储在一个安全的公开账本中。此外,你不必信任你正与之交易的人,也不必指望他们会信任你,因为公正的智能合约系统基本上解决了信任问题。

节约——由于使用了智能合约,你就不需要公证人、房地产经纪人、顾问及其他众多中介机构的援助。这样也就与他们的服务相关的高额费用无关了。

安全——如果智能合约正确执行,它将是极难破解的。此外,智能合约的完美环境受到复杂的加密保护,它可确保你文档的安全。

高效——通过使用智能合约,你将节省通常浪费在手动处理大量纸质文档并将其发送或运送到特定地点等的大量时间。

谁发明了智能合约?谁在使用智能合约?

1996年,计算机科学家和密码学家Nick Szabo首次提出了智能合约。几年后,Szabo重新定义了这一概念并发布了几篇相关文章,他阐述了通过在互联网上陌生人之间设计的电子商务协议来建立合同法相关商业实践的概念。

然而,智能合约的概念直到2009年才被实现,当时第一个加密货币比特币连同它的区块链一齐出现,后者则最终为智能合约提供了合适的环境。有趣的是,Nick Szabo在1998年设计了一种称为比特黄金(Bit Gold)的去中心化数字货币。虽然它没有被实现,但它已经具备了10年后比特币可吹嘘的许多功能。

如今,智能合约主要与加密货币有关。而且,可以公平地说,它们彼此互相依赖,因为去中心化的加密货币协议本质上是具有去中心化安全性的加密智能合约。智能合约现在被广泛应用于大多数加密货币网络中,并且其也是以太坊最杰出和最被大肆宣传的特点之一。

智能合约用例

虽然世界各国政府、金融监管机构和银行对加密货币的立场从极其谨慎变成谨慎接受,但加密货币背后的技术,区块链和智能合约,已被广泛认为是具有革命性的,并且正在各个层面实现这些技术。

例如,美国信托与清算公司(DTCC)和四大银行(美银美林、花旗、瑞士信贷和摩根大通)成功地使用Axoni开发的智能合约交易区块链信用违约掉期。智能合约使用了诸如个人交易详情及相应风险指标之类的信息,据一篇新闻稿称,这提高了合作伙伴和监管机构信息处理上的透明度。

类似的事情到处都在发生。由61家日本银行和韩国银行组成的财团一直在测试Ripple的区块链和智能合约,以实现两国之间的跨境资金转移。这一新系统将于今年推出。就连俄罗斯政府控制的俄罗斯联邦储蓄银行(Sberbank),都在俄罗斯这样一个众所周知的反加密货币国家测试以太坊区块链及其智能合约。

测试结果是俄罗斯联邦储蓄银行加入了以太坊企业联盟(EEA),这是一个由100多家企业组成的联盟,其中包括了思科、英国石油、荷兰国际集团(ING)、微软等顶级企业。该联盟旨在开发一种面向商业用途的区块链,用它可以开发和实现这些公司所需的智能合约。

由于智能合约是与加密货币相关联的,因此它们仍主要被应用到金融领域和银行业。尽管如此,世界各国政府都可以使用这项技术,使得投票系统更加便利而透明。供应链可以使用它来监控货物并自动执行所涉及的所有任务和支付。房地产、医疗保健、税收、保险及其他众多行业都可以受益于智能合约的使用。

智能合约的缺点

智能合约仍是一项未成熟的技术,仍然容易出现问题。例如,构成合约的代码必须是完美无漏洞的。它也会出现错误,有时候,这些错误会被欺诈者所利用。就像DAO被黑事件一样,把资金存放在代码有漏洞的智能合约中资金就可能被盗走。

此外,这项新奇的技术也带来了很多问题。政府将如何决定监管此类合约?他们将如何进行征税?如果合约无法访问其主题,或者发生了任何意外情况,将会是什么情况?这是在传统合约签订时可能发生的,传统合同可以在法庭上被撤销,但区块链要求智能合约无论如何都要按照“代码即法律”的规则去执行。

然而,大多数这些问题的存在纯粹是因为智能合约仍未是一项成熟的技术。但这项技术肯定会随着时间的推移而逐渐完善。毫无疑问,智能合约将会成为我们社会不可或缺的一部分。

What are smart contracts for?

Imagine that you need to sell a house. It’s a rather complicated and daunting process which entails a lot of paperwork, communication with different firms and people as well as a high levels of various risks. That’s why the absolute majority of house sellers decide to find an estate agent, who deals with all the paperwork, markets the property and acts as an intermediary when the negotiations begin, overseeing the deal until it’s closed.

Moreover, the agency provides an escrow service, which is especially useful in such transactions, as the sums involved are normally quite big and you can’t really fully trust the person you will be dealing with. Nevertheless, after the successful deal, the seller’s and the buyer’s agents will share around seven percent of the sale price as their commission. This amounts to quite a substantial financial loss for the seller.

It’s situations like this where smart contracts could really come in handy and effectively revolutionize an entire industry, all the while making the process a lot less of a burden. Perhaps most importantly, they would solve a trust issue. Smart contracts work on an ‘If-Then’ principle, which means that the ownership of the house will be passed on to the buyer only when the agreed upon amount of money is sent to the system.

They also work as escrow services, meaning that both the money and the ownership right will be stored in the system and distributed to the participating parties at exactly the same time. Moreover, the transaction is witnessed and verified by hundreds of people, so the faultless delivery is guaranteed. As trust between the parties is no longer an issue, there is no need for an intermediary. All the functions that an estate agent does can be pre-programmed into a smart contract, while simultaneously saving both the seller and the buyer considerable amounts of money.

And this is just one example of potential uses of smart contracts. They are capable of facilitating an exchange of money, property and anything else of value, ensuring the complete transparency, avoiding the services and accompanying charges of a middleman and eradicating the question of trust between the parties. The code of a particular smart contract includes all the terms and conditions agreed upon by the parties, and the information about the transaction itself is recorded in a Blockchain, a decentralized, distributed public ledger.

How do smart contracts work

Simply put, smart contracts work a lot like vending machines. You just drop a required amount of a cryptocurrency into the smart contract, and your escrow, house ownership right, driver’s license, or whatever else drops into your account. All the rules and penalties are not only pre-defined by smart contracts but are also enforced by them.

Interdependence

A smart contract can work on its own, but it can also be implemented along with any number of other smart contracts. They can be set up in a way when they’ll be dependant on one another. For example, successful completion of one particular smart contract can trigger the start of another one, and so on. In theory, whole systems and organizations can run entirely on smart contracts. To some extent, this is already implemented in various cryptocurrency systems, where all the laws are pre-defined and because of that, the network itself can function autonomously and independently.

Objects of smart contracts

Essentially, there are three integral parts, also referred to as objects, to every smart contract. The first one is signatories, the two or more parties using the smart contract, agreeing or disagreeing with the terms of the agreement using digital signatures.

The second object is the subject of the agreement. This can only be an object that exists within the smart contract’s environment. Alternatively, the smart contracts have to have unhindered and direct access to the object. Even though the smart contracts were first discussed back in 1996, it was this particular object that stalled their development. This problem was partially solved only after the first cryptocurrency appeared in 2009.

Finally, any smart contract has to include specific terms. Those terms need to be mathematically described in full and using a programming language that is appropriate for the particular smart contract’s environment. This includes the requirements expected from all the participating parties as well as all the rules, rewards and punishments associated with said terms.

Environment

In order for them to exist and function properly, smart contracts have to operate within a specific suitable environment. First of all, the environment needs to support the use of public-key cryptography, which enables users to sign off for the transaction using their unique, specially generated cryptographic codes. This is the exact system that the absolute majority of currently existing cryptocurrencies is using.

Secondly, they require an open and decentralized database, which all parties of the contract can fully trust and which are fully automated. Moreover, the entire environment itself has to be decentralized for the smart contract to be implemented. Blockchains, especially the Ethereum Blockchain, are the perfect environments for smart contracts.

Finally, the source of digital data used by the smart contract has to be completely reliable. This entails the use of root SSL security certificates, HTTPS, and other secure-connection protocols that are already being widely used and are being implemented automatically on most modern-day software.

Smart contracts give you:

Autonomy — Smart contracts eradicate the need for a third-party intermediary of facilitator, essentially giving you full control of the agreement.

Trust — No one can steal or lose any of your documents, as they are encrypted and safely stored on a secured, shared ledger. Moreover, you don’t have to trust people you’re dealing with or expect them to trust you, as the unbiased system of smart contracts essentially replaces trust.

Savings — Notaries, estate agents, advisors, assistance and many other intermediaries are not needed thanks to smart contracts. And, by extension, the extortionate fees associated with their services.

Safety — If implemented correctly, smart contracts are extremely difficult to hack. Moreover, perfect environments for smart contracts are protected with complex cryptography, which will keep your documents safe.

Efficiency — With smart contracts you will be saving a lot of time, normally wasted on manually processing heaps of paper documents, sending or transporting them to specific places, etc.

Who created and who uses them

Smart contracts were first described by Nick Szabo, a computer scientist and cryptographer, in 1996. Over the course of several years, Szabo reworked the concept and released several publications, where he described the concept of establishing contract law related business practices through the design of electronic commerce protocols between strangers on the Internet.

However, the implementation of smart contracts didn’t happen until 2009, when the first cryptocurrency Bitcoin appeared along with its Blockchain, which finally provided a suitable environment for smart contracts. Interestingly enough, Nick Szabo designed a mechanism for a decentralized digital currency called Bit Gold in 1998. It was never implemented, but it already had many of the features that Bitcoin boasted about 10 years later.

These days, smart contracts are mainly associated with cryptocurrencies. Moreover, it is fair to say that one could not exist without the other, and vice versa, as decentralized cryptocurrency protocols are essentially smart contracts with decentralized security and encryption. They are widely used in most of the currently existing cryptocurrency networks and are the prominent and one of the most hyped features of Ethereum.

Examples of using smart contracts

While the stance of governments, financial regulators and banks worldwide on cryptocurrencies has been ranging from extremely cautious to carefully accepting, the technology behind them - Blockchain and smart contracts - has been widely accepted as revolutionary and it is being implemented across all levels.

For example, just recently, the Depository Trust and Clearing Corporation (DTCC) and four major banks - Bank of America Merrill Lynch, Citi, Credit Suisse and J.P. Morgan - successfully traded credit default swaps on the Blockchain developed by Axoni, using smart contracts. The smart contract used held information such as individual trade details and counterparts risk metrics, which, according to a press release, provided a new level of transparency for partners and regulators.

Similar things are happening everywhere. This month, a consortium of 61 Japanese and South Korean banks has been testing Ripple’s Blockchain and smart contracts to enable cross-border money transfers between the two nations. The new system will roll-out in 2018. Even Sberbank, a Russian government-controlled bank, in a country which has been notoriously anti-cryptocurrency, the Ethereum’s Blockchain and the smart contracts enabled by it are being tested.

The tests came in light of Sberbank joining the Enterprise Ethereum Alliance, a consortium of more than 100 businesses, including top players such as Cisco, BP, ING, Microsoft and so on. The Alliance aims to develop a Blockchain fine-tuned for business-use, where smart contracts needed for particular companies can be developed and implemented.

As smart contracts were developed in association with cryptocurrencies, they are still mostly being implemented into the world of finance and banking. Nevertheless, this technology can be used by governments worldwide to make the voting system more accessible and transparent.  Supply chains can use it to both monitor the goods and automate all the tasks and payments involved. Real estate, healthcare, taxes, insurance and countless other industries can benefit from the implementation of smart contracts and the benefits they have to offer.

Cons

Smart contracts are an extremely young technology. Despite having a lot of promise, it is still can be prone to problems. For instance, the code that makes up the contract has to be perfect and contain no bugs. This can lead to mistakes and, sometimes, to such bugs being exploited by scammers. As was the case with The DAO hack, money put into a smart account with a mistake in its code can be stolen from it.

Moreover, the novelty of the technology still bring a lot of questions to the table. How will the government decide to regulate such contracts? How will they be taxed? What happens if the contract can’t get access to the subject of the agreement, or anything unexpected happens to it? It this was to happen when a traditional contract was made, it could be rescinded in court, but the Blockchain makes the contract perform no matter what, in accordance with the ‘Code is Law’ policy.

Nevertheless, most of these problems exist purely because of how young smart contracts are as a technology. With such promise, the technology will surely be perfected over time. Undoubtedly, smart contracts are about to become the integral part of our society.

用微信扫描可以分享至好友和朋友圈

扫描二维码或搜索微信号“iweiyangx”
关注未央网官方微信公众号,获取互联网金融领域前沿资讯。

发表评论

发表评论

您的评论提交后会进行审核,审核通过的留言会展示在下方留言区域,请耐心等待。

评论

您的个人信息不会被公开,请放心填写! 标记为的是必填项

取消

英国法律委员会正在将智能合约的使用编入英国法律

David Hund... 07-30

安盛:以太坊智能合约助力航空延误险自动理赔

Trustnodes | 巴比特资讯 06-19

版权所有 © 清华大学五道口金融学院互联网金融实验室 | 京ICP备17044750号-1