Getting Started With Ethereum
Getting Started With Ethereum
Blockchain technology has been heralded as the next big cybersecurity innovation. Today, we take a quick look at one blockchain, Ethereum.
Join the DZone community and get the full member experience.Join For Free
Learning by doing is more effective than learning by watching - that’s why Codebashing offers a hands-on interactive training platform in 10 major programming languages. Learn more about AppSec training for enterprise developers.
What Is Ethereum?
Ethereum is an open-source blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. It is an open-source project created by Vitalik Buterin.
How Is it Different From Bitcoin?
Bitcoin is not capable of performing calculations that don't fit into its limited scripting language.
Satoshi Nakamoto, the creator of Bitcoin, did not design it to send anything more than few kilobytes of data per transaction believing that limiting the functionality would improve the security of the system.
But unlike Bitcoin, Ethereum was designed as the one that fits a virtual machine (the EVM), a Turing-complete language (Solidity), a token (ETH), and fuel (gas) to power every transaction in its network. This combination allows you to create complex programmatic computational instructions, or as we call them, smart contracts and decentralized applications, or DApps.
How Does it Work?
The basic unit of Ethereum is an account. Accounts are essential for users to interact with the Ethereum blockchain via transactions. The Ethereum blockchain tracks the state of every account.
There are two types of accounts:
- Externally Owned Accounts (EOAs) - which are controlled by private keys.
- Contract Accounts - controlled by the account's contract code and can only be activated by an EOA.
If we restrict Ethereum to only externally owned accounts and allow only transactions between them, we get an "altcoin" system that is less powerful than Bitcoin itself and can only be used to transfer Ether.
Like in Bitcoin, users pay small transaction fees to the Ethereum network. This helps in protecting the Ethereum blockchain from malicious computational tasks, like DDoS attacks or infinite loops. These fees are paid in amounts of Ethereum's native value-token, Ether.
Miners in Ethereum
These transaction fees (the fees paid by the sender of a transaction for each step of the program they activate) are collected by the nodes that validate the network.
These "miners" are nodes in the Ethereum network that receive, propagate, verify, and execute transactions. The miners then group the many transactions to update the state of the account into blocks.
Miners then compete with one another for their block to be the next one to be added to the blockchain. They are rewarded with Ether for each successful block they mine.
This helps in providing an economic incentive for people to dedicate hardware and electricity to the Ethereum network.
Proof of Work Function in Ethereum
The miners are tasked with solving a complex mathematical problem or Proof of Work to successfully mine a block. Any computational problem that requires orders of magnitude more resources to solve algorithmically than it takes to verify the solution can a good candidate for proof of work. In order to discourage centralization due to the use of specialized hardware (e.g. ASICs), as has occurred in the Bitcoin network, Ethereum chose to use a memory-hard computational problem. If the problem requires memory as well as CPU, the ideal hardware is, in fact, the general computer.
This makes Ethereum's Proof of Work ASIC-resistant, allowing a more decentralized distribution of security than blockchains whose mining is dominated by specialized hardware.
Currently, The PoW algorithm used in Frontier and Homestead is called Ethash, and it is created specifically for Ethereum.
Published at DZone with permission of Himani Arora , DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.