BLOCKCHAIN
Bitcoins, Ethereum and The DAO











money
ownership
transactions
Ledger








clearing
bank
buy
sell


Types of networks


distributed, anonymous, consensus
Blockchain network



Mining bitcoins (BTC)
- confirm (extended) blockchain
- compute next block
- difficulty increases
- dedicated hardware (ASIC's)
- ~10 minutes per block
- collect mining fee (winner takes all)
- new BTC's until 2140






A chain of BLOCKs


A CHAIN of blocks


money
ownership
transactions
Ledger

bitcoin
wallet
any currency
smart contracts
any asset
Distributed Autonomous Organization
DAO
blockchain technology

Ethereum
- Blockchain
- Whisper (communication)
- Swarm (distributed storage)
Ethereum
- Blockchain
- Whisper (communication)
- Swarm (distributed storage)
- crowd sale $168M
- ether (ETH, Wei)
- Ethereum Virtual Machine
- Solidium
- smart contract
- gas, gas limit
Mining ether (ETH)
- execute smart contracts
- confirm extended blockchain
- compute next block
- difficulty increases
- ~10 seconds per block
- collect mining fee
- winner takes most, but not all
- uncles


Code samples
contract SimpleStorage {
uint storedData;
function set(uint x) {
storedData = x;
}
function get() constant returns (uint retVal) {
return storedData;
}
}contract Coin {
// The keyword "public" makes those variables
// readable from outside.
mapping (address => uint) public balances;
address public minter;
// Events allow light clients to react on
// changes efficiently.
event Sent(address from, address to, uint amount);
// This is the constructor whose code is
// run only when the contract is created.
function Coin() {
minter = msg.sender;
}
function send(address receiver, uint amount) {
if (balances[msg.sender] < amount) return;
balances[msg.sender] -= amount;
balances[receiver] += amount;
Sent(msg.sender, receiver, amount);
}
function mint(address receiver, uint amount) {
if (msg.sender != minter) return;
balances[receiver] += amount;
}
}mapping (address => bool) public frozenAccount;
event FrozenFunds(address target, bool frozen);
function freezeAccount(address target, bool freeze) onlyOwner {
frozenAccount[target] = freeze;
FrozenFunds(target, freeze);
}
function transfer(address _to, uint256 _value) {
if (frozenAccount[msg.sender])
throw;
...
}The DAO
Decentralized Autonomous Organisation


- DAO-tokens
- child-DAO's
- vote
- split
- curator
Hacked!
- White Hat Siphoning
- TheDarkDAO
- ETH 3.64M ($50M)

What the fork?
- do nothing
- targeted soft fork
- hard fork

No fork
- 3.64M ETH is lost to 'thieves'
- exploit remains open
- conforms to the 'DAO principles'

Soft fork
- most of the ETH can be returned to the DAO Token Holders
- exploit can be 'disabled'
- complicated process
- takes a very long time (months) to execute
- large distraction for the Ethereum Community

Hard fork
- simple, elegant and guaranteed to work
- no rollback or any other changes to the
Ethereum Blockchain unrelated to The DAO - fastest and easiest solution
- the ETH of all DAO contracts is sent to a refund contract
- this allows all DAO Token Holders to claim
their fair proportion of the ETH
- violates principle of 'immutability'
Hard fork completed
- refund contract WithdrawDAO
- block 1920000
- Jul-20-2016 01:20:40 PM


Ethereum
(ETH)
Ethereum Classic
(ETC)
- 'stolen' ETH returned
- exploit is fixed
- stakeholder consensus
verrides principle
- 'stolen' ETH gone
- exploit code unchanged
- principle over consensus
Ethereum
(ETH)
Ethereum Classic
(ETC)
buy 1 ETH
sell 1 ETH
sell 1 ETC
Blockchain, Bitcoins
By Rob Bosman
Blockchain, Bitcoins
- 121