Blockchain 1.0-compressed
Blockchain 1.0-compressed
1st Application
Cryptocurrency Bitcoin
Bitcoin
• No trusted party.
• Decentralized ledgers on Internet.
• It is peer to peer network: Distribute and record
transactions.
Properties
• Pre-image Resistant: Given h, hard
to find m such that h = hash(m).
• Second Pre-image Resistant:
Given m1, hard to find m2 such
that hash(m1) = hash(m2)
• Collision Resistant: Hard to find
m1 and m2 such that
hash(m1) = hash(m2).
Symmetric Cryptosystem
• Caeser Cryptosystem:
Public-Key Cryptography
by Diffi & Helleman
• No need to share the secret key before communication
(Unlike symmetric cryptosystem),
• Every user has two keys:
Public key: is made public
Private key: is private to the user
• One can encrypt (lock) with both keys but decrypt
(open) can be done by the key which is different from
encryption key.
• Can be used in shared session key set up.
Correctness: Decsk(Encpk(m)) = m
7
ELLIPTIC CURVE CRYPTOSYSTEMS
10.8
From Behroun Forouzan and Debdeep Mukhopadhyay
ECC as Light – weight Encryption
ECDSA in Bitcoin
secp256k1 curve (Bitcoin) parameters
order(G) = q is a prime,
where q = FFFFFFFF FFFFFFFF FFFFFFFF
FFFFFFFF BAAEDCE6 AF48A03B
BFD25E8C D0364141
Signature
Alice
Everyone else
Alice’s
Unique
Hand writing
Signature
Verify
function
Signature is independent of the
message
Indeed
signed by Alice
Digital Signatures
Alice
Everyone else
Sign Signature
function for M
Verify
function
double-spending attack
signed by pkGoofy
signed by pkGoofy
Pay to pkAlice : H( )
Pay to pkAlice : H( )
signed by pkGoofy
signed by pkGoofy
CreateCoin [uniqueCoinID]
CreateCoin [uniqueCoinID]
Centralised Goofy Coin
Genesis
Block prev: H( ) prev: H( ) prev: H( )
transID: 71 transID: 72 transID: 73
Transaction Hash
OUTPUT
INPUT Bob’s
5BTC Address
Locktime
• Verifier knows T0 T2
• How can verifier authenticate leaf D2 ?
T3
• Solution: recompute T0 using D2
• Example authenticate D2 , send D3 T3 T2
D3
• Verify T0 = H( H( T3 || H( D2 || D3 )) || T2 )
T0
T1 T2
T3 T4 T5 T6
D0 D1 D2 D3 D4 D5 D6 D7
Hash puzzles:
To create block, find nonce s.t.
H(nonce ‖ prev_hash ‖ tx ‖ … ‖ tx) is very small
SHA 256
Hash puzzles:
nonce
To create block, find nonce s.t. prev_h
H(nonce ‖ prev_hash ‖ tx ‖ … ‖ tx) is very small Tx
SHA 256 Tx
Target
space
4. Other nodes accept the block only if all transactions in it are valid
(unspent, valid signatures)
5. Nodes express their acceptance of the block by working on creating
the next block
Blockchain approach to choose a node
Consensus Algorithm (Proof of Work):
• Random selection
• Incentive to add to longest chain
• Penalties to those adding to their chain
Reward Money
• Block subsidy for solving the puzzle was 50 BTC. It becomes half after
210000 blocks (around 4 years).
• Total reward money = Block subsidy + transaction fee
• In April 2013 the Economist have explained that bitcoin is
certainly is one of the things which are going to shape the
future of finance and payment and famously compared
bitcoin to digital gold.
• Virtual currencies: Mining digital gold, From the print edition: Finance and economics, The Economist, 13
April 2013.
• Disadvantage: requires huge amounts of energy. 54 TWe per year. Which is
electricity requirement of New Zealand or Hungary.
• assumption that a majority of the wealth in the system is controlled by honest participants.
• The rationale behind PoS is that users who have significant stakes in the system have an
economic incentive in keeping the system running according to the protocol specification, as
they risk that their stakes will become worthless if trust in the cryptocurrency vanishes.
Bitcoin Wallet
• Uses Public Key Cryptography
• Response script:
<Signature> <Public Key>
• Disadvantage of Bitcoin Transaction: For many inputs, transaction will be big.
Source: https://www.oreilly.com/library/view/mastering-bitcoin/9781491902639/ch05.html
MultiSignature (m out of n)
Challenge script:
M <Public Key 1> <Public Key 2> ... <Public Key N> N OP_CHECKMULTISIG
Challenge script:
2 <Public Key 1> <Public Key 2> <Public Key 3> 3 OP_CHECKMULTISIG
Response script:
Solution Block B
N+1
B
B
A
MB
A B
A MA B
B
A A
A B B
• Decker, C., Wattenhofer, R.: Information propagation in the bitcoin network. In: IEEE P2P. (2013)
Total Bitcoin
• The rate at which the new Bitcoins are
generated is designed to slowly decrease
towards zero, and will reach zero when almost
21 million Bitcoins are created.
• Then, the miners’ revenue will be only from
transaction fees
Blockchain: When to use
References
• Book by Arvind Narayanan, Joseph Bonneau, Edward Felten, Andrew Miller, Steven Goldfeder
Bitcoin and Cryptocurrency Technologies
• An Introduction to Bitcoin, S. Vijayakumaran,www.ee.iitb.ac.in/~sarva/bitcoin.html
THANK YOU