Our website needs some good Author. Who can write Cryptocurrency and Blockchain related article. If anyone is interested writing article in our website, please SignUp.
Last updated: August 20, 2019 2:48 AM

How Do Ethereum Smart Contracts Work

Like many ideas in the blockchain industry, a general confusion involves the so-called “smart contracts.”

A new technology made possible by public blockchains, smart contracts are difficult to understand because the term partly confuses the central interaction described.

While a standard contract describes the terms of a relationship (usually one required by law), a smart contract imposes a relationship with the cryptographic code.

In other words, smart contracts are programs that run exactly as their creators create them.

First conceived in 1993, the idea was originally described by computer scientist and cryptographer Nick Szabo as a kind of digital vending machine. In his famous example, he described how users could enter data or values, and receive a finite item from a machine, in this case a real-world snack or a soda.

In a simple example, ethereum users can send 10 ether to a friend on a specific date through a smart contract (see our guide “What is the ether?“).

In this case, the user would create a contract and send the data to that contract in order to execute the desired command.

Ethereum is a platform created especially to create smart contracts.

But these new tools are not intended to be used in isolation. It is believed that they can also form the building blocks for “decentralized applications” (See: “What is a Dapp?“) And even entire autonomous decentralized companies (See: “What is a DAO?‘)

How smart contracts work

It is worth noting that Bitcoin was the first to admit basic smart contracts in the sense that the network can transfer value from one person to another. Network nodes will only validate transactions if certain conditions are met.

But, bitcoin is limited to the case of currency use.

On the contrary, ethereum replaces the more restrictive language of bitcoin (a scripting language of approximately one hundred scripts) and replaces it with a language that allows developers to write their own programs.

Ethereum allows developers to schedule their own smart contracts, or “autonomous agents,” as the ethereum technical document calls them. The language is “Turing-complete”, which means that it supports a broader set of computational instructions.

Smart contracts can:

  • It functions as a ‘multi-signature’ account, so funds are spent only when the required percentage of people agree
  • Manage agreements between users, for example, if one buys insurance from the other
  • Provides utilities for other contracts (similar to how a software library works)
  • Store information about the application, such as domain registration info or membership records.

Strength in numbers

Extrapolating that last point, smart contracts tend to need help from other smart contracts.

When someone makes a simple bet on the temperature on a hot summer day, it could trigger a sequence of contracts under the hood.

A contract would use external data to determine the weather, and another contract could settle the bet based on the information it received from the first contract when the conditions are met.

The execution of each contract requires ether transaction fees, which depend on the amount of computing power required.

As explained in our guide “How Ethereum works“, ethereum executes a smart contract code when a user or other contract sends you a message with sufficient transaction fees.

The Ethereum Virtual Machine then runs a smart contract in “bytecode”, or a series of ones and zeros that the network can read and interpret.

Images by Maria Kuznetsov

Article Source: http://www.coindesk.com