Ethereum Whitepaper Summary Thread.

Today I have passed ~2 hours reading the Ethereum whitepaper.

Here is a brief summary to get an idea:

Web3 threads - Ethereum whi...
Table of Contents

What is Ethereum
Accounts
Ether
Contracts
Transactions
Messages
Message/Transactions
State Transition Function
Code Execution
Space types
EVM execution
Architectural difference
Block validation algorithm
State in the tree
Contract code exec
💯Days of Web3

What is Ethereum

Ethereum is a blockchain with a built-in Turing-complete programming language.

Anyone can write smart contracts and create their rules for:
- ownership
- transaction formats
- state transition functions
Accounts

Ethereum's state is made up of accounts.

Accounts have
- a 20-byte address
- state transitions

Account's fields:
- nonce: (to make sure each transaction can only be processed once)
- current ether balance
- contract code (if present)
- storage (empty by default)
Ether

Ether is Ethereum's cryptocurrency.

It's used to pay transaction fees.

Account types:
- externally owned accounts (controlled by private keys)
- contract accounts (controlled by their contract code)
Contracts

They are autonomous agents that live inside of the execution environment.

They:
- execute a specific piece of code when poked by a message or transaction.
- have direct control over their own balance & their own key/value store to keep track of persistent variables.
Transactions

They are a signed data package that stores a message to be sent from an account.

They contain:
- message's recipient
- sender's signature
- ether to transfer
- data field
- STARTGAS: max steps an execution can take
- GASPRICE: fee the sender pays per step
Messages

Contracts can send messages to other contracts.

They contain:
- message's sender
- recipient of the message
- ether to transfer alongside the message
- data field (optional)
- STARTGAS value
Message/Transaction

A message is produced:
- by a contract (not an external actor).
- when a contract code executes the CALL opcode.

A message leads to the recipient account running its code.

Contracts can have relationships with other contracts.
State Transition Function

In the pic below, you can see The Ethereum state transition function:

APPLY(S,TX) -> S'

Below are the 6 steps in detail:
(a whole thread should be dedicated to this).
ethereum.org/en/whitepaper/… Image
Code Execution

EVM code: low-level, stack-based bytecode language

It's an infinite loop of:
- carrying out the operation at the current program counter
- incrementing program counter by one,

This until occurs:
- end of the code
- error
- STOP/RETURN instruction
Space types

Operations have access to 3 space types to store data:
- The stack: LIFO container to push/pop values.
- Memory: an infinitely expandable byte array.
- Storage: key/value store.

Stack & Memory reset after computation ends, but storage persists.
EVM execution

While EVM is running, its state can be defined by the tuple (block_state, transaction, message, code, memory, stack, pc, gas).

block_state: global state containing accounts, balances, storage.

A basic implementation is possible in a few hundred lines of code.
Architectural difference from Bitcoin

The main architectural difference between Ethereum and Bitcoin is that Ethereum blocks contain a copy of both:
- the transaction list
- the most recent state.

In the bloc are also stored:
- the block number
- the difficulty Image
Block validation algorithm

1. Check if the previous block exists/is valid

2. Check that the block's timestamp is:
- greater previous block's one
- less than 15min into the future

3. Check the validity of:
- block number
- difficulty
- transaction root
- uncle root
- gas

Image
4. Check that the proof-of-work on the block is valid

5. Let S[0] be the state at the end of the previous block.

Image
6. Let TX be the block's transaction list, with n transactions.

For all i in 0...n-1, set S[i+1] = APPLY(S[i],TX[i]).

It returns an error if:
- any app returns an error
- if the total gas consumed in the block up until this point exceeds the GASLIMIT

Image
7. Let S_FINAL be S[n], but adding the block reward paid to the miner.

8. Check if the Merkle tree root of the state S_FINAL is equal to the final state root provided in the block header:
✅If it is, the block is valid.
❌otherwise, it is not valid. Image
State in the tree

The state is stored in the tree structure.

After every block, only a small part of the tree needs to be changed.

Between two adjacent blocks, the majority of the tree is the same. The data can be:
- stored once
- referenced twice using pointers
Contract code execution

It's part of the definition of the state transition function, which is part of the block validation algorithm:

1️⃣A transaction is added into block B

