Smart Contracts: Bitcoin Developer Jimmy Song Shares Blockchain Tech Insights
Smart contracts are one of the most important developments in the history of blockchain technology. However, they’re also one of the least-understood developments.
You might associate smart contracts with “blockchain 2.0” platforms. You might think of Ethereum when you hear people talk about smart contracts. But what exactly are smart contracts? How do they work? Why are they so innovative for the future of blockchain technology? Are they a passing fad? Or are they going to change the entire legal industry? Today, we’re explaining everything you need to know about smart contracts.
The Hype Behind Smart Contracts
First, let’s clear something up: people get really excited when they talk about smart contracts. There’s enormous hype surrounding smart contracts and their future – and this hype has been building since Ethereum first introduced smart contracts to the masses in 2015. Some of the promises made by smart contract supporters include:
- Smart contracts can enforce a contract (a legally-binding agreement) in an automatic, trustless, and impartial way
- Smart contracts take out the middlemen; they remove the need for a trusted third party to construct the contract, execute the terms of the contract, and enforce the contract
- Smart contracts, by the implications above, have the potential to remove lawyers and revolutionize the modern legal system
Is any of this hype true? Are smart contracts really going to make the legal profession disappear? Or are people getting a little too excited about smart contracts? Keep reading to discover if and why smart contracts are a big deal.
What Is A Smart Contract?
A smart contract is basically a contract – a legally-binding agreement between two parties – executed by computer code. It’s “smart” because it has all of the features of a normal paper-based contract, but it’s backed by computer code.
An ordinary contract is an agreement between two or more parties. This agreement binds the parties to something in the future. You might sign a contract with your employer, for example. That contract might stipulate that your employer will pay you $50,000 for one year of work.
A smart contract works in a similar way, but the conditions are evaluated and executed by computer code. This makes a smart contract “trustless”. You might sign a smart contract with your employer. That smart contract requires your employer to pay you $50,000 for one year of work. The code of the smart contract verifies the terms and conditions. The code of the smart contract might check whether $50,000 has appeared in your bank account by the end of the year, for example, or if you have provided the requisite work to your employer.
The most important and valuable feature of a smart contract is trustless execution. Trustless execution means you don’t need to rely on a third party to execute various conditions. You don’t need to rely on the other party to make good on their work. You don’t need to talk to lawyers or interact with the legal system to enforce the terms of the contract. The smart contract will execute the terms and conditions of the contract in a timely and objective way without the added costs or friction of a middleman.
Why Are They Called “Smart” Contracts?
There isn’t a specific reason why a smart contract is called a smart contract.
Some people might point to the fact that smart contracts use computer code to enforce the terms and conditions, thus making them smarter than an ordinary contract.
However, bitcoin developer Jimmy Song came up with a better explanation in a recent Medium post.
“The use of the word “smart” implies that these contracts have some innate intelligence. They don’t. The smart part of the contract is in not needing the other party’s cooperation to execute the agreement. Instead of having to kick out the renters that aren’t paying, a “smart” contract would lock the non-paying renters out of their apartment. The execution of the agreed-to consequences are what make smart contracts powerful, not in the contracts innate intelligence.”
Based on that, Song describes smart contracts as “pretty dumb”. These contracts have no innate intelligence: it’s their ability to execute agreed-upon consequences that makes them smart.
Smart contracts aren’t as smart as they could be. A truly smart contract, for example, would look at all the terms and conditions of a contract and then compare it to all of the circumstances and factors surrounding the contract. Based on all of this information, a truly smart contract would synthesize the optimal response.
Regardless of how you feel about the word “smart”, there’s no question that smart contracts have significant advantages over traditional contracts.
Smart Contracts Date Back To 1995
You’d be forgiven for thinking that smart contracts emerged with Ethereum in 2015. When many people think of smart contracts, they think of Ethereum. Ethereum is one of the best-known names in the crypto space, and they’ve built their reputation on the power of smart contracts.
Many people are surprised to learn, however, that smart contracts exist in bitcoin. Bitcoin, since its beginning in 2009, has had an extensive smart contract language called Script.
In fact, smart contracts pre-date bitcoin. Smart contracts date as far back as 1994, which is when computer scientist and cryptographer Nick Szabo coined the term. Szabo ended up creating one of the world’s first cryptographically-secured digital currencies by designing Bit Gold in 1998. Bit Gold was seen as the most promising precursor to bitcoin – although the project was never officially launched.
Despite all of these early versions of smart contracts, Ethereum is known for making smart contracts more accessible and powerful than ever before.
What Makes Ethereum’s Smart Contracts Special?
Bitcoin has a smart contract language. Ethereum also has a smart contract language. What makes Ethereum’s smart contract language so successful? Why do we build smart contracts on Ethereum and not bitcoin?
The reason is simple: Ethereum has a Turing-complete smart contract language.
Ethereum’s smart contract language is called Solidity. Solidity allows developers to build more complicated smart contracts. These smart contracts are more sophisticated, but they’re also more difficult to analyze.
Complex smart contracts have their advantages. They can be used to enforce more advanced terms and conditions. However, complex contracts are also more difficult to secure. Even in the “real world”, complicated contracts are more difficult to enforce. As more terms and stipulations get added, there’s an increased possibility for misinterpretation.
That’s why a well-designed smart contract will handle every possible way a contract could get executed. A smart contract that successfully handles every possible outcome is seen as the most secure smart contract. This smart contract will do what its authors intended it to do.
Why Are Smart Contracts So Difficult To Build?
Smart contracts aren’t easy to program. Ethereum’s Solidity is a Turing-complete smart contract programming language. Execution in a Turing-complete context can be tricky.
The first and biggest problem with securing a Turing-complete smart contract is the fact that you essentially need to prove that a computer program has no bugs. Since nearly every computer program in existence has bugs, this can be one of the most time-consuming parts of smart contract development – particularly for complex contracts.
Remember that writing a normal contract – a legally-binding agreement between parties – takes years of law school and a very hard bar exam. Lawyers also need to “secure” contracts by analyzing the wording to eliminate any ambiguous wording or loopholes.
Writing a smart contract requires the same level of competence as writing an ordinary legal contract. Despite this required level of competence, many smart contract developers have a limited concept of how contracts should work – and this is leading to unsecure smart contracts across the cryptocurrency industry.
Bitcoin has come up with a solution to this problem: bitcoin removed Turing-completeness from the equation. This makes smart contracts easier to analyze because, as explained by Jimmy Song, “the possible states of the programs are easier to enumerate and examine.”
Ethereum, meanwhile, has its own solution: it places the burden on smart contract writers instead of the Ethereum network. It’s the responsibility of smart contract developers to ensure their contract does what it’s supposed to do.
The Dangers Of Unsecure Smart Contracts: The Story Of The DAO
Up above, we explained the importance of securing your smart contract. If you design a complex smart contract but don’t make sure the contract is bug-free, then the contract is useless as soon as someone discovers the exploit.
Is this really an issue on Ethereum? Absolutely! One of the best examples of the dangers of unsecure smart contracts was with The DAO – an infamous event in Ethereum history that split the community into two.
DAO stands for Decentralized Autonomous Organization. A fund called The DAO was created within the Ethereum platform as a way of showing the potential of the development environment.
The idea behind The DAO was simple: users would be able to deposit money into The DAO. Then, this pool of money would be democratically allocated. Users would be able to vote on where the money was spent and into which companies.
Users would get proportional returns based on the money they invested. Everything would be controlled by smart contracts – it was a “decentralized autonomous organization” that autonomously managed everyone’s money and investments in a decentralized way with no middleman required.
The DAO launched with enormous hype. Ethereum users believed they were creating the greatest investment vehicle in human history. Over the few weeks of The DAO’s ICO, the fund had raised $150 million in ETH (at the time, ETH was trading at around $20 apiece).
There was one big problem, unfortunately: the code of the smart contract wasn’t secure, and someone eventually took advantage.
A hacker spotted the exploit within The DAO’s smart contract – yes, the same smart contract holding $150 million in raised funds.
The hacker found a way to take money from the DAO’s smart contract in a way that the creators did not intend. Some people see the hacker as a malicious individual stealing the hard-earned money of investors. As bitcoin developer Jimmy Wong explains, however, it’s more accurate to view the hacker as like a creative accountant:
“Many called the person draining the DAO of money a “hacker”. In the sense that the “hacker” found a way to take money from the contract in a way not intended by the creators intended, this is true. But in a broader sense, this was not a hacker at all, just someone that was taking advantage of the quirks in the smart contract to their advantage. This isn’t very different than a creative CPA figuring out a tax loophole to save their clients money.”
What happened afterwards is that Ethereum’s community decided code wasn’t law. They rolled back the blockchain to a time before the hack took place. Other members of the community refused this approach and maintained that code on the Ethereum network was law. The former group forked to create Ethereum (ETH), while the latter group forked to create Ethereum Classic (ETC).
Today, the Ethereum Classic community preserves The DAO as written. Ethereum Classic is based on the idea that “code is law”.
Meanwhile, Ethereum is moving away from the Turing-completeness aspect of its smart contracts, choosing instead to use ERC20 and ERC721 as standard smart contract templates.
Both ERC20 and ERC721 smart contracts can be written without Turing-completeness. That’s why these are two of the top token standards available today. There are hundreds of ERC20 tokens in the top 1,000 cryptocurrencies by market cap.
Smart Contracts Require Digital Bearer Instruments To Be Successful
Smart contracts sound like a great idea. You can make a secure agreement between two parties without paying a lawyer or going to court. What’s not to like?
Well, smart contracts are far from perfect. One of the biggest problems with smart contracts is the need for digital bearer instruments.
Let’s say you’re using a smart contract for a real estate transaction. The first party, Megan, proves she owns the house. Derek sends money to Megan for the house and Derek receives the house in exchange. There’s no need to question ownership of the house. The contract executes the payment and the house transfer in a trustless and fast way without the need for centralized parties like lawyers, judges, or government agencies.
That all sounds good – but there are some major problems.
The first problem is that it’s hard to link physical objects with the digital world in a secure way. A smart contract might securely arrange the transfer of payment from Derek to Megan, and the blockchain-based proof of ownership might be transferred from Megan to Derek. But this proof of ownership is meaningless. It doesn’t give Derek access to the house. Derek might walk up to the house on the date of possession and find it’s locked or been demolished.
Some people call this the “Oracle problem”. It’s difficult to link a digital record with a physical version. When a digital item changes ownership, it’s hard for a physical item to change ownership simultaneously.
Some have suggested solving this problem using Oracles. An Oracle verifies a certain item is true. For example, after Derek pays Megan for the house, the Oracle might verify that Derek has received possession of the house. Once Derek has successfully gained access to the house, the Oracle will record that entry in the smart contract, and the smart contract will complete the payment.
The other problem is the theft of digital tokens. Let’s say that a government agency verifies that a token genuinely represents the house. Whoever holds the token legally owns the house. What happens if you lose your wallet or your token is stolen? Does the hacker now own your home? Do you have any legal recourse when you’re working in a trustless, decentralized environment?
Ultimately, an Oracle is just a simple version of a judge. The Oracle is viewed as an indisputable source of truth.
A better way to understand Oracles is by sports scores. There are sports betting websites, for example, that use smart contracts to secure bets. A bettor places money into a smart contract, and then gets paid based on the outcome of a future event – like a hockey game scheduled to take place later that night. The Oracle checks the score of the hockey game after the game is complete, then feeds that information back to the smart contract. The smart contract pays the bettor if the bet was successful or pays the bookmaker if the bet was unsuccessful.
With that in mind, Oracles are digital bearer instruments. Digital bearer instruments allow a smart contract to be truly trustless. Ownership of a token cannot depend on things outside of the smart contract platform. Otherwise, it deafest the point of the smart contract. By using bearer instruments like Oracles, we can push the possibilities of smart contracts even further.
Smart Contracts Conclusion
Smart contracts are among the most important innovations in the history of blockchain technology. They date all the way back to Nick Szabo’s research in the 1990s, and bitcoin has had a smart contract programming language since launching in 2009. Ethereum and other newer blockchain platforms, however, have taken smart contract development to the next level with features like Turing-completeness, ERC20 token standards, NEP-5 token standards (on Neo), and more.
Nobody knows what the future of smart contracts might hold – so stay tuned.