SlideShare a Scribd company logo
1 of 30
Download to read offline
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

What's hot

Ingredients for creating dapps
Ingredients for creating dappsIngredients for creating dapps
Ingredients for creating dappsStefaan Ponnet
 
Border Patrol - Count, throttle, kick & ban in perl
Border Patrol - Count, throttle, kick & ban in perlBorder Patrol - Count, throttle, kick & ban in perl
Border Patrol - Count, throttle, kick & ban in perlDavid Morel
 
Cryptography for Smalltalkers
Cryptography for SmalltalkersCryptography for Smalltalkers
Cryptography for SmalltalkersESUG
 
Flashback, el primer malware masivo de sistemas Mac
Flashback, el primer malware masivo de sistemas MacFlashback, el primer malware masivo de sistemas Mac
Flashback, el primer malware masivo de sistemas MacESET Latinoamérica
 
OpenZeppelin + Remix + BNB smart chain
OpenZeppelin + Remix + BNB smart chainOpenZeppelin + Remix + BNB smart chain
OpenZeppelin + Remix + BNB smart chainGene Leybzon
 

What's hot (6)

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

Similar to Ethereum hackers

Ethereum: From there to here, and ownards yonder
Ethereum: From there to here, and ownards yonderEthereum: From there to here, and ownards yonder
Ethereum: From there to here, and ownards yondergavofyork
 
Blockchain, Ethereum and Business Applications
Blockchain, Ethereum and Business ApplicationsBlockchain, Ethereum and Business Applications
Blockchain, Ethereum and Business ApplicationsMatthias Zimmermann
 
A Decompiler for Blackhain-Based Smart Contracts Bytecode
A Decompiler for Blackhain-Based Smart Contracts BytecodeA Decompiler for Blackhain-Based Smart Contracts Bytecode
A Decompiler for Blackhain-Based Smart Contracts BytecodeShakacon
 
Academic Ethereum
Academic EthereumAcademic Ethereum
Academic Ethereumgavofyork
 
BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session
BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session
BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session 병완 임
 
Hello world contract
Hello world contractHello world contract
Hello world contractGene Leybzon
 
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereum
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereumDappsmedia smartcontract _write_smartcontracts_on_console_ethereum
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereumTomoaki Sato
 
Braga Blockchain - Ethereum Smart Contracts programming
Braga Blockchain - Ethereum Smart Contracts programmingBraga Blockchain - Ethereum Smart Contracts programming
Braga Blockchain - Ethereum Smart Contracts programmingEmanuel Mota
 
以太坊代幣付款委託 @ Open Source Developer Meetup #12
以太坊代幣付款委託 @ Open Source Developer Meetup #12以太坊代幣付款委託 @ Open Source Developer Meetup #12
以太坊代幣付款委託 @ Open Source Developer Meetup #12Aludirk Wong
 
Best practices to build secure smart contracts
Best practices to build secure smart contractsBest practices to build secure smart contracts
Best practices to build secure smart contractsGautam Anand
 
The world computer
The world computerThe world computer
The world computergavofyork
 
Socket programming
Socket programmingSocket programming
Socket programmingAnurag Tomar
 
Encode x NEAR: Technical Overview of NEAR 1
Encode x NEAR: Technical Overview of NEAR 1Encode x NEAR: Technical Overview of NEAR 1
Encode x NEAR: Technical Overview of NEAR 1KlaraOrban
 
EthereumBlockchainMarch3 (1).pptx
EthereumBlockchainMarch3 (1).pptxEthereumBlockchainMarch3 (1).pptx
EthereumBlockchainMarch3 (1).pptxWijdenBenothmen1
 
Ethereum Block Chain
Ethereum Block ChainEthereum Block Chain
Ethereum Block ChainSanatPandoh
 
How to be a smart contract engineer
How to be a smart contract engineerHow to be a smart contract engineer
How to be a smart contract engineerOded Noam
 
Starkware: Account Abstraction
Starkware: Account AbstractionStarkware: Account Abstraction
Starkware: Account AbstractionTinaBregovi
 

Similar to Ethereum hackers (20)

Ethereum: From there to here, and ownards yonder
Ethereum: From there to here, and ownards yonderEthereum: From there to here, and ownards yonder
Ethereum: From there to here, and ownards yonder
 
Blockchain, Ethereum and Business Applications
Blockchain, Ethereum and Business ApplicationsBlockchain, Ethereum and Business Applications
Blockchain, Ethereum and Business Applications
 
A Decompiler for Blackhain-Based Smart Contracts Bytecode
A Decompiler for Blackhain-Based Smart Contracts BytecodeA Decompiler for Blackhain-Based Smart Contracts Bytecode
A Decompiler for Blackhain-Based Smart Contracts Bytecode
 
Academic Ethereum
Academic EthereumAcademic Ethereum
Academic Ethereum
 
BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session
BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session
BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session
 
Geth important commands
Geth important commandsGeth important commands
Geth important commands
 
Hello world contract
Hello world contractHello world contract
Hello world contract
 
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereum
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereumDappsmedia smartcontract _write_smartcontracts_on_console_ethereum
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereum
 
web3j Overview
web3j Overviewweb3j Overview
web3j Overview
 
Braga Blockchain - Ethereum Smart Contracts programming
Braga Blockchain - Ethereum Smart Contracts programmingBraga Blockchain - Ethereum Smart Contracts programming
Braga Blockchain - Ethereum Smart Contracts programming
 
以太坊代幣付款委託 @ Open Source Developer Meetup #12
以太坊代幣付款委託 @ Open Source Developer Meetup #12以太坊代幣付款委託 @ Open Source Developer Meetup #12
以太坊代幣付款委託 @ Open Source Developer Meetup #12
 
