The emerging smart contract platform and alternative cryptocurrency system is gaining attention though many still wonder how it exactly works. To make things clearer, CoinFox carries on looking into Ethereum.

Cryptofuel for the network

The name of the cryptocurrency running within the Ethereum system is ether (and not “Ethereum”, as many mistakenly think). The currency is the means of paying for computations done by Ethereum Virtual Machine. 

The cost of said computations is expressed in Gas (a constant which keeps the price of the network resources unchangeable notwithstanding the volatility of the actual currency unit).

Gas has its static value (Gas Cost) which is always stable over time. Its price, on the other hand, measured in ether (Gas Price), changes accordingly to the cryptocurrency's fluctuations: once the price of ether goes up, the Gas Price should go down to make sure the real cost of Gas remains the same. The Gas Cost dynamic calculation based on the volume and complexity of a request (the pattern is known as gasUsed) is multiplied by the current Gas Price, and the total price is expressed in ether.

The maximum amount of Gas intended for using per block is subject to so-called Gas Limit which is considered as “the maximum computational load, transaction volume, or block size of a block.” These figures can be slowly changed by miners over time.

To run a particular transaction or program (called “contract”), one has to pay an amount of Gas (called Gas Fee) to miners. There is a list of fixed default fees for particular operations (see the table: http://ether.fund/tool/gas-fees).

Gas is paid for exclusively in ether, its price being currently equivalent to 10 szabo, or 0.00001 ether, in accordance with the Ethereum’s metric system of denominations.

Within this system, each denomination has its own unique name (some were titled after “seminal figures playing a role in the evolution of computer science and cryptoeconomics”).

The smallest denomination (base unit) of ether is called wei:

 

To obtain ether, one has either to become an Ethereum miner or exchange it for other currencies, crypto or fiat, using available services. A number of popular cryptocurrency exchanges have recently added ether to their stock, and their ranks are growing.

Externally owned account vs contract, transaction vs message

The actual mechanics of how Ethereum works can be described in terms of transactions and messages sent by external actors and contracts.

To enter the platform, one needs to create an “externally owned account” which is controlled by private keys and has no associated code but has its ether balance and is able to send transactions.

The transactions can trigger the work of contracts (programs with their own ether balance and associated code which lets them interact with each other whilst every instruction they get is being executed on every node of the network).

The transactions include input parameters which instruct contracts to act in a certain way. As explained in the original description, transactions contain:

  • the recipient of the message

  • a signature identifying the sender and proving their intention to send the message to the recipient via blockchain

  • the amount of wei to transfer from the sender to the recipient (“VALUE” field)

  • an optional data field, which can contain a message sent to the contract

  • a “STARTGAS” value reflecting the maximum number of computational steps the transaction execution is allowed to take

  • a “GASPRICE” value, which shows the fee the sender is going to pay for gas depending on the number of computational steps.

When executed, contracts have the ability to send “messages” (virtual objects existing only in the Ethereum execution environment) to other contracts. The messages consist of the information about the sender of the message, the recipient, the amount of wei to transfer with the message to the contract address (“VALUE” field), an optional data field (the actual input data to the contract), and a “STARTGAS” value limiting the maximum amount of gas the code execution triggered by the message can involve.

The difference between a message and a transaction is that the former is conducted by a contract, not by an externally owned account. A message triggers the recipient to run its own code the same way a transaction does.

Smart contracts

The four general purposes of smart contracts around which all contract-based applications are being built can be described as follows:

  • maintaining a data store that represents something useful to other contracts or to the outside world (a contract that simulates a currency, a contract that records membership in a particular organisation)

  • serving as a software library

  • helping to establish a high-level complicated access policy (“forwarding contracts” like a wallet contract that maintains a multisignature access procedure)

  • managing an ongoing contract or relationship between multiple users (financial contracts, insurance contracts, contracts left open by a party for any other party to engage with at any time; i.e. a contract automatically rewarding whoever submits a valid solution to a hard mathematical problem).

Thus, the multi-purpose contracts can conduct a great variety of jobs, becoming part of a meta-infrastructure for the world where digital applications will help us to do things we have been used to doing ourselves for ages.


Elisaveta Vereschagina / Maria Rudina