addresses to issuance kn - bitbox—bitcamp · • coinbase: wallet service paired with an exchange...

19
Bitcoin Anatomy

Upload: others

Post on 25-Jul-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Addresses to Issuance kn - BitBox—BitCamp · • Coinbase: Wallet Service paired with an exchange ... • Informational BIPs - Design issues, general guidelines. This type of BIP

Bitcoin Anatomy

Page 2: Addresses to Issuance kn - BitBox—BitCamp · • Coinbase: Wallet Service paired with an exchange ... • Informational BIPs - Design issues, general guidelines. This type of BIP

AddressesBitcoin Address: A 26-35 alphanumeric identifier, beginning with the number 1 or 3, that represents a possible destination for a bitcoin payment.

1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN23J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy

0. Private Key: 18E14A7B6A307F426A94F8114701E7C8E774E7F9A47E2C2035DB29A206321725

1. Public Key: 0450863AD64A87AE8A2FE83C1AF1A8403CB53F53E486D8511DAD8A04887E5B23522CD470243453A299FA9E77237716103A BC11A1DF38855ED6F2EE187E9C582BA6

2. SHA-256: 600FFE422B4E00731A59557A5CCA46CC183944191006324A447BDB2D98D4B408

3. RIPEMD-160: 010966776006953D5567439E5E39F86A0D273BEE

4. Add Version Byte: 00010966776006953D5567439E5E39F86A0D273BEE

5. SHA-256: 445C7A8007A93D8733188288BB320A8FE2DEBD2AE1B47F0F50BC10BAE845C0946. SHA-256 (Again!): D61967F63C7DD183914A4AE452C9F6AD5D462CE3D277798075B107615C1A8A30

7. Add CheckSum (D61967F6): 00010966776006953D5567439E5E39F86A0D273BEED61967F6

8. Base58 Encode: 16UwLL9Risc3QfPqBUvKofHmBQ7wMtjvM

Page 3: Addresses to Issuance kn - BitBox—BitCamp · • Coinbase: Wallet Service paired with an exchange ... • Informational BIPs - Design issues, general guidelines. This type of BIP

TransactionsBitcoin Transaction: A message that signs inputs and outputs, moves bitcoin from one owner to another, and writes to the blockchain

Version Inputs Outputs Locktime

Version Inputs Outputs Locktime

Version Inputs Outputs LocktimeVersion Inputs Outputs Locktime

Page 4: Addresses to Issuance kn - BitBox—BitCamp · • Coinbase: Wallet Service paired with an exchange ... • Informational BIPs - Design issues, general guidelines. This type of BIP

TransactionsBitcoin Transaction: A message that signs inputs and outputs, moves bitcoin from one owner to another, and writes to the blockchain

Size Field Description

8 bytes Amount Value in Satoshis

1-9 bytes Locking Script Locking Script Size in Bytes

Variable Locking ScriptScript Defining Conditions

needed to Spend the Output

Unspent Transaction Output (UTXO)

Page 5: Addresses to Issuance kn - BitBox—BitCamp · • Coinbase: Wallet Service paired with an exchange ... • Informational BIPs - Design issues, general guidelines. This type of BIP

TransactionsBitcoin Transaction: A message that signs inputs and outputs, moves bitcoin from one owner to another, and writes to the blockchain

Size Field Description

32 bytes Txn Hash/IDReference to Prior

Transaction Containing the UTXO to be spent

4 bytes Output Index Index of the UTXO to be spent

1-9 bytes Unlocking Script Size Unlocking Script Size in bytes

Variable Unlocking Script Script that satisfies locking script

4 bytes Sequence Number Multipurpose

Inputs

Page 6: Addresses to Issuance kn - BitBox—BitCamp · • Coinbase: Wallet Service paired with an exchange ... • Informational BIPs - Design issues, general guidelines. This type of BIP

WalletsWallet: An broad term for how you interface with Bitcoin and manage your bitcoin

