Ethereum smart contracts: Sea and pigs

Ethereum smart contracts: Sea and pigs

Among modern cryptocurrencies, there are not many who have brought real innovation. But Ethereum is undoubtedly one of them.

The appearance of Ethereum on the cryptocurrency market was accompanied by considerable fanfare, the advantages of the new system were listed, and smart contracts occupied the first place among them. 

Not that this was something previously unseen. The idea of ​​smart contracts was voiced back in 1994 by Nick Szabo. However, the practical implementation of these ideas became possible only with the advent of a viable implementation of blockchain technology. However, even the definition given to smart contracts in Wikipedia is noticeably different from what smart contracts in Ethereum actually are.

What is the difference? 

To begin with, as we expect from a technology called a smart contract (“smart agreement”), at a minimum, it is an agreement (a contract), that is, something that has legal force. With “smart” it’s a little more complicated, but it’s also logical to assume that this is, at a minimum, a technology in which the contract itself is not just a record, but has some kind of intellectual functions. As an example, a situation is given when the fulfillment of the conditions described in the Samrt contract automatically triggers the transfer of money. 

In practice, at least in the context of Ethereum, this is not entirely true. And to be more precise, this is not true at all. 

First, let’s immediately say goodbye to the word “contract” - it is obvious that Ethereum smart contracts do not and cannot have any legal force. And not only because not a single notary or court recognizes them. And by its very nature.

Yes, blockchain technology is an almost ideal data storage that perfectly protects data from loss and distortion. Even in the bitcoin blockchain, you can save the text of the agreement and it will remain unchanged and available for the entire existence of this blockchain.  

However, what is commonly called a contract in Ethereum is not an agreement between entities. And a certain set of program code. If you take a closer look at Ethereum, especially at how the developers themselves position it, it is not a cryptocurrency in its pure form. The developers themselves call Ethereum “a distributed virtual machine based on blockchain technology.” Even the definition of Ethereum in Wikipedia sounds like this:

a platform for creating decentralized online services based on the blockchain (Đapps, Decentralized applications, decentralized applications), working on the basis of smart contracts..

Find the word “cryptocurrency” here. So these apps are most often called smart contracts. There is often confusion and misunderstanding on the Internet about what the difference is between these concepts, but for the sake of simplicity I will not go into the wilds of the functioning of the EVM (Ethereum Virtual Machine).

A smart contract is precisely an application for Ethereum - Đapps. These are small programs that are written by developers in the blockchain in the form of so-called bytecode. The most common programming language tailored specifically for Ethereum is Solidity - a development of the widespread JavaScript with a number of serious limitations and syntax features. 

In order to limit the load and prevent unscrupulous developers from using too many network resources, the execution of a smart contract requires the use of gas - a kind of internal currency. Below I have given a typical example of a smart contact.


Why “The Sea and Pigs?” Because the guinea pig has nothing to do with the sea or pigs...


contract Mortal {
    address owner;
    function Mortal() { owner = msg.sender; }
    function kill() { if (msg.sender == owner) selfdestruct(owner); }
}

contract Greeter is Mortal {
    string greeting;
    function Greeter(string _greeting) public {
        greeting = _greeting;
    }
    function greet() constant returns (string) {
        return greeting;
    }
}

You May Also Like

32018-07-20

How to recognize a dummy token?

With the advent of a huge number of tokens on the crypto market, the question of choosing an investment object is becoming more and more complex. Three main criteria for a dubious cryptocurrency will help you navigate the world of altcoins.

Education
02018-09-02

How much can a novice investor earn from trading? Part eighteen. Trading (continued)

We continue the series of publications about trading in order to understand in practice how much a novice investor can earn using only the forecasts published on our website. To understand how useful they are, we decided to conduct an experiment and simulate a situation in which a person who only knows about trading that he needs to “buy cheaper and sell more expensive” tries to earn additional income in his free time from work by investing part of his funds in cryptocurrency trading

Trading, Education

Latest articles from Education category

Fresh video on our Channel