Crypto currency Ethereum
Ethereum can be safely called the most ambitious follower of Bitcoin. He was an attempt to create a decentralized financial system, in which the rules of the game are set not by government bodies and banks, but by dispassionate algorithms. Ethereum goes further and introduces an alternative legal system that does not need courts, lawyers and coercion. And at the same time it serves as a unique environment for guaranteed calculations.
Ethereum
Invented by Ethereum Canadian programmer with Russian roots Vitalik Buterin. When Ethereum only appeared, in the yard was 2013, and Buryan turned eighteen years old. Nevertheless, his idea found a lively response in the community.
There was a man - Gavin Wood, who proved the possibility of creating a system invented by Buterin and described the basic principles of her work in Ethereum Yellow Paper. Together with the first members of the Ethereum team, they launched crowdfunding and collected investments for $ 18 million in bitcoins - in exchange for 60 million ethers.
What is unique about Ethereum?
Each transaction (transaction) in it is accompanied by a so-called smart contract - a computer program that automatically checks the terms of the contract and fulfills the obligations prescribed in it. Since a smart contract, unlike the usual one, is performed not by people but by cars, it can not be broken, circumvented or canceled. In the blockbuster "Eterum" not only the state of accounts is stored, but also the statuses of programs after their execution in a distributed network.
In rudimentary form, smart contracts are also present in Bitcoin, but the creator of the crypto currency, Satoshi Nakamoto, deliberately limited their capabilities. To describe the terms of transactions in Bitcoin, a programming language called Script is built in. It resembles Forth, but it does not allow you to arrange loops, does not save the state between calls, and does not have access to transaction or block data. This is enough only for the most simple tasks.
In Ethereum, contracts are most often described in a full-fledged object-oriented language that resembles JavaScript. The contract code is executed when you receive messages from the user or another contract. He can receive and send money and work with data in permanent storage, which is attached to each transaction. In the final, the script stores the calculated result in the blockroom. The sender will see him if he is watching the contract.
To avoid abuse of resources - the problem that forced Satoshi to deprive the Script of completeness by Turing - Ethereum provides "gas". Its number in the creator of the transaction limits the maximum number of executable commands. This does not allow creating malicious contracts that immerse the machines of the miners into an infinite loop.
Basic concepts of Ethereum
From the first time to understand how Ethereum is arranged, it is not easy, especially if you are familiar with crypto-currencies only by hearsay. Therefore, we will analyze each of these concepts in more detail, and we hope that you will have a clearer picture in your head.
Block - a distributed database that contains information about all transactions conducted by system participants. Information is stored as a "chain of blocks" (hence the name), each of which contains a certain number of transactions. Blocks are connected with each other, because they are called a "chain". In the case of crypto-currencies transactions are money transfers between users' wallets.
Depending on the context, "blockage" can be called different things:
principle of building a system (technology);
distributed decentralized trusted registry;
protocol;
a database, copies of which are stored on computers participating in the system;
peer-to-peer network in which all participants are equal in rights and conduct interactions in a given order, including through economic incentives.
Node is the computer on which the network client is installed. Checks transactions and writes them to the block. The full node stores the headers of all the blocks from the very first block. Now we are working on an easy client, which would allow the client program to work without a full copy of the block.
Miner - node, which not only writes blocks to the block, but also processes the transactions and participates in the mining of the next block. Miners are working on solving a mathematical problem, namely, the search for a hash that satisfies certain conditions. A large computational power means a greater probability for a certain time to find a satisfying hash condition and to mock the new block. For finding the block, the miner receives a reward in the form of system tokens ("ether"). This encourages network members to maintain the system. After the block was formed and all the participants updated the information, it is already impossible to change the record. Protection from fraud is provided by a mathematical algorithm and the availability of other users. The statistics of the "ether" production can be found in ethernodes.
Gas, air, ETH is the currency of Ethereum. Unlike many crypto-currencies, the ether is positioned by developers not as an alternative to conventional currencies, but as a kind of virtual fuel for accounting for the use of resources in a decentralized network. To ensure that unscrupulous users do not paralyze the work of the miners and complete nodes (for example, by entering them into an infinite loop), the author of the transaction should immediately specify the maximum number of steps allowed in the calculation. A certain amount of ETH is attached to the contracts, and if this limit is exceeded (gas runs out), the calculation is interrupted, the changes made are rolled back, but the commissions remain paid. The ether is sold on the stock exchanges crypto-currency, and the capitalization of all ETH tokens has reached one billion dollars. The "aether" rate has grown more than tenfold since the end of last year, but because of the history with The DAO it sank down. At the time of writing, he is about 13 dollars.
Ethereum Virtual Machine, EVM is part of the Ethereum protocol, which manages states and performs transaction processing. From a practical point of view, EVM is a giant distributed stand-alone computer that contains millions of objects called accounts. Accounts can manage an internal database, execute code, and interact with each other. For a more detailed description, we recommend that you study Ethereum White Paper and the documentation for the latest release of Ethereum Homestead Release.
Smart contracts are computer protocols that facilitate, verify, or enforce contracts. They usually have a user interface and often emulate the logic of contractual provisions. Smart contracts are designed to provide better security than traditional contracts based on law, and reduce the costs associated with contracting. The defining property of a smart contract is self-fulfillment. If the contracts concluded between people, suggest that if the conditions are not met, you need to go to court (and they are compiled with this in mind), then the software contracts are executed automatically. Supporters of smart contracts argue that many types of contractual provisions can be made partly or completely self-executing, self-sufficient or both at once.
Decentralized applications, dapps are applications that are implemented using smart contracts. The application is not executed in any particular place, but nevertheless one can be sure that it will be executed (unless, of course, its execution is interrupted due to a lack of gas). From the point of view of traditional development, they may look unusual. The backend here is a hardened smart contract. If you want to access it, you need to connect to the local or remote node using the web3.js library, which provides an API for queries to the blockroom. After that, you can do the front end of the application, if, of course, it is necessary.
Ethereum Clients
Ethereum has a lot of implementations, they are written in C ++, Go, Python, Rust, Java, Haskell. The most popular client to date is Geth, it's written in Go. The development of the client on Rust - Parity is also underway. The first release of Parity already came out and showed excellent performance. There is also an EthereumJS project - a client written in JavaScript. It is designed specifically for testing and developing contracts.
After installing the client, you can synchronize the server and interact with the network from the console. But it is much more convenient to start with the graphical client Mist browser. After the first run, you create an account and synchronize the block. By default, Mainnet, the main network, will be used. In addition to it, there is a test network - Testnet. It is similar in many respects to Mainnet, but it serves as a "sandbox".
On what Smart contracts write
There are many languages for writing smart contracts. The most popular (and with a large margin!) Is Solidity. The syntax is close to JavaScript. There is an alternative option - Serpent, it is closer in spirit to Python.
Contracts can be compiled into the EVM bytecode using the solc compiler or using an online compiler. Mist browser allows you to create contracts on the network in the form of source code on Solidity or EVM bytecode. Next, you can use web3.js to create web applications that will interact with the contract.
There are several frameworks for development - they provide some useful functions. If you are going to program smart contracts, we recommend that you study Truffle, Embark and dapple, and then choose the one that seems most convenient and appropriate for the task.
To develop web applications that interact with smart contracts, a specific stack has been formed. It includes web3.js and Meteor. And of course, there are many modules that allow you to get access to a variety of functions from the start.
Follow:
https://twitter.com/denissangreal
https://www.linkedin.com/in/denis-liternyjj-3ba97011b/
https://www.facebook.com/Denislirenyjj
https://www.reddit.com/user/denisliternyjj/