• Original Recipe Client: Written by Satoshi, Full Node, Miner • Electrum: First Simplified Payment Verification Wallet (SPV) • Coinbase: Wallet Service paired with an exchange • Armory: Industrial Strength Wallet for People running Blockchain Services • Ledger Wallet: Hardware Wallet • MetaMask: Browser Wallet • Edge: Mobile Wallet

Page 7: Addresses to Issuance kn - BitBox—BitCamp · • Coinbase: Wallet Service paired with an exchange ... • Informational BIPs - Design issues, general guidelines. This type of BIP

WalletsSigning-Only Wallet

Networked Wallet

CreateParentPrivate

Key

DeriveParentPublicKey

DeriveChildPublicKeys

SignTxes

BroadcastTxes

DistributePublicKeys

MonitorFor

Outputs

CreateUnsigned

Txes

Page 8: Addresses to Issuance kn - BitBox—BitCamp · • Coinbase: Wallet Service paired with an exchange ... • Informational BIPs - Design issues, general guidelines. This type of BIP

Wallets

Not your keys, Not your coins

Page 9: Addresses to Issuance kn - BitBox—BitCamp · • Coinbase: Wallet Service paired with an exchange ... • Informational BIPs - Design issues, general guidelines. This type of BIP

MiningA miner hashes the block header iterating one parameter(the nonce) until a resulting hash is below the target

1. A Miner listens for the most recent transactions on the network2. Reconciles these transactions in the mempool (discards invalid txns)3. Build the Transaction Merkle Tree4. Builds Block Header, including transaction Merkle root5. Hashes Block Header iterating the nonce each time

a) If a hash which is less than the target is found, it is a valid, winning block and is broadcasted to the networkb) Other miners upon validating the block abandon the work they’ve done on their respective blocks and start

building a new block with the wining block as the previous block c) In case of neither of the above, each miner continues hashing the block header

6. Miners cannot access coinbase coins for 100 blocks in case of a fork

Page 10: Addresses to Issuance kn - BitBox—BitCamp · • Coinbase: Wallet Service paired with an exchange ... • Informational BIPs - Design issues, general guidelines. This type of BIP

Network

Lite Client

Full Node

Miners

Page 11: Addresses to Issuance kn - BitBox—BitCamp · • Coinbase: Wallet Service paired with an exchange ... • Informational BIPs - Design issues, general guidelines. This type of BIP

BlocksSize Field Description

4 bytes Version Version number for upgrading

32 bytes (256 bits) Previous Block Hash Hash of Previous (Parent) Block Header

32 bytes (256 bits) Merkle Root Root Hash of Merkle Tree of Transactions

4 bytes Timestamp Unix Timestamp (sec)

4 bytes Target Hash below which a block hash must be in order to Win

4 bytes Nonce Counter which the miner iterates in order to get new hashes

Page 12: Addresses to Issuance kn - BitBox—BitCamp · • Coinbase: Wallet Service paired with an exchange ... • Informational BIPs - Design issues, general guidelines. This type of BIP

