How Ethereum Smart Contracts Work


How Ethereum Smart Contracts Work

There’s difficulty in understanding ‘smart contracts’ like many other concepts in the blockchain technology. They are difficult to understand as they create a conflict of understanding on the core interaction of public blockchains described. Similar to the regular contract whose term of agreement is usually enforced by law, the smart contract tends to enforce agreements using cryptographic codes. They are programs that execute in the exact way they are programmed by their makers.

The idea was brought to life in 1993 and was described by Nick Szabo, a computer scientist and cryptographer, as a concept similar to the vending machine where users could put in data or an amount, and get back a definite item from the machine – in this case, a snack or drink.

Using this kind of arrangement, an Ethereum user can decide to program 10 ethers to be delivered to a second person on a particular date using a smart contract by simply creating a contract and pushing the data to that contract, allowing it to complete the desired command.

The Ethereum platform is specifically created to develop and execute smart contracts. This idea isn’t designed to be used in isolation as it is expected to serve as a building block in the development of decentralized applications and even whole decentralized autonomous companies.

How It Works

It is important to note that the bitcoin network was originally designed to support the smart contract. i.e. allowing the network to transfer value from one person to the other and the nodes would only be tasked with verifying and validating transactions once a set of requirements are met. But in the case of bitcoin, it is limited to just currency transactions.

In a similar context, the bitcoin’s more restrictive language (a scripting language of about greater than hundred scripts) is replaced by Ethereum’s different language which allows developers to write their own programs. The Ethereum platform gives developers permission to create their own smart contracts, or ‘autonomous agents’, as the Ethereum white paper calls them. This language is called ‘Turing-complete’, which means it accepts a larger amount of computational instructions.

Smart contracts are able to:

  • Perform as a ‘multi-signature’ accounts, allowing funds spent to require the consent of a percentage of people.
  • Manage agreements between users, like an insurance between the two parties
  • Provide utility to other contracts (can be related to how a software library functions)
  • Store information like the domain registration and membership records of an application.

Strength in numbers

Smart contracts generally require assistance from other smart contracts. For example, when one places a bet on the temperature on a hot summer day, one contract could make use of outside data to establish the weather while a second contract would settle the bet based on the data received when the conditions in the first contract is met. Typically, one contract can trigger a sequence of contracts in the network.

Ether transaction fees are required for running each contracts depending on computing power required. Ethereum runs a smart contract when a user or a second contract delivers its message with the required transaction fee. The Ethereum Virtual Machine (EVM) then executes the smart contract in ‘bytecode’ - a series of zeroes and ones that could be interpreted by the network.