Skip to content

Instantly share code, notes, and snippets.

@deepakraous
deepakraous / yp_notations.md
Last active February 2, 2021 02:53
Yellow Paper Proof explainer
Section Formal Spec Function Explanation
2 (1) σt+1 ≡ Υ(σt, T) State Transition The Next State is defined as Ethereum State Transition Function along Current State with new Transactions
(2) σt+1 ≡ Π(σt, B) Mining The Next State is defined as Block Level State function along with Current Block state with new Block among other things
(3) B ≡ (...,(T0, T1, ...)) Mining Block is defined as series as Transactions among other items
(4) Π(σ, B) ≡ Ω(B, Υ(Υ(σ, T0), T1)...) Mining Block Level StateTransition Function is defined as Block Finalization State Transition Function along with this Block and Ethereum State Changes with Current state and Transaction.
3 (5) l(x) ≡ x[║x║− 1] Last item Evaluates the last item from a list of items
@deepakraous
deepakraous / yp_symbols.md
Last active March 16, 2018 07:30
Yellow Paper Symbols Explanation.

Reference from Mastering Blockchain/Wiki/personal interpretation

Symbol Description
is defined as
= is equal to
is not equal to
║...║ size (length) of
is in the following set or element of
is not in the following set or is not a element of
@deepakraous
deepakraous / trie.md
Last active July 17, 2018 20:40
Basic Trie
[
  %{0     => ["/", {0},{-1} ]},
  %{4995  => ["a", {0},{nil} ]},
  %{62251 => ["b", {4995},{nil}  ]},
  %{88021 => ["b", {62251}.{nil} ] },
  %{62434 => ["a", {88021},{nil} ]},
  %{57879 => [nil, {62434},{1}]},
  %{97678 => ["s", {62251},{nil} ]},
 %{55556 => [nil, {97678},{2} ]}
@deepakraous
deepakraous / trie_def.md
Last active March 1, 2020 23:11
trie definition

Trie Data Structure

  • Rooted Tree: T
  • String : s
  • Length of String : m
  • Total length of all Strings: M
  • Number of String : n
  • Size of Alphabet : N
  • leaf node: v
@deepakraous
deepakraous / scratch.md
Last active July 6, 2020 03:57
scratchpad for testing

!Alt text

@deepakraous
deepakraous / trie.ex
Created July 17, 2018 21:50
Skeleton implementation of basic trie
@trie_map %{96781234 => ["/", [0], [-99999] ] }
@characters ""
def add(trie \\@trie_map, items) do
splitter = split(trie,items)
end
def split(trie,items) do
splitted_items = items |>String.split( "", trim: true)
@deepakraous
deepakraous / recap-1.md
Last active January 13, 2022 13:03
Recap Part[1-6] of Medium Post

Introduction

  • Ethereum is a world computer.
  • Ethereum is a combination of A Singular World State+ A Virtual Machine.
  • World State is a collection of all States.
  • A State is a collection of Blocks.
  • The World State is stored as a Patricia Merkle Trie as per Recursive Length Prefix(RLP) spec in a mini Database.
  • Only a Virtual Machine can add a new State.
  • The Virtual Machine needs fuel to execute instructions and the fuel is ‘Ether’ to prevent rogue actions.
@deepakraous
deepakraous / yp_notations-2.md
Last active August 1, 2018 22:46
YP section 4,5
Section Formal Spec Function Explanation
4.1 σ[a]n State:address:nonce Number of transactions initiated by this address, or no of contracts created by this address
σ[a]b Balance Has the balance of the account in Wei
σ[a]s Storage Root Hash of the Storage root
(4) Π(σ, B) ≡ Ω(B, Υ(Υ(σ, T0), T1)...) Mining Block Level StateTransition Function is defined as Block Finalization State Transition Function along with this Block and Ethereum State Changes with Current state and Transaction.
5 (5) l(x) ≡ x[║x║− 1] Evaluate until n.. Evaluates until the last item from a list of items
@deepakraous
deepakraous / fortniteuniverse.md
Last active July 31, 2018 04:58
Describe Ethereum using Fortnite

 FortNiteUniverse  = {FortNiteKeys, FortNiteTreasures}
 FortNiteKeys      = {{RR,AA,HH,PP… }, {DD,RR,FF,… } }
 FortNiteTreasures = {"MOISTY MIRE", "IAMINA CULT"}

@deepakraous
deepakraous / fortnite_rule-1.md
Last active August 2, 2018 00:21
Place where we dump all of our rules into a single place. Helps to describe Ethereum
Rules Description
FortniteUniverse A Collection of FortNiteKeys and FortNiteTreasures
FortniteState A Collection of winners and their loots