Part 4: Smart Contracts
“A smart contract is a set of promises, specified in digital form, including protocols within which the parties perform on these promises.” - Nick Szabo
The concept of Smart Contracts was coined by cryptographer Nick Szabo in 1994, when he realized that distributed systems such as Blockchains could execute digital contracts between complete strangers in an automated way. A smart contract is somewhat similar to a traditional contract, where two willing parties agree upon specified terms either in verbal or written form. The difference with a smart contract is that it is a self-executing computer protocol that makes the exchange of value more transparent and safer (i.e. assets, property, anything involving contractual agreement) while removing the need of a middleman.
The smart contract processes the code and determines whether or not the two willing parties will receive whatever they are exchanging, based on the input they’ve provided. Smart contracts are unique in that they enforce rules and penalties that were written within the code. This is intended to prevent anyone from altering the agreement for selfish gain.
Why on a Blockchain?
Blockchains are known for being an efficient method for securing data of any kind, since their networks are distributed across computers (miners) all over the world. This provides smart contracts with an additional layer of security since each computer carries a copy of the blockchain, making the records (smart contracts) fully permanent and very difficult to alter. The open ledger reveals the execution of the contract, while keeping both parties’ identities anonymous.
Example
Say Jim wants to rent out Susan's apartment. Jim contacts Susan to ask if her apartment is still available. She says, “Yes, it is!” and then draws up a smart contract (lease) with the conditions that Jim has to meet on a monthly basis. He agrees to these conditions so they both sign and finalize the agreement. The smart contract then proceeds to transfer the digital key to Jim, and the first months rent along with the security deposit to Susan. The conditions of the agreement (rent due monthly on the first, for example) are finalized onto the blockchain, meaning neither Jim nor Susan can alter what was agreed upon in that contract, since a copy of the immutable record exists across thousands of computers all over the globe.
Similar to a recurring monthly payment plan, Jim’s debit card is written into the contract as the payment source, and the contract is programmed to charge it on the last day of every month. Now, let’s say the lease began on January 1st, it is now January 31st, and rent is due. If Jim fails to meet the conditions of the contract (his card is declined), the smart lease could automatically apply a late fee, say 5% after 3 days of the missed payment. This would be programmed in to give Jim enough time to recharge his debit card. Because this agreement, including the payment processing, would be entirely recorded, in an unalterable way, on a public ledger, there would be no possibility of any contract dispute. Can you imagine ending all such landlord-tenant disputes prior to their occurrence?
Conclusion
Most cryptocurrency projects built on top of a blockchain have a degree of smart contract technology in them, since they are coded to serve an autonomous function. Implementations of smart contracts can be found in projects such as Bitcoin or Ethereum. Some implementations work well while others can be disastrous such as the DAO hack that drained $50 million in Ethereum back in July, 2016. While Smart Contract technology still has a long way to go, it should be interesting to see how the technology evolves over the coming years.
Waves set to release their smart contracts any day now