14. Electronic Cash
Double Spending ?
Transaction Amount Reference Signed
Joe->John 2E$ Previous
Transaction
Transaction
Signed by Joe
Joe->Jane 2E$ Previous
Transaction
Transaction
Signed by Joe
Previous
transaction
sending E$
to Joe
15. Ledger to prevent double spending
Transaction Amount Balance Status
Joe->John X$ 0 Accepted
Joe->Jane X$ -X Rejected
18. First let us understand what is a
Ledger entry in Bitcoin network or
a transaction
19. What is a Bitcoin transaction
: One example transaction
From: Joe’s Anonymous Address (pub key hash)
Which contains: 50 BTC
Hash: Previous transaction
To: Bob’s Anonymous address (pub key hash)
Send: 10 BTC
To: Joe’s new Anonymous address (pub key hash)
Send: Change of 40 BTC
Signature: Proof that Joe is allowed to spend the 50
BTC
Bob will spend
using the private
key
20. Next transaction by Bob
From: Bob’s Anonymous Address (pub key hash)
Which contains: 10 BTC
Hash: Previous transaction
To : John’s Anonymous address (pub key hash)
Send: 10 BTC
Signature: Proof that Bob is allowed to spend the 50
BTC
21. How does everybody agree on
the same version of ledger?
Brilliant solution by Satoshi
Nakamoto
22. Background: Hash based proof of work
Ideal Hash Function
Arbitrary length
input
Fixed length
output
• Random mapping
• Same output for same input
What is a Hash ?
23. Background: Hash based proof of work
E.g. For 128 bit hash
Given
X
Find
Y
<Hash (X||Y) 00 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF
24. Blocks and Proofs
Previous Block’s hash
Nonce
Transaction 1
Trasnsaction 2
Transaction N
Previous Block’s hash
Nonce
Transaction 1
Trasnsaction 2
Transaction N
25. Block in progress / mining
Previous Block’s hash
Transaction 1
Trasnsaction 2
Miner’s transaction
Nonce+
Hash < Network difficulty decided target
Broadcast Proof to
the network
26. Miner’s transaction
Special transaction that transfers 25 BTC
(current) to an address provided by the
miner(reward going down)
Makes every miner’s proof of search
different
Incentive for miner
27. Network Difficulty
Adjusts to ensure blocks are
generated every 10 minutes
Ensures that probability of you finding
a block is proportional to your
computing power
29. How does this prevent
fraud?
Lot of computing power needed to
reverse a Tx few blocks ago.
Network is moving ahead
Nearly impossible to catch up.
30. Summary
Only one history(longest) is accepted
by the network
Computing power == Vote
Miner’s transactions provide incentive
for mining
31. Bitcoin as a platform for new types of
transaction
Standard Transaction
To Spend: OP_CHECKSIG
Operation in a stack
based language
Lots of other possible operations:
For example: OP_CHECKMULTSIG, OP_ADD,
OP_IF,…
Combine operations to create new transactions
32. History and Color : James Wood
http://prezi.com/4dsf-gkdyw55/bitcoins/