What are Smart Contracts?

documents overlaying blue background

Summary: Smart contracts are the active elements of blockchains -- the blockchain version of a program. Smart contracts are important because they can make use of the blockchain’s unique abilities so they can be trusted to do exactly what they’re programmed to do, from fund transferring, to supply chain management, and even voting. That makes them capable of things regular programs could never do.

What are smart contracts?

Blockchains are often credited with being able to “do” all sorts of incredible things, and yet the blockchain itself is just a means of hosting information. How can a hosting platform affect the world? By hosting things that affect the world, of course.

In their essence, that’s what smart contracts are: the component of the blockchain environment that facilitates all the data exchanges that translates into the eventual outward-facing results the platform is designed to achieve. Any overall task completed with a blockchain will involve a smart contract to some extent, but the foundational importance of smart contracts can get extremely elaborate, as well.
The simplest example of a smart contract activity is also the first example: sending Bitcoin to a fellow user. In this case, the blockchain executes an extremely simple smart contract that takes as its variables the Bitcoin sender, the recipient, the amount to be transferred, and the conditions that must be met for the transfer to occur. In the case of a funds transfer, the conditions might be that each side has met their end of the bargain by proving that they have enough of their respective currency to complete the transaction.

Etherparty InfoboxThat’s how the majority of smart contracts actually work: they have preconditions and instructions, and carry out the instructions only once the preconditions have been met. That might sound limited, but it’s essentially the way more typical legal contracts work as well. And just like lawyers working with regular contracts, software engineers can apply the basic idea of a smart contract in truly innovative ways.

Most modern blockchains allow some sort of full-featured coding within their environment, meaning that smart contracts can be programmed to do almost anything that a regular program could do.

 

Different blockchains allow different levels of coding freedom. The Ethereum blockchain was the first to allow real code execution on the blockchain, but others include the EOS, NEO, and Tezos blockchains. In these more modern environments, the possibilities for blockchain use cases are basically endless.

Still, the main reason we would want to perform a process via the blockchain is if the process required trusted coordination or interaction between multiple parties who do not necessarily trust one another. We could, for instance, create and host a blockchain smart contract that saves, organizes, and reports our calendar events for us, but this would use very little of the actual advantages of blockchain architecture.

On the other hand, a large-scale calendar where a group of users can all coordinate to pick the best possible time for an event might very well justify making it as a blockchain smart contract.

More complex contracts.

pull quoteThere’s no shortage of processes that could be administered with smart contracts. One of the most important, right now, is the ability to cut out elements that were previously bogging down complex processes -- IBM has a supply chain blockchain project that uses smart contracts to power inventory management processes.

Obviously it was possible to manage supply chains before smart contracts came around, but now companies can trust the blockchain’s security where previously only levels of human bureaucracy could do the job. The result has been, for many companies, dramatic improvements in efficiency.

 

But that’s just the start. There are movements to remove the human element from vote counting, by using blockchain smart contracts for the collection and tallying of votes in political elections. In that case, the idea is to use the security of the blockchain to alleviate concerns about voter fraud that stem from human oversight. Social services are another oft-suggested portion of society to control via smart contracts.

Infographic

Smart contracts can also be empowered to do things that normally you would do yourself -- like watch financial markets and make very particular trades once certain events transpire. Again, it comes down to the ability of investors to trust the blockchain to do exactly what they tell it to do in exactly the context they tell it to wait for.

Smart contracts get much more complex than that, and they interact with all sorts of other aspects of the blockchain space, from side-chains to blockchain oracles to human-based democratic systems. So check for updates, because the Vanbex blog will be diving into those and much more!