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

How Bitcoin Works

How Bitcoin Works

Alex Klyuev

January 05, 2021
Tweet

More Decks by Alex Klyuev

Other Decks in Technology

Transcript

  1. Introduction Computer Science Human Behavior / Incentives / Economics •

    Bitcoin is a digital asset and network that has real economic value • It is able to secure this network through the use of human incentives 2
  2. Introduction Takes advantage of existing technologies: • Written in C++

    • Public-key cryptography • SHA-256 hash function • Peer-to-peer networking P2P network Client-server model 3
  3. Value Proposition Two core concepts behind Bitcoin… 1. A currency

    / store of value / monetary asset that is native to the Internet • Traditional currencies have adapted to the Internet, but have a lot of friction on the backend • Very slow especially in international transactions • Bitcoin can be transacted in with ease anywhere in the world as long as participants have an Internet connection 2. Trustless / decentralized: not reliant on any fallible central entity such as a government, company, etc. 4
  4. Digital Ledger Bitcoin builds on Internet-based currencies that have been

    tried before... • An Internet-based currency is simply a ledger - recorded data on: ◦ How much currency belongs to each account ◦ Transactions that occur • Public-key cryptography ensures that each user has secure access to their “wallet” that holds their currency and allows them to transact 5
  5. Key Challenges The integrity of ledgers are traditionally maintained by

    a centralized system of participants - banking companies, governments & legal systems, etc. The challenge with a decentralized solution to money is that… 1. Everyone has to agree and believe in the accuracy of the transaction data 2. The network must be secure against bad actors who are looking to produce fraudulent data for personal gain (a job that is traditionally done by a centralized entity) 6
  6. Bitcoin’s Solutions Everyone has to agree and believe in the

    accuracy of the transaction data • Bitcoin solves this problem through the use of a shared public ledger called the blockchain • By broadcasting the entire ledger, everyone can independently verify its accuracy 1 7
  7. Blockchain • Every ~10 minutes a new “block” is created,

    which is a data structure that holds information on all the transactions that occurred in the previous 10 minutes • Each block also contains a unique hash and the hash of the previous block... This block’s hash Transaction data 8
  8. Blockchain The contents of each block + the previous block’s

    hash are put through a one-way hash function which creates an irreversible chain of all the transaction data that has taken place in the network 9
  9. Bitcoin’s Solutions The network must protect against fraud • The

    trickier one of the two...how do you verify that each new block does not contain fraudulent data, without a central entity to oversee transactions? 2 Double-Spending Problem Byzantine Generals’ Problem 10
  10. Bitcoin’s Solutions The network must protect against fraud • Instead

    of a central entity, Bitcoin relies on a peer-to-peer network of nodes which are each running the entire blockchain • Currently there are around ~100,000 nodes around the world and the blockchain is around ~340 GB • New blocks are confirmed to be valid and added to the chain by the network through a distributed consensus protocol called proof-of-work 2 11
  11. Proof-of-Work & Mining • The hashing of each block is

    not done automatically - there is a competition between participating nodes for gets to complete the hash • The competition is a computationally expensive puzzle that can only get solved by expending a lot of CPU power • The node that cracks the puzzle first is able to create the hash, and the block is broadcasted to all nodes as a confirmed block to be added to the chain • This node is rewarded by receiving some amount of Bitcoin 12
  12. Proof-of-Work & Mining • The nodes that participate in this

    competition are called miners, an analogy to physical miners that expend energy to procure precious metals Bitcoin Mining Gold Mining 13
  13. Proof-of-Work & Mining • The point of all of this

    is to produce a history of all transactions that is computationally impractical to modify • Any attacker that wants to produce fake data would have to have over 51% of total CPU power in the network ◦ Currently estimated to cost around ~$10-20M per day ◦ Even if possible, the addition of fake data would ruin the network; if motivated by financial reward, the attacker is incentivized to simply use their CPU power to mine Bitcoin 14
  14. Proof-of-Work & Mining • This expensive procedure to produce a

    new block is known as proof-of-work • Network participants can be assured that new blocks are valid because they have undergone this process • The financial incentive behind creating new blocks is what secures the network • This is the core innovation behind Bitcoin 15
  15. Miners Economic reward Economic cost Existing chain of transaction data

    Validation process New block “Proof of Work” 17
  16. References Resources • Bitcoin whitepaper: https://bitcoin.org/en/bitcoin-paper • Bitcoin.org: https://bitcoin.org/en/ •

    Bitcoin wiki: https://en.bitcoin.it/wiki/Main_Page Images • P2P network: https://en.wikipedia.org/wiki/Peer-to-peer • Blockchain: https://www.youtube.com/watch?v=bBC-nXj3Ng4 • Double-spending problem: https://www.tutorialspoint.com/blockchain/blockchain_double_spending.htm • Byzantine generals’ problem: https://medium.com/@paul_12056/byzantine-generals-problem-ff4bdc340e56 • Bitcoin mining farm: https://www.vanityfair.com/news/2019/11/the-big-bitcoin-heist • Gold mine: https://www.arabnews.com/node/1593651/business-economy 18