SlideShare a Scribd company logo
ethereum 
Coding society
ethereum 
Internet is to communication 
as 
Ethereum is to agreements
basic premise 
Place & run code in a decentralised singleton isolated 
machine; 
code can call into other people’s code on the machine; 
all transactions with the machine are crypto-signed and 
archived; 
state fully deterministic.
blockchain 
Diffuse Singleton Data-Structure 
(non-localised, no-authority, no-centre)
bitcoin & crypto-currencies 
Used blockchain to implement basic 
clearing house ‘contract’
ethereum & crypto-law 
Uses blockchain to implement basic 
arbitrary contracts
ethereum 
Ethereum is to Bitcoin 
as 
the iPhone is to a calculator
ethereum 
100% Free software, open development 
github.com/ethereum 
C++, Go, Python implementations 
(Java & Javascript, too)
ethereum 
State of Ethereum is just the state of a number 
of accounts.
state: accounts 
Address 
(160-bit excerpt from the 256-bit public key) 
Balance, Nonce[, Code, Storage] 
(latter two non-null if a ‘contract’)
transactions: state alteration 
Alter state by introducing transactions: 
either send a message call 
or 
create a contract.
contract creation 
endowment (ETH), init code 
gas, signature
on creation 
Places a new account in the system with code 
(code in account is whatever is returned from 
the init routine)
message calls 
recipient, value (ETH), data 
gas, signature
on message receipt 
value is transferred to recipient’s balance; 
recipient’s code (if any) runs.
code execution: virtual machine 
Arbitrary size stack 
PUSH, POP, SWAP, DUP 
Arbitrary temp memory (2256 bytes 
addressable) 
MLOAD, MSTORE 
Code stored in virtual ROM 
CODESIZE, CODECOPY
virtual machine 
Arithmetic/Logic & Crypto 
ADD, EXP, EQ, AND, LT, BYTE, SHA3 &c 
Flow control 
JUMP, JUMPI, PC
vm: environment 
Can read message input data 
CALLDATALOAD, CALLDATASIZE, CALLDATACOPY 
Can halt & give message output data 
RETURN, STOP, SUICIDE
vm: environment 
Arbitrary storage (2256 words addressable) 
ISOLATED FROM OTHER ACCOUNTS 
SLOAD, SSTORE 
Can create & send messages. 
CREATE, CALL
vm: environment 
Can query blockchain information 
TIMESTAMP, PREVHASH, NUMBER, COINBASE, &c. 
Other information 
ADDRESS, BALANCE, ORIGIN, CALLER
vm 
Storage, memory & processing costs ETH 
(actually, costs GAS but 
GAS ⇔ ETH)
lll: basics 
expression := ( <op-code> [<operand> ...] ) 
<operand> is just expression 
0 -> PUSH 0 
(mload 0x20) -> PUSH 0x20 MLOAD
contract: currency 
(sstore (caller) 0x1000000000000) 
(returnlll (when (= (calldatasize) 64) (seq 
(mstore 0 (sload (caller))) 
(when (>= (mload 0) (calldataload 32)) (seq 
(sstore (caller) (sub (mload 0) (calldataload 32))) 
(sstore (calldataload 0) 
(add (sload (calldataload 0)) (calldataload 32))) 
)) 
)))
lll: advanced 
variables: (set ‘name <expression>) 
(mload x) / (mstore y z): @x / [y] z 
(sload x) / (store y z): @@x / [[y]] z 
(calldataload x): $x
contract: currency 
[[ (caller) ]] 0x1000000000000 
(returnlll (when (= (calldatasize) 64) { 
(set ‘a @@(caller)) 
(when (>= @a $32) { 
[[(caller)]] (- @a $32) 
[[$0]] (+ @@ $0 $32) 
}) 
}))
transaction: transfer 
to: <currency-contract> 
data: <recipient’s-address> <amount-to-transfer>
lll: advanced 
variadic arithmetic/logic 
macros: (def ‘sqr (x) (* x x)) (sqr 4): (* 4 4)
lll: name registration 
(def ‘registrar 
0x50441127ea5b9dfd835a9aba4e1dc9c1257b58ca) 
[0] 'register 
[32] 'Exchange 
(call (- (gas) 21) registrar 0 0 64 0 0)
exchange walkthrough...
thanks 
Looking for devs, too... 
C++ in Berlin especially!

