Understanding Smart Contracts and Their Potential Flaws

Ieva Ivanauskaite
Cryptodus
Published in
3 min readMay 29, 2018

--

As the hype of start-up funding through blockchain is swiping the world, it is not without some vulnerability issues. $500 Million worth of Cryptocurrency was lost due to bad code, bitcoin.com reports.

Smart Contracts Explained Simply

The idea of smart contracts was first described by American computer scientist Nick Szabo. He drew a parallel to a simple vending machine which “is a contract with bearer: anybody with coins can participate in an exchange with the vendor. The lockbox and other security mechanisms protect the stored coins and contents from attackers, sufficiently to allow profitable deployment of vending machines in a wide variety of areas.” Smart contract is intangible, but based on the same principle: it is a computer program executed inside a blockchain. Let’s say there’s a manufacturer using a smart contract to pay the shipment company. Once the buyer confirms that the goods are received, smart contract is executed and the money is transferred to a shipper’s account.

Surfing the ICO wave

Apart from the private applicability, one of the most popular use cases for smart contracts is ICOs. Removing the barriers set by venture capitalists and banks (what happens in case of IPO), ICOs enable any individual to crowdfund a project of their preference. If it soars in popularity, everybody wins: company has the necessary capital for growth, whereas token holders can later sell them at a greater price.

Be aware of the pitfalls

Least to say, the higher the potential reward, the more risk involved. A brief history of ICOs wasn’t written without mishaps. Some were vulnerable enough to be prone to hacker attacks, what caused $50 million loss for the Decentralized Autonomous Organization or had bugs in the code, as in Parity’s case, that allowed a user known as “devops199” eventually kill the smart contract governing the wallet. The event alone led to a permanent lock up of $150 million worth of ether. And these are just a couple of notorious examples. Based on research, led by scientists at University College London and NUS Singapore, 34,200 smart contracts (out of nearly one million tested) were found that could have them killed by anyone, have their funds locked indefinitely or leaked carelessly to arbitrary users.

Audit, audit, audit

Nothing is purely black or white, though. Most of the risks could and still can be mitigated by using the services of independent smart contract auditors whose role is to make sure that a smart contract will do only what it’s been programmed to do. That means a code should be safe and hacker-proof, without putting investors’ money at stake. Blockchain has a huge array of possible applications in various industries and the stepping stone in ensuring a stable ecosystem is by building trust in the technology.

For more advice, please visit cryptodus.com or send us your question to team@cryptodus.com

--

--