What are smart contracts ?
Many people have heard about smart contracts. Created from the Ethereum blockchain, what do they really bring and how do they work? Coinhouse explains this concept and the innovations it brings to life through a concrete example.
The most important feature of Ethereum is the ability to use smart contracts. In this article, we will detail how this technology works, its uses and limitations, in order to make it understandable to as many people as possible.
The Bitcoin blockchain for simple transactions
The Bitcoin blockchain is most of the time used for simple transactions: sending bitcoins from one address to another. It is also possible to use more complex mechanisms, such as multi-signature. But these functionalities remain limited and do not allow the execution of complex algorithms.
The conditional execution of an action
A concept formulated in 1996 by the developer Nick Szabo, a smart contract is a computer program recorded on a Blockchain, most of the time Ethereum. It allows conditional transactions to be triggered, depending on factors defined in advance via an algorithm. Smart contracts are executed using ethers you can buy and sell on our Coinhouse platform, as are most tokens backed by projects created from smart contracts. These ethers are used as fuel consumed during the execution of the program.
Let’s take an example: we want to carry out a crowdfunding project, with the best security guarantees, and with a minimum amount below which the project will be cancelled. Subscribers are asked to send money over a one-month period. If the project raises more than €1000, the money is paid to the project managers, otherwise the subscribers will be fully pay back.
Investors confidence in question
The issues usually raised by this type of project then appear: during the month when the project is open for subscription, who keeps the funds? The project manager? A centralised platform? What guarantee do subscribers have to recover their initial investment if the project does not reach the defined minimum amount? What monitoring of funds can be done, and by whom? It will eventually be possible to set up contracts, targeted by lawyers in a legal framework, but it will never be possible to achieve an absolute level of security against fraud.
The smart contract schedules rules in advance
By using Ethereum, all these questions are solved. A developer writes a computer program called smart contract, most of the time in Solidity language. This program defines all the rules as they were defined at the beginning of the project: one month of subscription, to whom the funds will be sent, what minimum amount will be collected, etc.
Transparency and immutability
The creator of the smart contract then writes it on the Blockchain Ethereum, in the form of a transaction, just as if he were simply sending ethers from one address to another. Engraved on the Blockchain, the smart contract becomes impossible to modify, and its content can be consulted by anyone, in complete transparency.
A security that generates trust
The smart contract has a public Ethereum address, to which it is possible to send ethers. So subscribers have one month from this point on to do so. Who keeps the funds? The smart contracts store it during the subscription period. To whom will they be delivered? The rules, as transparently defined in the contract, specify the address to which the funds will be delivered if the minimum requested is exceeded, otherwise the funds will automatically be returned to each subscriber.
Who can cheat? Nobody, because it is impossible to change the rules once the smart contract has been sent to the Blockchain. We can therefore see the particularly interesting potential in terms of transparency and security for this type of application.
In addition, via smart contracts, it is possible to process many activities that previously required intermediaries, trusted third parties, managers, and which can now be processed automatically and in a perfectly secure way.
What are the limits smart contracts?
Of course Smart contracts do not solve all problems, and have a number of limitations detailed below.
First of all, what makes smart contracts strong, i.e. their immutability, can also be their worst weakness. If the programmer who created the smart contract has introduced bugs, it is impossible to repair them once the contract is present on the Blockchain. And if malicious hackers succeed in exploiting it, the worst can happen, as in the hacking of the”The DAO” project.
The volatility problem
Then, as we have seen, the funds are stored in the smart contract. If the funds are some ethers, the price can vary quite significantly during the execution of the contract. In the case of insurance, for example, it is not desirable if it changes over time. It is possible to overcome this type of problem by using stablecoins – cryptocurrencies whose price does not vary because they are backed by a fiat currency such as the Euro – such as the DAI from MakerDAO.
The oracle principle
Finally, if it is possible to check what a smart contract or an Ethereum address contains fairly easily in terms of transactions, it is much more difficult to check information or an event that took place outside the Blockchain: has an accident occurred on a particular vehicle? Who won this particular election? In these cases, it will be necessary to use an “oracle” that will make it possible to affirm that the condition triggering payment of the contract has been fulfilled.
However, since this oracle is located outside Blockchain, it once again poses a problem that existed before the smart contract was created: can we trust this intermediary completely, and by what means? Trusted third parties such as notaries or well-established audit firms would probably be the most appropriate to fulfil this role. Decentralised oracle projects are also developing, providing information that can be easily verified by different parties and read directly on the Blockchain.
Smart contracts have the potential to revolutionise countless economic activities, by decentralising trust, formalising the logic of executing a complex payment via a computer language, and securely storing funds for the duration of the contract. It is not surprising that many companies, and even government officials, are taking a keen interest in them, although it is necessary to remain aware of the framework in which they can best be used.