More Related Content

DOCX
Multi client
PDF
Multi client
PDF
MultiClient chatting berbasis gambar
PPTX
Bits, bytes and characters
PDF
Kotlin의 코루틴은 어떻게 동작하는가
PDF
Creating an Arduino Web Server from scratch hardware and software
PDF
Comunicação Bluetooth Entre Python e PyS60
PPTX
C++ Lambda and concurrency
Multi client
Multi client
MultiClient chatting berbasis gambar
Bits, bytes and characters
Kotlin의 코루틴은 어떻게 동작하는가
Creating an Arduino Web Server from scratch hardware and software
Comunicação Bluetooth Entre Python e PyS60
C++ Lambda and concurrency

What's hot (6)

PPTX
Cyber Security
PDF
Ingredients for creating dapps
PDF
Border Patrol - Count, throttle, kick & ban in perl
PDF
Cryptography for Smalltalkers
PDF
Flashback, el primer malware masivo de sistemas Mac
PPTX
OpenZeppelin + Remix + BNB smart chain
Cyber Security
Ingredients for creating dapps
Border Patrol - Count, throttle, kick & ban in perl
Cryptography for Smalltalkers
Flashback, el primer malware masivo de sistemas Mac
OpenZeppelin + Remix + BNB smart chain

Similar to Ethereum hackers (20)

PPTX
Ethereum: Coding Society
PDF
Ethereum: From there to here, and ownards yonder
PPTX
lecture7 blockchain ethereum mechanics 101
PPTX
Hello world contract
PDF
A Decompiler for Blackhain-Based Smart Contracts Bytecode
PDF
"Programming Smart Contracts on Ethereum" by Anatoly Ressin from AssistUnion ...
PPTX
Ethereum Block Chain
PPTX
Ethereum
PPTX
EthereumBlockchainMarch3 (1).pptx
PPTX
CCS339 Unit IV is explained in detail for easy understanding
PDF
Exploring ethereum
PDF
Encode Club: Nethermind Workshop EVM Bootcamp
PPTX
Intro to smart contract on blockchain en
PDF
Introduction to Ethereum
PDF
Ethereum-Cryptocurrency (All about Ethereum)
PDF
All about blockchain
 
PDF
What is a decentralised application ? - Les Jeudis du Libre
PPTX
Blockchain for Developers
PPTX
Ethereum
 
PPTX
Hands on with smart contracts
Ethereum: Coding Society
Ethereum: From there to here, and ownards yonder
lecture7 blockchain ethereum mechanics 101
Hello world contract
A Decompiler for Blackhain-Based Smart Contracts Bytecode
"Programming Smart Contracts on Ethereum" by Anatoly Ressin from AssistUnion ...
Ethereum Block Chain
Ethereum
EthereumBlockchainMarch3 (1).pptx
CCS339 Unit IV is explained in detail for easy understanding
Exploring ethereum
Encode Club: Nethermind Workshop EVM Bootcamp
Intro to smart contract on blockchain en
Introduction to Ethereum
Ethereum-Cryptocurrency (All about Ethereum)
All about blockchain
 
What is a decentralised application ? - Les Jeudis du Libre
Blockchain for Developers
Ethereum
 
Hands on with smart contracts

More from gavofyork (20)

PDF
Governance in Polkadot PoC-3
PDF
Polkadot, Substrate and Governance (PoC-3)
PDF
Polkadot Presentation
PDF
Parity Progress Report
PDF
Blockchain, ethereum and polkadot
PDF
Polkadot prezo
PDF
Ethereum: Next steps...
PDF
Where can smart contracts take us?
PDF
Blockchain what and why-
PDF
So now we've built Ethereum, WTF is it?
PDF
The world computer (short)
PDF
The world computer
PDF
The world computer general
PPTX
Bazaar services
PDF
Allegality
PDF
Relative truth
PPTX
ÐΞVcon: Introduction
PPTX
The Ethereum ÐApp IDE: Mix
PPTX
Solidity
PPTX
Whisper
Governance in Polkadot PoC-3
Polkadot, Substrate and Governance (PoC-3)
Polkadot Presentation
Parity Progress Report
Blockchain, ethereum and polkadot
Polkadot prezo
Ethereum: Next steps...
Where can smart contracts take us?
Blockchain what and why-
So now we've built Ethereum, WTF is it?
The world computer (short)
The world computer
The world computer general
Bazaar services
Allegality
Relative truth
ÐΞVcon: Introduction
The Ethereum ÐApp IDE: Mix
Solidity
Whisper