Genesis Block00000000 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................00000020 00 00 00 00 3B A3 ED FD 7A 7B 12 B2 7A C7 2C 3E ....;£íýz{.²zÇ,>00000030 67 76 8F 61 7F C8 1B C3 88 8A 51 32 3A 9F B8 AA gv.a.È.ÈŠQ2:Ÿ¸ª00000040 4B 1E 5E 4A 29 AB 5F 49 FF FF 00 1D 1D AC 2B 7C K.^J)«_Iÿÿ...¬+|00000050 01 01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 ................00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................00000070 00 00 00 00 00 00 FF FF FF FF 4D 04 FF FF 00 1D ......ÿÿÿÿM.ÿÿ..00000080 01 04 45 54 68 65 20 54 69 6D 65 73 20 30 33 2F ..EThe Times 03/00000090 4A 61 6E 2F 32 30 30 39 20 43 68 61 6E 63 65 6C Jan/2009 Chancel000000A0 6C 6F 72 20 6F 6E 20 62 72 69 6E 6B 20 6F 66 20 lor on brink of 000000B0 73 65 63 6F 6E 64 20 62 61 69 6C 6F 75 74 20 66 second bailout f000000C0 6F 72 20 62 61 6E 6B 73 FF FF FF FF 01 00 F2 05 or banksÿÿÿÿ..ò.000000D0 2A 01 00 00 00 43 41 04 67 8A FD B0 FE 55 48 27 *....CA.gŠý°þUH'000000E0 19 67 F1 A6 71 30 B7 10 5C D6 A8 28 E0 39 09 A6 .gñ¦q0·.\Ö¨(à9.¦000000F0 79 62 E0 EA 1F 61 DE B6 49 F6 BC 3F 4C EF 38 C4 ybàê.aÞ¶Iö¼?Lï8Ä00000100 F3 55 04 E5 1E C1 12 DE 5C 38 4D F7 BA 0B 8D 57 óU.å.Á.Þ\8M÷º..W00000110 8A 4C 70 2B 6B F1 1D 5F AC 00 00 00 00 ŠLp+kñ._¬....

Page 13: Addresses to Issuance kn - BitBox—BitCamp · • Coinbase: Wallet Service paired with an exchange ... • Informational BIPs - Design issues, general guidelines. This type of BIP

Genesis Block

Page 14: Addresses to Issuance kn - BitBox—BitCamp · • Coinbase: Wallet Service paired with an exchange ... • Informational BIPs - Design issues, general guidelines. This type of BIP

BlockchainPrev Block Hash

Merkle Root

Timestamp

Nonce

Target

Version

Prev Block Hash

Merkle Root

Timestamp

Nonce

Target

Version

Prev Block Hash

Merkle Root

Timestamp

Nonce

Target

Version

Page 15: Addresses to Issuance kn - BitBox—BitCamp · • Coinbase: Wallet Service paired with an exchange ... • Informational BIPs - Design issues, general guidelines. This type of BIP

Merkle Tree

DataBlocks

Hash1Hash 1-0

+Hash 1-1hash( )

Hash0Hash 0-0

+Hash 0-1hash( )

Hash 0+

Hash 1hash( )

Top Hash

Hash0-0

hash(L1)

Hash0-1

hash(L2)

Hash1-0

hash(L3)

Hash1-1

hash(L4)

L1 L2 L3 L4

Page 16: Addresses to Issuance kn - BitBox—BitCamp · • Coinbase: Wallet Service paired with an exchange ... • Informational BIPs - Design issues, general guidelines. This type of BIP

Coinbase

Where all bitcoin come from

(not the company)

Page 17: Addresses to Issuance kn - BitBox—BitCamp · • Coinbase: Wallet Service paired with an exchange ... • Informational BIPs - Design issues, general guidelines. This type of BIP

Issuance•Block Reward with Every Block •Halves every ~4years • 50₿, 25₿, 12.5₿ . . . •Next halving will be in ~2020 • Just under 21 Million •Fully Issued by year 2140

Page 18: Addresses to Issuance kn - BitBox—BitCamp · • Coinbase: Wallet Service paired with an exchange ... • Informational BIPs - Design issues, general guidelines. This type of BIP

Issuance

Page 19: Addresses to Issuance kn - BitBox—BitCamp · • Coinbase: Wallet Service paired with an exchange ... • Informational BIPs - Design issues, general guidelines. This type of BIP

BIPSBitcoin Improvement Proposals

• Created by Amir Taaki, First Person to Re-implement Bitcoin • Standards Track BIPs - Changes to the network protocol, block or transaction validation, or anything

affecting interoperability.• Informational BIPs - Design issues, general guidelines. This type of BIP is NOT for proposing new

features and do not represent community consensus • Process BIPs - Describes or proposes a change in process. Similar to Standards BIPs but apply

outside the Bitcoin protocol. • Basis for EIPs and BDIPs • BIP32 - HD Wallets Standard