CryptoVarna Meetup №2
Bitcoin Blockchain
by Galin Dinkov
24 Oct 2017
Introduction
About CryptoVarna
CryptoVarna is a group of people interested in Blockchain technologies, cryptocurrencies, ICOs and the possibilities they provide. It is an open group with members specialized in different fields, from informatics to law.
Facebook Group:
https://www.facebook.com/groups/123317971755498
Meetup.com:
https://www.meetup.com/preview/CryptoVarna-Blockchains-Bitcoins-Ethereum
Slack:
About VarnaLab
VarnaLab is an independent hacker’s space where people with common interest can meet, work and drink beer. The spheres of interest include but not limited to: software technologies, hardware and electronics, art and design, photography, gaming and more.
It is part of huge network of 1600 hacker’s spaces worldwide.
VarnaLab is a non-profit organization and is free for everyone. It is financially supported by its members by a non-fixed donations.
Facebook Page:
https://www.facebook.com/varnalab/
Web:
Trello:
Github:
Motivation for Bitcoin Creation
Bitcoin Blockchain’s Main Characteristics
The Blockchain is…
Data Structure
The Blockchain is…
Ledger
Date | Description | Credit | Debit | Balance |
2/20/2011 | Alice to Bob | -$10 | | $90 |
2/20/2011 | Bob from Alice | | +$10 | $10 |
3/20/2011 | Bob to Eve | -$5 | | $5 |
The Blockchain is…
Distributed
The Blockchain is…
Immutable
The Blockchain is…
Secure
The Blockchain is…
Anonymous (Pseudo)
The Blockchain is…
Autonomous
The Blockchain is…
Public
Digital Money
I want to create digital money...
How They Made It?
Where are the balances?
How to verify the owner?
How to ensure the transactions order?
P2P Network
How to reach consensus in the network?
Example: https://blockexplorer.com/
How to deal with the forks?
Going Deep...
Cryptography
Hash Function
Hash Usage
‘hello’
SHA-256: 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824�SHA-256d: 9595c9df90075148eb06860365df33584b75bff782a510c6cd4883a419833d50
RIPEMD-160: b6a9c8c230722b7c748331a8b450f05566dc7d0f
Used:
Public-Key Cryptography
RSA
Example: https://git.io/v5exi
Elliptic curve cryptography (ECC)
ECC Domain Parameters:
p - prime field (modulo)
a,b - curve parameters
G - generator point
n - ord(G) (n x G = 0)
h - cofactor of n
Private Key (k) = Random Number < n - 1
Public Key (K) = k ∗ G
K = 1E99423A4ED27608A15A2616A2B0E9E52CED330AC530EDCC32C8FFC6A526AEDD * G
K = (x, y)�x = F028892BAD7ED57D2FB57BF33081D5CFCF6F9ED3D3D7F159C2E2FFF579DC341A�y = 07CF33DA18BD734C600B96A72BBC4749D5141C90EC8AC328AE52DDFE2E505BDB
Key Size Recommendations
Security Risks
Keys & Addresses
Bitcoin Address
Version = 1 byte of 0 (zero); on the test network, this is 1 byte of 111�Key hash = Version concatenated with RIPEMD-160(SHA-256(Public Key))�Checksum = 1st 4 bytes of SHA-256(SHA-256(Key hash))�Bitcoin Address = Base58Encode(Key hash concatenated with Checksum)
14fxjE3qepjaYxiqs5WPtDx5y7vMQP81mW
Private Key (k) = Random Number < n - 1
Public Key (K) = k ∗ G
Wallets
Transactions
Transaction Lifecycle
Signature and Verification
Standard Transaction Scripts:
scriptPubKey: OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG�scriptSig: <sig> <pubKey>
Mining
Miners...
Generation (Coinbase) Transaction
The Times 03/Jan/2009 Chancellor on brink of second bailout for banks
Transaction Fees
Transaction Fees = Sum(Inputs) - Sum(Outputs)
Transaction Priority
Priority = Sum(ValueOfInput * InputAge) / TransactionSize
References
Final
by Galin Dinkov