Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Cryptography: How is Bitcoin safer than your bank

U-Zyn Chua
August 18, 2012

Cryptography: How is Bitcoin safer than your bank

Keynote at GeekCamp Singapore 2012 (http://geekcamp.sg/schedule/view_schedule/2012)

Fiat currencies and Bitcoin are valuable, despite being physically intangible, unlike gold is. However, while fiat currencies rely on government regulations to maintain their values and security, Bitcoin requires none of the authority interventions or appointed watchdogs, all thanks to cryptography.

This talk covers basic and intermediate topics on how cryptology aids in the working of Bitcoin P2P network.

U-Zyn Chua

August 18, 2012
Tweet

More Decks by U-Zyn Chua

Other Decks in Technology

Transcript

  1. How is Bitcoin
    safer than your bank?
    Cryptography
    by U-Zyn Chua

    View full-size slide

  2. U-Zyn Chua
    is not
    Cryptographer
    Economist

    View full-size slide

  3. U-Zyn Chua
    is
    IT Consultant @
    Security enthusiast
    Bitcoiner

    View full-size slide

  4. How many... ?
    Bitcoiner?
    Knows about Bitcoin?
    Have no idea about Bitcoin?

    View full-size slide

  5. What is Bitcoin?
    Distributed
    electronic cash protocol
    and a unit of currency

    View full-size slide

  6. What is Bitcoin?
    Satoshi Nakamoto
    Genesis block on 3 Jan 2009
    “Gone for good” since late 2010

    View full-size slide

  7. What is Bitcoin?

    View full-size slide

  8. What makes a currency?
    Scarce
    Predictable growth
    Secure
    Valuable

    View full-size slide

  9. Production is halved every 4 years
    Never more than 21 million

    View full-size slide

  10. ~USD 15/Bitcoin

    View full-size slide

  11. Problems
    Currency creation
    Keeps value stable
    Fraud prevention

    View full-size slide

  12. Cryptography
    No central bank
    No watchdog
    only
    No authority

    View full-size slide

  13. How does Bitcoin work?
    Public-key cryptography
    Peer-to-peer network
    Proof-of-work

    View full-size slide

  14. Public-key crypto
    160-bit hash (SHA-256)
    18YCR8bvxLaVCmbgY6eCavF733QDs1sQDT
    Base58-encoded
    Generate as many as you want
    215,000,000,000,000,000,000,000,000,0
    00,000,000,000 addresses per capita.

    View full-size slide

  15. Public-key crypto

    View full-size slide

  16. Transaction
    Public & broadcasted
    http://blockchain.info

    View full-size slide

  17. Transaction
    499335.01317523 1DkyBEKt5S2GDtv7aQw6rQepAvnsRyHoYM
    105555.03133700 1933phfhK3ZgFQNLGSDXvqCn32k2buXY8a
    79957.03133700 1FeexV6bAHb8ybZjqQMjJrcCrHGW9sb6uF
    53000.03133700 16cou7Ht6WjTzuFyDBnht9hmvXytg6XdVT
    50259.03133700 1CfPAfVDe1Br11SkNrk2bEMmMP3bAA5wRr
    50130.03133700 13vJZKHKBirruXwmjMaRtakzPQRRHQit1S
    50000.03133700 1P3S1grZYmcqYDuaEDVDYobJ5Fx85E9fE9
    50000.03133700 1DEpjpftLbsGiCJvJDp2F2quVRnymV8U5Q
    47458.03133700 1BBqjKsYuLEUE9Y5WzdbzCtYzCiQgHqtPN
    44914.03133700 1MR6pXDZ6gpBVN8n61SqCNF61vU8ZzRu8Y
    44512.03133700 1BVA88962SxcymHSfqXSy9F7cgXefi3zgt
    40000.03133700 16Ls6azc76ixc9Ny7AB5ZPPq6oiEL9XwXy
    40000.03133700 12HddUDLhRP2F8JjpKYeKaDxxt5wUvx5nq
    40000.03133700 1cXNTyXj4xPGopfYZNY5xfSM1EPJJvBZV
    38058.03133700 1FngtAcZsLfK89MNe7TqzyqVtSype8TiVD
    38000.03133700 18Hsgq92AUB1PYLU6MUMQXiwdebaDRo9oQ
    35000.00000000 1DAmsh8tHUtH2cVUDMxnDkKr8SaPNkb36h
    31000.03133700 12ib7dApVFvg82TXKycWBNpN8kFyiAN1dr
    30000.03133700 1MyGwFAJjVtB5rGJa32M6Yh46cGirUta1K
    Bitcoin richest

    View full-size slide

  18. Transaction
    499335.01317523 1DkyBEKt5S2GDtv7aQw6rQepAvnsRyHoYM
    105555.03133700 1933phfhK3ZgFQNLGSDXvqCn32k2buXY8a
    79957.03133700 1FeexV6bAHb8ybZjqQMjJrcCrHGW9sb6uF
    53000.03133700 16cou7Ht6WjTzuFyDBnht9hmvXytg6XdVT
    50259.03133700 1CfPAfVDe1Br11SkNrk2bEMmMP3bAA5wRr
    50130.03133700 13vJZKHKBirruXwmjMaRtakzPQRRHQit1S
    50000.03133700 1P3S1grZYmcqYDuaEDVDYobJ5Fx85E9fE9
    50000.03133700 1DEpjpftLbsGiCJvJDp2F2quVRnymV8U5Q
    47458.03133700 1BBqjKsYuLEUE9Y5WzdbzCtYzCiQgHqtPN
    44914.03133700 1MR6pXDZ6gpBVN8n61SqCNF61vU8ZzRu8Y
    44512.03133700 1BVA88962SxcymHSfqXSy9F7cgXefi3zgt
    40000.03133700 16Ls6azc76ixc9Ny7AB5ZPPq6oiEL9XwXy
    40000.03133700 12HddUDLhRP2F8JjpKYeKaDxxt5wUvx5nq
    40000.03133700 1cXNTyXj4xPGopfYZNY5xfSM1EPJJvBZV
    38058.03133700 1FngtAcZsLfK89MNe7TqzyqVtSype8TiVD
    38000.03133700 18Hsgq92AUB1PYLU6MUMQXiwdebaDRo9oQ
    35000.00000000 1DAmsh8tHUtH2cVUDMxnDkKr8SaPNkb36h
    31000.03133700 12ib7dApVFvg82TXKycWBNpN8kFyiAN1dr
    30000.03133700 1MyGwFAJjVtB5rGJa32M6Yh46cGirUta1K
    Bitcoin richest
    500k BTC
    ~ USD 7.5 million
    stored in a
    PUBLIC
    string!

    View full-size slide

  19. Mining
    Adding tx records to ledger
    Confirm transactions
    Profit (50 BTC / block)
    ???

    View full-size slide

  20. Block chain
    Broadcasted transaction database
    since Day 1 (Jan 3 2009)
    1 block every 10 minutes
    (how?)
    Currently at 2.1GB

    View full-size slide

  21. Block
    Field Purpose
    Version Client version
    Previous hash Hash of previous block
    Merkle root Hash of transactions
    Timestamp Current UNIX time
    Target Target hash
    Nonce 32-bit number

    View full-size slide

  22. Target
    1 block every 10 minutes
    (this is how!)
    A (max) target hash output
    Generate lower hash than the target
    The lower the target is, the harder it is

    View full-size slide

  23. Target
    Let’s look back at block’s component
    and assume that we want to make
    a hash with the following target
    0x0000000000000fffffffff.....

    View full-size slide

  24. Target
    Difficulty is adjusted every
    2016 blocks (2 weeks)
    Based on time it takes for
    the last 2016 blocks
    Current chance to find a block:
    0.0000000000000001062717181778399105906984800640202593058

    View full-size slide

  25. Block generation

    View full-size slide

  26. Cryptography
    is the authority!
    is the watchdog!
    Many other clever
    features of Bitcoin

    View full-size slide

  27. Security incidents

    View full-size slide

  28. Security incidents

    View full-size slide

  29. Security incidents

    View full-size slide

  30. Is Bitcoin safe?
    https://github.com/bitcoin/bitcoin
    Reward: USD 140 million

    View full-size slide

  31. Bitcoin vs Bank
    Bitcoin Bank
    Trust no one Trust bank
    Open source Closed source
    Proven & known
    security
    Unknown & obscured
    security
    Can’t phish Prone to phish

    View full-size slide