Smart contracts are automated contracts; rather than a physical piece of paper conveying an agreement between two individuals, smart contracts are simply lines of code on a blockchain which function in an “if this, then that”-sense. Because of this, they are increasingly widely considered a secure and straightforward way to carry out transactions or to authorise other actions on a blockchain.
Smart contracts and the blockchain
A blockchain is a publicly shared ledger which exists on the devices of all users at once; any adjustment made must therefore be verified by the majority of users in order to become an official part of the blockchain. At their origins, as launched by Satoshi Nakamoto within the context of Bitcoin in 2008, blockchains were simply lists of transactions between users, but other cryptocurrency platforms, such as Ethereum, developed the technology further to include not just logs of transactions, but also smart contracts.
Smart contracts are entries on the blockchain which are not simply financial transactions, but which are created to trigger a certain action. When a user interacts with such a smart contract, this can, for example, bring about a certain calculation, launch an application, or send a transaction to another account. Smart contracts are thus simply sections of code, which are created by a user but that, afterward, run entirely independently, according to the rules of the code and the blockchain.
Advantages of smart contracts
In this way, they take advantage of the immutability of the blockchain: as opposed to a real contract between individuals, a smart contract will always be carried out by the system so long as the code is correct and the blockchain is trustworthy. This means users do not run a risk of the contract being reneged upon by the other party.
They also avoid the necessity of a middleman, who may be corrupt or who may need compensation for his services, and they have the power to instantly carry out penalties if the smart contract is used to maintain an agreement between two people; for example, if party A does not follow through on his obligations to party B, the smart contract code can include a financial penalty which is instantly enacted upon party A. Smart contracts thus strive to be both straightforward and secure, as well as lower the risks inherent in traditional contracts.
Disadvantages of smart contracts
While smart contracts are eminently reliable, precisely because they are mindless snippets of code, this can also prove problematic in a number of ways.
Firstly, while the blockchain makes smart contracts easily visible to all users of the blockchain, this does not mean that bugs cannot sneak into the system; a malfunctioning smart contract can be easy to spot but hard to fix. An example is, for example, the attack on Ethereum project TheDAO in June 2016, when $50 million in Ether was stolen through a malfunctioning smart contract, which eventually led to a hard fork within the system.
Secondly, of course, the automated nature of smart contracts means that they are non-negotiable and will carry out their code no matter what; whereas physical contracts can be contested in courts of law (for example if the purchased goods or services are not as promised), this is impossible in the case of smart contracts, which are set in stone regardless of context.