2️⃣ The code execution spawned will be executed by ALL nodes, since now, that download & validate block B
💯Days of Web3

I am on the Challenge of posting one Web3 content every day for 100 Days.

Day 84

Here is a GitHub repository with all the posts, day by day.
github.com/FrancescoXX/10…
If you enjoyed this thread, follow @FrancescoCiull4 and retweet the tweet below. Thank you.

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Francesco Ciulla

Francesco Ciulla Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @FrancescoCiull4

Mar 14
6 Solidity Cheatsheets thread.

There are not so many Solidity Cheat Sheets at the moment.

Here is my current favorite one.

More ↓ Image
Solidity Cheat Sheet by @topmonks

I like the concept of creating a simple website that looks like a cheatsheet but the fields are editable and copiable.

For version 0.4.25.

topmonks.github.io/solidity_quick… Image
Solidity-cheatsheet on GitHub by @manojpramesh

I Lovelike the idea of putting it on GitHub, for future changes and make it accessible to everyone!

github.com/manojpramesh/s…
Read 9 tweets
Mar 13
DAO Communities thread.

I am currently in 4 Web3 Communities.

When you want to become an expert on a topic, the best way is to join a community with that topic as a goal.

It's always about people.

Image
LearnWeb3 DAO @LearnWeb3DAO

The Community by @Haezurath I have been more active so far.

Very well organized and beginner-friendly.

Their discord server is 🔥

learnweb3.io
Buildspace @_buildspace

A cool Web3 Community with many projects inside that. I have joined because many people recommended this one on Twitter

buildspace.so
Read 8 tweets
Mar 12
2 days ago, I updated my @Linktree_ account.
Here are some stats📊and the changes I made ↓
Updating the main site required a lot of work, 3/4 hours.

I did this because I recently started my TikTok account

It currently has 12 links and I am kinda happy with the "final" result.

🔗linktr.ee/francescociulla Image
Lifetime Analytics

I have been using Linktree for a while, and I got 3.12K total clicks.

The CTR (people actually clicking on a link after visiting the website) is kinda high: almost 66% Image
Read 10 tweets
Mar 9
Smart contracts introduction thread.

What are smart contracts?

What are the fundamental concepts to understand as a Developer?

Let's see them in 2 minutes.

web3 threads - smart contracts
Table of Contents

Definition
Term's Origin
Goals
An analogy
Legal status
Smart legal contracts
Smart contracts as programs
Smart contracts a stored procedures
Workings
On Ethereum
Randomness on Blockchain
Security issues
The DAO (June 2016)
Issues in Ethereum
💯Days of Web3

Definition

A smart contract is a contract with additional blockchain features.

It's a computer program or a transaction protocol to automatically execute, control, or document legally relevant actions/events according to some contract terms.
Read 21 tweets
Mar 8
Polkadot Projects on GitHub:

🟨JavaScript
polkadot-wiki
polkadot-deployer
polkadot-js/docs
substrate-front-end-template

🐍Python
py-substrate-interface

🟦TypeScript
polkadot-launch
polkadot-js/apps
moonbeam

🐹Go
subscan-essentials
gossamer

🦀Rust
polkadot
parity-signer

GitHub Resources - Polkadot Repositories
Polkadot Wiki

Polkadot central source of truth

⭐Stars: 353
Contributors: 173
Active Issues: 19
Open PRs: 12

github.com/w3f/polkadot-w…
Polkadot Deployer

Iy's a tool for deploying polkadot networks.

⭐Stars: 100
Contributors: 9
Active Issues: 16
Open PRs: 1

github.com/w3f/polkadot-d…
Read 15 tweets
Mar 7
I FINALLY made it 🤯

Blockchain Competition TikTok video.

In 2021, I had 2 goals:
- Quit My Job
- Make a TikTok

Surprisingly, I achieved the first and failed the second!

In the link below, is my FIRST TikTok video

tiktok.com/@francesco.ciu… tiktok video - Blockchain C...
Follow me on TikTok for exclusive content.
tiktok.com/@francesco.ciu…
I am on the challenge of posting one Web3-related content every day for 100 days.

Day 79
Stars: 292

You can see all the tweets day by day at this GitHub repository
github.com/FrancescoXX/10…
Read 4 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(