woaidafa888:What Are Smart Contracts?

作者/来源:  Harry Pokrandt / Datafloq    责任编辑: 闫文美 时间: 2018年07月05日

Before the invention of blockchain, whenever someone made a transaction, it required trust. Restaurants had to trust that diners would pay with non-counterfeit money, banks had to trust that a loan recipient would pay his mortgage, businesses had to trust that their contracts were legally binding and that both parties would deliver what they agreed to. The same is true for betting. If someone bets $20 on their favorite football team, when that team wins, they expect to receive winnings. Trust is also required in the realm of advertising.

When people do not uphold their end of a contract agreement, middlemen, such as lawyers, have to get involved. In the case of advertising, a third party, such as Google, holds the “trust,” verifying that everyone involved does what they’ve agreed to do. The third party also settles any disputes that may arise. In betting, the third party is generally the bookkeeper. In housing, it is the bank. The need for a middleman to ensure trust is costly, as anyone who has ever had to pay a lawyer can attest.

Today, in a world filled with decentralization and blockchain, “smart contracts” can be initiated without trust, eliminating the need for pricey middlemen.

What are smart contracts?

Imagine a world in which, if you don’t pay your bill at a restaurant, or if you pay with fake or stolen money, the meal you just ate never in fact happened and the restaurant’s kitchen is magically restocked. The restaurant owner doesn’t need to chase you or call the cops. It’s simply as if the exchange never occurred, and it’s undone automatically. This is similar to how smart contracts work.

A smart contract is a “computer protocol intended to digitally facilitate, verify, or enforce the negotiation or performance of a contract.” The term first came into existence in 1996 in Nick Szabo’s publication, “Smart Contracts: Building Blocks for Digital Free Markets.”

Often, multiple smart contracts work together regarding a single agreement to ensure and verify all aspects of the contract are completed. In many ways, they work similarly to traditional contracts, except they are automatic, do not require trust, and are cheaper, due to cutting out the middleman.

Which networks and projects use smart contracts?

There are countless networks and projects that utilize smart contracts, but some of the most notable fall within the realm of blockchain and digital currency. Some well-known blockchain projects that utilize smart contracts include:

l   Bitcoin

l   Ethereum

l   Ripple

l   Namecoin

Smart contracts have uses outside of digital currency, as well, especially in the legal realm. Some people have questioned whether smart contracts could rid the world of lawyers, and smart contracts are already recognized by law in some U.S. states, such as Tennessee.

What are smart contracts used for?

Smart contracts are frequently used for the exchange of digital currency. However, smart contracts are also being utilized to sell homes, track bets, play games, exchange services (such as advertising), and much more. For more information about the use cases of smart contracts, please read our article here.

How do smart contracts work?

Smart contracts usually work in unison to carry out a particular task, with each smart contract verifying and enforcing different aspects of a transaction.

Let’s use a bet about temperature as an example. You and your friend make a bet on the Ethereum network about the temperature of April 21, 2019. You each bet $5 in ETH. You both state your bet in a smart contract, which is set to complete execution at midnight on April 21.

Because neither of you will miss your $5, you decide to use a smart contract to keep your money in escrow, verifying that each of you actually have the cash you say you do. You bet that the temperature will be below 32 degrees. Your friend bets that it will be above 75 degrees. If neither of you are correct, the contract will return the money from escrow to both of you. However, if one of you is correct, it will transfer all $10 to the winner.

On April 21, the smart contract requests information from an oracle that exists off of the Ethereum network. In this case, the information is data from the National Weather Service. It verifies the day’s temperature, then completes your contract. On April 22, after a day of snow, you find $9.75 worth of ETH in your wallet. You won the bet, but you paid a small transaction fee for using the network.

Neither you nor your friend can argue about the weather. Your friend can’t decide that the bet was silly and opt to keep his money, because the contract is irreversible. Neither you nor your friend even need to remember that you made this bet, and will never quibble about it later, because the smart contract executes itself based on relevant data.

Article Author: 

CEO, Director

A cryptocurrency evangelist since 2013, Harry is the founding CEO at HIVE Blockchain Technologies (TSX.V: HIVE) and is responsible for the company’s overall vision. Harry has extensive contacts and experience in Canada’s capital markets. He served as Managing Director of Macquarie Capital Markets Canada Ltd. from 1985 to 2015 and as Managing Director of Espresso Capital from 2015 to 2017, investing in and advising startups in the technology and natural resources sectors.