Best practices to build secure smart contracts
Best practices to build secure smart contractsBest practices to build secure smart contracts
Best practices to build secure smart contracts
 
The world computer
The world computerThe world computer
The world computer
 
Socket programming
Socket programmingSocket programming
Socket programming
 
Encode x NEAR: Technical Overview of NEAR 1
Encode x NEAR: Technical Overview of NEAR 1Encode x NEAR: Technical Overview of NEAR 1
Encode x NEAR: Technical Overview of NEAR 1
 
EthereumBlockchainMarch3 (1).pptx
EthereumBlockchainMarch3 (1).pptxEthereumBlockchainMarch3 (1).pptx
EthereumBlockchainMarch3 (1).pptx
 
Ethereum A to Z
Ethereum A to ZEthereum A to Z
Ethereum A to Z
 
Ethereum Block Chain
Ethereum Block ChainEthereum Block Chain
Ethereum Block Chain
 
How to be a smart contract engineer
How to be a smart contract engineerHow to be a smart contract engineer
How to be a smart contract engineer
 
Starkware: Account Abstraction
Starkware: Account AbstractionStarkware: Account Abstraction
Starkware: Account Abstraction
 

More from gavofyork

Governance in Polkadot PoC-3
Governance in Polkadot PoC-3Governance in Polkadot PoC-3
Governance in Polkadot PoC-3gavofyork
 
Polkadot, Substrate and Governance (PoC-3)
Polkadot, Substrate and Governance (PoC-3)Polkadot, Substrate and Governance (PoC-3)
Polkadot, Substrate and Governance (PoC-3)gavofyork
 
Polkadot Presentation
Polkadot PresentationPolkadot Presentation
Polkadot Presentationgavofyork
 
Parity Progress Report
Parity Progress ReportParity Progress Report
Parity Progress Reportgavofyork
 
Blockchain, ethereum and polkadot
Blockchain, ethereum and polkadotBlockchain, ethereum and polkadot
Blockchain, ethereum and polkadotgavofyork
 
Polkadot prezo
Polkadot prezoPolkadot prezo
Polkadot prezogavofyork
 
Ethereum: Next steps...
Ethereum: Next steps...Ethereum: Next steps...
Ethereum: Next steps...gavofyork
 
Where can smart contracts take us?
Where can smart contracts take us?Where can smart contracts take us?
Where can smart contracts take us?gavofyork
 
Blockchain what and why-
Blockchain  what and why-Blockchain  what and why-
Blockchain what and why-gavofyork
 
So now we've built Ethereum, WTF is it?
So now we've built Ethereum, WTF is it?So now we've built Ethereum, WTF is it?
So now we've built Ethereum, WTF is it?gavofyork
 
The world computer (short)
The world computer (short)The world computer (short)
The world computer (short)gavofyork
 
The world computer general
The world computer generalThe world computer general
The world computer generalgavofyork
 
Bazaar services
Bazaar servicesBazaar services
Bazaar servicesgavofyork
 
Relative truth
Relative truthRelative truth
Relative truthgavofyork
 
ÐΞVcon: Introduction
ÐΞVcon: IntroductionÐΞVcon: Introduction
ÐΞVcon: Introductiongavofyork
 
The Ethereum ÐApp IDE: Mix
The Ethereum ÐApp IDE: MixThe Ethereum ÐApp IDE: Mix
The Ethereum ÐApp IDE: Mixgavofyork
 

More from gavofyork (20)

Governance in Polkadot PoC-3
Governance in Polkadot PoC-3Governance in Polkadot PoC-3
Governance in Polkadot PoC-3
 
Polkadot, Substrate and Governance (PoC-3)
Polkadot, Substrate and Governance (PoC-3)Polkadot, Substrate and Governance (PoC-3)
Polkadot, Substrate and Governance (PoC-3)
 
Polkadot Presentation
Polkadot PresentationPolkadot Presentation
Polkadot Presentation
 
Parity Progress Report
Parity Progress ReportParity Progress Report
Parity Progress Report
 
Blockchain, ethereum and polkadot
Blockchain, ethereum and polkadotBlockchain, ethereum and polkadot
Blockchain, ethereum and polkadot
 
Polkadot prezo
Polkadot prezoPolkadot prezo
Polkadot prezo
 
Ethereum: Next steps...
Ethereum: Next steps...Ethereum: Next steps...
Ethereum: Next steps...
 
Where can smart contracts take us?
Where can smart contracts take us?Where can smart contracts take us?
Where can smart contracts take us?
 
Blockchain what and why-
Blockchain  what and why-Blockchain  what and why-
Blockchain what and why-
 
So now we've built Ethereum, WTF is it?
So now we've built Ethereum, WTF is it?So now we've built Ethereum, WTF is it?
So now we've built Ethereum, WTF is it?
 
The world computer (short)
The world computer (short)The world computer (short)
The world computer (short)
 
The world computer general
The world computer generalThe world computer general
The world computer general
 
Bazaar services
Bazaar servicesBazaar services
Bazaar services
 
Allegality
AllegalityAllegality
Allegality
 
Relative truth
Relative truthRelative truth
Relative truth
 
ÐΞVcon: Introduction
ÐΞVcon: IntroductionÐΞVcon: Introduction
ÐΞVcon: Introduction
 
The Ethereum ÐApp IDE: Mix
The Ethereum ÐApp IDE: MixThe Ethereum ÐApp IDE: Mix
The Ethereum ÐApp IDE: Mix
 
Solidity
SoliditySolidity
Solidity
 
Whisper
WhisperWhisper
Whisper
 
Crypto-law
Crypto-lawCrypto-law
Crypto-law
 

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!