Block Chain
Block Chain
• The Merkle Patricia Trie (MPT) is a fundamental data structure utilized within the
Ethereum blockchain, integrating the characteristics of both Merkle trees and
Patricia tries. Its primary role is to function as a robust data storage system for
managing the vast array of transactions and receipts on the network.
Features (Nodes)
• #1 – Null nodes
• These nodes represent empty strings and serve as stand-ins for missing or deleted
values when necessary. They not only replace such values but also act as proof of
the MPT for a specific piece of data.
• #2 – Branch nodes
• As the name suggests, branch nodes are analogous to the branches of a tree. Each
branch node consists of 17 items, with one item representing the value and the
remaining 16 representing hexadecimal characters. The last item serves as the key-
value pair.
• #3 – Leaf nodes
• A node without child nodes is classified as a leaf node (or end node). It originates
from a branch node and includes two components: path and value. For instance, if
AxBE is a branch node in the MPT, the subsequent leaf nodes would be AxBEF and
AxBEC. Each leaf node, like AxBEF, features AxF as the path and 1000 as the value.
• #4 – Extension nodes
• Another node type, the extension node, serves as a shortcut to stored data. It’s an
optimized version of a branch node. In some instances, branch nodes have only one
child node with no subsequent siblings. To streamline the Trie, these branch nodes are
compressed into extension nodes, which include a prefix, path, and value related to
the child node. The hash value is derived from another node in this context.
History of Ethereum
• 2013: Ethereum was first described in Vitalik Buterin’s white paper in 2013 with
the goal of developing decentralized applications.
• 2014: In 2014, EVM was specified in a paper by Gavin Wood, and the formal
development of the software also began.
• 2015: In 2015, Ethereum created its genesis block marking the official launch of
the platform.
• 2018: In 2018, Ethereum took second place in Bitcoin in terms of market
capitalization.
• 2021: In 2021, a major network upgrade named London included Ethereum
improvement proposal 1559 and introduced a mechanism for reducing transaction
fee volatility.
• 2022: In 2022, Ethereum has shifted from PoW( Proof-of-Work ) to PoS( Proof-
of-State ) consensus mechanism, which is also known as Ethereum Merge. It has
reduced Ethereum’s energy consumption by ~ 99.95%.
Features
•
of Ethereum
Smart contracts: Ethereum allows the creation and deployment of smart contracts.
Smart contracts are created mainly using a programming language called solidity.
Solidity is an Object Oriented Programming language that is comparatively easy to
learn.
• Ethereum Virtual Machine (EVM): It is designed to operate as a runtime environment
for compiling and deploying Ethereum-based smart contracts.
• Ether: Ether is the cryptocurrency of the Ethereum network. It is the only acceptable
form of payment for transaction fees on the Ethereum network.
• Decentralized applications (Daaps): Dapp has its backend code running on a
decentralized peer-to-peer network. It can have a frontend and user interface written
in any language to make calls and query data from its backend. They operate on
Ethereum and perform the same function irrespective of the environment in which
they get executed.
• Decentralized autonomous organizations (DAOs): It is a decentralized organization
that works in a democratic and decentralized fashion. DAO relies on smart contracts
for decision-making or decentralized voting systems within the organization.
Type of Ethereum Accounts
• Ethereum has two types of accounts: An externally owned account (EOA), and a
Contract account. These are explained as following below:
• Externally owned account (EOA): Externally owned accounts are controlled by
private keys. Each EOA has a public-private key pair. The users can send
messages by creating and signing transactions.
• Contract Account: Contract accounts are controlled by contract codes. These
codes are stored with the account. Each contract account has an ether balance
associated with it. The contract code of these accounts gets activated every time a
transaction from an EOA or a message from another contract is received by it.
When the contract code activates, it allows to read/write the message to the local
storage, send messages and create contracts.
How Does Ethereum Work?
• Ethereum implements an execution environment called Ethereum Virtual Machine
(EVM).
• When a transaction triggers a smart contract all the nodes of the network will execute
every instruction.
• All the nodes will run The EVM as part of the block verification, where the nodes will
go through the transactions listed in the block and runs the code as triggered by the
transaction in the EVM.
• All the nodes on the network must perform the same calculations for keeping their
ledgers in sync.
• Every transaction must include:
• Gas limit.
• Transaction Fee that the sender is willing to pay for the transaction.
• If the total amount of gas needed to process the transaction is less than or equal to the
gas limit then the transaction will be processed and if the total amount of the gas
needed is more than the gas limit then the transaction will not be processed the fees
Real-World Applications of Ethereum
• Voting: Voting systems are adopting Ethereum. The results of polls are available
publicly, ensuring a transparent fair system thus eliminating voting malpractices.
• Agreements: With Ethereum smart contracts, agreements and contracts can be
maintained and executed without any alteration. Ethereum can be used for
creating smart contracts and for digitally recording transactions based on them.
• Banking systems: Due to the decentralized nature of the Ethereum blockchain it
becomes challenging for hackers to gain unauthorized access to the network. It
also makes payments on the Ethereum network secure, so banks are using
Ethereum as a channel for making payments.
• Shipping: Ethereum provides a tracking framework that helps with the tracking of
cargo and prevents goods from being misplaced.
• Crowdfunding: Applying Ethereum smart contracts to blockchain-based
crowdfunding platforms helps to increase trust and information symmetry. It
creates many possibilities for startups by raising funds to create their own digital
cryptocurrency.
• Domain names: Ethereum name service allows crypto users to buy and manage
their own domain names on Ethereum, thus simplifying decentralized transactions
without putting users to remember long, machine-readable addresses.
Benefits of Ethereum
• Availability: As the Ethereum network is decentralized so there is no downtime. Even
if one node goes down other computing nodes are available.
• Privacy: Users don’t need to enter their personal credentials while using the network
for exchanges, thus allowing them to remain anonymous.
• Security: Ethereum is designed to be unhackable, as the hackers have to get control of
the majority of the network nodes to exploit the network.
• Less ambiguity: The smart contracts that are used as a basis for trade and agreement
on Ethereum ensure stronger contracts that differ from the normal traditional contracts
which require follow-through and interpretation.
• Rapid deployment: On Ethereum decentralized networks, enterprises can easily
deploy and manage private blockchain networks instead of coding blockchain
implementation from scratch.
• Network size: Ethereum network can work with hundreds of nodes and millions of
users.
• Data coordination: Ethereum decentralized architecture better allocates information so
Drawback of Ethereum
• (Swarm) A decentralized storage network that was designed for the Ethereum
blockchain. Via distributed apps (dApps), Swarm stores data that would otherwise
overload Ethereum, and transactions reference the data using a hashed key created
in Swarm. IPFS is another storage system that complements blockchains, but
Swarm was designed especially for Ethereum (see IPFS).
Whisper protocol