What is a Smart Contract? - Crush Crypto

What is a Smart Contract?

Overview

Before defining a smart contract, it’s important to cover the basics of blockchain technology. First implemented in 2009 with the release of Bitcoin, a blockchain is a virtual ledger of data that functions as a distributed network.

Computers across the globe called nodes store and update the ledger by reaching a consensus with all other nodes, meaning the data on the ledger is secured without needing third party verification.

The Bitcoin blockchain is used as a ledger containing all wallet balances and transactional data, keeping records that are secure and immutable – effectively impossible to change once they exist.

In the simplest terms, a smart contract is a piece of code stored on the blockchain that reads and writes data and is triggered by blockchain transactions.

Like a bitcoin transaction, the code for a smart contract is immutable once it’s on the blockchain and can never be altered by a third party. The code will run exactly as programmed, forever (if the blockchain it’s on still exists), which is a benefit and a weakness.

One example of a smart contract is a program that receives an asset from Person A, waits for a condition, then automatically decides if the asset should be sent to person B or refunded to person A. This specific case could be used for betting or online payments as an automated escrow service.

Smart contracts can be used to create decentralized applications (DApps) with a front end that allows users to interact with the smart contract directly from their wallet. The introduction of web3, a collection of JavaScript libraries allowing for the connection to blockchain nodes, has made DApp development easier and more widespread. 


History

Nick Szabo, a scholar and cryptographer, realized that a decentralized ledger could be used for self-executing, digital contracts. He announced his discovery in a 1994 paper called Smart Contracts, where he outlines his idea, digital cash protocols, and economic incentives.

Then, in 1996, he released another, more detailed piece called Smart Contracts: Building Blocks for Digital Markets. Szabo discusses traditional societal contracts, contracts embedded in the world, attack vectors, contract design, cryptographic building blocks, smart property, and more.

He defines a smart contract as “A set of promises, specified in digital form, including protocols within which the parties perform on these promises.”

He also mentions the objective of smart contract design is “to satisfy common contractual conditions (such as payment terms, liens, confidentiality, and even enforcement), minimize exceptions both malicious and accidental, and minimize the need for trusted intermediaries.”

Szabo’s discovery of smart contracts was ahead of its time, as it could not be successfully implemented until the invention of a secure distributed ledger technology. The invention of blockchain was the first step towards smart contract development, while the release of Ethereum 6 years later is what popularized the idea.


Benefits

  • Immutability: The code of a smart contract is going to run exactly as programmed for as long as the blockchain is running. This is a benefit because people can now create truly censorship resistant, decentralized applications with no possibility of server downtime. 
  • Autonomy: Once certain conditions are met for a smart contract; its programmed functions will automatically execute. User input is not required, and data or assets can be automatically transferred or withheld.
  • Open source: By nature of the blockchain, the code of all smart contracts is open source and available for anyone see. The transparency allows for community-based auditing and makes it difficult for anyone to hide malicious code in an application. It also fosters a community of open source developers who share ideas and educate each other to promote quicker growth of the ecosystem.
  • Disintermediation: Smart contracts can remove a middleman from transactions in numerous industries. For example, instead of paying a realtor to transfer the money and title of property between two people, a smart contract could receive a payment and automatically transfer the title to the new owner.

Weaknesses

  • Immutability: Immutability is listed a benefit and a weakness of smart contract because humans are far from perfect, and there is always potential for code to have errors. If a smart contract with a bug is deployed to the blockchain, it can never be fixed – unlike traditional programs. Since smart contracts often deal with assets, one error can cost millions of dollars. The DAO hack occurred because of an Ethereum smart contract bug, and over $50 million worth of Ether was stolen.
  • Legal issues: Considering smart contracts are a relatively new technology, there is no legal precedent for what they represent or how to handle issues. Questions arise such as: Should smart contracts be legally binding? Who is responsible if a bug results in stolen or lost funds? Can smart contracts be used for government affairs? These questions, among others, will hopefully be answered soon, but the foreseeable future is uncertain.
  • Costs: Storing data on the blockchain is expensive. Every computational task is run by each node on the network and requires data on the blockchain, meaning the costs can pile up quickly for a smart contract. Technologies such as IPFS are being developed to address this, but in the current state it is still a serious issue. For further reading on costs of Ethereum smart contracts, check here.

Potential Use Cases

There are lots of different uses for smart contract or programmable money that sets out the rules for payout. We are still at the early development stage for smart contracts or decentralized applications, so it is likely that the use cases that will eventually generate traction is still not yet discovered.

  • Digital ID – Personal records on the blockchain, permitting individuals to decide what data to disclose, reducing identity theft, providing seamless KYC policies, optimizing travel and immigration, global citizenship.
  • Voting – Election systems, liquid democracy, fraud reduction, optimizing vote counting, 
  • Supply chains – Reducing friction, efficient data sharing, chain of custody, automated work flows, reducing paper work and environmental impact.
  • Healthcare – Transferring and encrypting sensitive documents, monetizing personal health data, reducing friction between healthcare providers.
  • Real estate – Transferring titles, tokenized real estate and partial ownership, mortgages.
  • Ticketing – Reducing ticket fraud, third party trading, removing ticket provider companies.
  • Music/art licensing – Allowing for digital ownership of work, remove middleman (e.g. record labels) to give more profit to the artist, fractional ownership of expensive art, verifiable ownership.

*Note: These are examples of how smart contract could be used, not every method has been tested yet.


Smart Contract Platforms

Although Bitcoin has the potential to support smart contracts, it was not until the release of Ethereum in 2015 that the idea become popularized. The Ethereum Foundation created a Turing complete smart contract language called Solidity that made smart contracts easier to write and understand for developers.

As of August 20, 2018, there are 1,793 DApps released on the Ethereum main-net, with 10,600 daily users, 78,400 daily transactions, and 13,700 ETH in 24hr volume.

Other smart contract platforms such as NEO, Stellar, EOS, Cardano, and more have gained traction in recent years. Each has unique features, the most significant being different consensus mechanisms – some are focused on decentralization while others are more centralized but have faster transactions. 


Video Summary


* The information contained in this article is for education purpose only and not financial advice. Do your own research before making any investment decisions.

This article is contributed by Victor Lai with the help of our Senior Analyst Kieran O'Day.

  •  
    39
    Shares
  • 39
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Click Here to Leave a Comment Below