What is Ethereum?
ERC20 origins
Ethereum, a cryptocurrency based on the blockchain technology used to create Bitcoin, was designed to create far more applications than an online currency. In 2014, Vitalik Buterin created Ethereum with Gavin Wood and Jeffrey Wilcke.
By creation, Ethereum supports its very own coin (Ether) and smart contracts. With more than 270B USD market capitalization, Ethereum is the most prominent blockchain with smart contracts.
By definition, a smart contract is a self-working computer program that, once initiated, works on its own following the program’s logic. Smart contracts are developed by high-level languages like Solidity and then put together into a bytecode. The bytecode then runs on the blockchain when it is conjured.
Similar to BTC (Bitcoin), ETH (Ethereum) operates separately to a singular authority where its users can make peer-to-peer transactions.

Ethereum Blockchain

The Ethereum blockchain is a transaction-based state machine. It reads a series of inputs, and according to those inputs, it will transition to a new state.
Ethereum transitions from a genesis state to a final state in its state machine once transactions are made. It is in this state that millions of transactions occur and are grouped into “blocks.” Similar to Bitcoin, blocks contain transactions, and they are synced together with a previous block.
In order for a state to move to another, a transaction must occur and be validated. It can be validated through mining when a group of computers (nodes) use their power to make a block of transactions.
For blocks to be added to the blockchain, they must go through a process known as “proof of work.”
Miners are compensated with the digital token known as “Ether.” Therefore, new ETH coins are generated when miners prove a block.
To prevent multiple chain formations, Ethereum makes use of a system referred to as “GHOST protocol.”
GHOST = Greedy Heaviest Observed Subtree
The protocol states that the path chosen must have the most computation done on it.
The higher the block number, the longer the path and the bigger the mining effort needed to have gotten to the leaf.

Ethereum Accounts

The state of Ethereum is made up of many “accounts” that interact with each other in a message-releasing network. These accounts individually have a state linked to them and a 20-byte address.
A user requires an account to participate in the network. It can be produced by downloading the Mist Ethereum Wallet. A singular user can create as many accounts as they desire. Each account comes with its own private keys.
Accounts have four different fields: a nonce, which makes sure that a transaction is done once; current ether balance, amount of Ether the user has; a contract code, if an account is a contract account this dies has the code that will be done when a message is sent to the account; and storage, by default is always empty but can be read by transactions.
There are two types of accounts: externally owned and contract. Private keys from a specific user govern externally owned accounts, and their code handles contract accounts. External accounts have no code and can send messages by making and validating a transaction. Contract accounts activate their codes when they get messages.

Ethereum Transactions

Similar to Bitcoin, Ethereum transactions are peer-to-peer transactions. Transactions in Ethereum can be made externally by a user or a contract. They each consist of different parts: a none, the number of transactions sent by the user; recipient, use who receives the amount of Ether sent and identified by an address; the amount of ether, the value sent from user to another user; data, optional; signature of the sending user, necessary to validate the coins; value start gas, limit of execution steps; value gas-pas, the fee that has to be paid to miner per steps.
Once a transaction is made, it is sent to the network to be placed on the block.
If a contract account sends a transaction, it is done so through a “message.” Once it receives the message, its contract code is done. Every transaction has a nonce that corresponds with the sender’s account, none to be valid. If not, it will not be sent. This process prevents things like double-spending not to occur.

Ethereum Fees

It forces possible attackers to pay for resources used. Fees are added to transactions to avoid attacks. To compute these fees, the values of StartGas and GasPrice are used.
TransactionFee=(StartGas)(GasPrice)Transaction Fee = (StartGas) * (GasPrice)
When the sender doesn’t have enough coins to remove the initial fee, errors will be returned and messages will not be sent.

Ethereum Contracts

Contract accounts have codes. These codes are produced by a bytecode language referred to as Ethereum virtual machine code (EVM-code).
Contracts can be made with a transaction and with the transaction having an init field. An init field is an unlimited size byte array that gives the EVM-code to a specific account.
The creation and adoption of the code is a part of the state transition function, which is part of ETH’s block validating algorithm.

Switch to Proof-of Stake

Ethereum developers want to make the switch to Proof-of-Stake.
Proof-of-Work uses the Ethash algorithm, which takes about 12 seconds to mine per block. This process is a lot quicker than mining Bitcoin, but Ethereum has the possibility of running faster. Ethereum, compared to Bitcoin, does not have a specific number of blocks to wait, with BTC needing six blocks.
Waiting longer for a block to be accepted results in higher levels of security.
Miners who mine winning blocks get a static reward of 3.0 ether. There is an additional reward if a miner uses Uncles in their block, an extra 1/32 per Uncle included.
With the transition to Proof-of-Stake, there will be significantly less usage of energy. Ethereum, to date, is using as much electricity as Zambia annually. With the switch, energy consumption will drop because heavy computations will cease.
If less electricity is needed and the cost for mining substantially falls, the production of coins will also decrease. If costs for mining drop, rewards will also drop, and people will continue to make transactions in the network.
A move to Proof-of-Stake ensures that no centralized entities are made because all parties are reaching the same gains. For example, if an entity invests 1000 coins, the network will give them ten times less in return than a company that has invested ten coins.
Penalties may also be a thing. It makes attacks much more expensive to produce than in a Proof-of-Work state. Blockchains can also result in being quicker. If block times are lowered, more transactions can be processed in a faster time length. Developers for Ethereum speculate that a block time of 4 seconds will be possible with Proof-of-Stake instead of 12 seconds with Proof-of-Work.

Mining Awards

Miners are rewarded in a simple mathematical equation:
Reward=(TotalEtherActiveSet)(RewardCoefficient)(SetBlockTime)Reward = (Total Ether Active Set)*(Reward Coefficient)*(SetBlockTime)
Ethereum’s proof-of-work algorithm is referred to as “Etash” defined as:
(m,n)=PoW(Hn,Hn,d)(m, n) = PoW (Hn,Hn, d)
M is the mixHash, n is the nonce, Hn is the new block’s header, Hn is the nonce of the block header, and d is the DAG which is the large data set.
Miners can take pieces of the dataset and run them through mathematical functions to put them together into a “mixHash.” Miners will continue to produce a mixHash until the output is under the target nonce. Once the output meets requirements, the nonce is then valid, and blocks can be added to the overall chain.