Ethereum hackers

  • 2. ethereum Internet is to communication as Ethereum is to agreements
  • 3. basic premise Place & run code in a decentralised singleton isolated machine; code can call into other people’s code on the machine; all transactions with the machine are crypto-signed and archived; state fully deterministic.
  • 4. blockchain Diffuse Singleton Data-Structure (non-localised, no-authority, no-centre)
  • 5. bitcoin & crypto-currencies Used blockchain to implement basic clearing house ‘contract’
  • 6. ethereum & crypto-law Uses blockchain to implement basic arbitrary contracts
  • 7. ethereum Ethereum is to Bitcoin as the iPhone is to a calculator
  • 8. ethereum 100% Free software, open development github.com/ethereum C++, Go, Python implementations (Java & Javascript, too)
  • 9. ethereum State of Ethereum is just the state of a number of accounts.
  • 10. state: accounts Address (160-bit excerpt from the 256-bit public key) Balance, Nonce[, Code, Storage] (latter two non-null if a ‘contract’)
  • 11. transactions: state alteration Alter state by introducing transactions: either send a message call or create a contract.
  • 12. contract creation endowment (ETH), init code gas, signature
  • 13. on creation Places a new account in the system with code (code in account is whatever is returned from the init routine)
  • 14. message calls recipient, value (ETH), data gas, signature
  • 15. on message receipt value is transferred to recipient’s balance; recipient’s code (if any) runs.
  • 16. code execution: virtual machine Arbitrary size stack PUSH, POP, SWAP, DUP Arbitrary temp memory (2256 bytes addressable) MLOAD, MSTORE Code stored in virtual ROM CODESIZE, CODECOPY
  • 17. virtual machine Arithmetic/Logic & Crypto ADD, EXP, EQ, AND, LT, BYTE, SHA3 &c Flow control JUMP, JUMPI, PC
  • 18. vm: environment Can read message input data CALLDATALOAD, CALLDATASIZE, CALLDATACOPY Can halt & give message output data RETURN, STOP, SUICIDE
  • 19. vm: environment Arbitrary storage (2256 words addressable) ISOLATED FROM OTHER ACCOUNTS SLOAD, SSTORE Can create & send messages. CREATE, CALL
  • 20. vm: environment Can query blockchain information TIMESTAMP, PREVHASH, NUMBER, COINBASE, &c. Other information ADDRESS, BALANCE, ORIGIN, CALLER
  • 21. vm Storage, memory & processing costs ETH (actually, costs GAS but GAS ⇔ ETH)
  • 22. lll: basics expression := ( <op-code> [<operand> ...] ) <operand> is just expression 0 -> PUSH 0 (mload 0x20) -> PUSH 0x20 MLOAD
  • 23. contract: currency (sstore (caller) 0x1000000000000) (returnlll (when (= (calldatasize) 64) (seq (mstore 0 (sload (caller))) (when (>= (mload 0) (calldataload 32)) (seq (sstore (caller) (sub (mload 0) (calldataload 32))) (sstore (calldataload 0) (add (sload (calldataload 0)) (calldataload 32))) )) )))
  • 24. lll: advanced variables: (set ‘name <expression>) (mload x) / (mstore y z): @x / [y] z (sload x) / (store y z): @@x / [[y]] z (calldataload x): $x
  • 25. contract: currency [[ (caller) ]] 0x1000000000000 (returnlll (when (= (calldatasize) 64) { (set ‘a @@(caller)) (when (>= @a $32) { [[(caller)]] (- @a $32) [[$0]] (+ @@ $0 $32) }) }))
  • 26. transaction: transfer to: <currency-contract> data: <recipient’s-address> <amount-to-transfer>
  • 27. lll: advanced variadic arithmetic/logic macros: (def ‘sqr (x) (* x x)) (sqr 4): (* 4 4)
  • 28. lll: name registration (def ‘registrar 0x50441127ea5b9dfd835a9aba4e1dc9c1257b58ca) [0] 'register [32] 'Exchange (call (- (gas) 21) registrar 0 0 64 0 0)
  • 30. thanks Looking for devs, too... C++ in Berlin especially!