Cryptotransactions : Mechanics - PowerPoint PPT Presentation

cryptotransactions mechanics n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Cryptotransactions : Mechanics PowerPoint Presentation
Download Presentation
Cryptotransactions : Mechanics

play fullscreen
1 / 94
Cryptotransactions : Mechanics
180 Views
Download Presentation
farica
Download Presentation

Cryptotransactions : Mechanics

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Innovation and Cryptoventures Cryptotransactions: Mechanics Campbell R. Harvey Duke Universityand NBER February 1, 2018

  2. Class discussion focuses on pp. 32-78 Campbell R. Harvey 2018

  3. The Landscape http://coinmarketcap.com/ • Bitcoin is the leader (approximate $200 billion in market capitalization) founded in 2009 • Ethereumis #2 with $100+ billion in market capitalization • Currently, Coinmarketcap.com lists over 1000 crypto-currencies. However, 98% of them are highly illiquid (and not secure as we will discover). Campbell R. Harvey 2018

  4. Last year’s class: January 21, 2017 3:25pm Campbell R. Harvey 2018

  5. February 2, 2018 8:40am Campbell R. Harvey 2018

  6. The Landscape • Visa/Mastercard/Paypal are centralized and for profit businesses • Bitcoin and others operate on peer-to-peer (P2P) networks, i.e. distributed • Bitcoin network is “guaranteed” by cryptographic algorithms rather than governments or corporations – you don’t need to know the identity of the nodes nor the miners or trust them • The currency “bitcoin” is a result of the Bitcoin network, i.e. Bitcoin is not just a currency. Campbell R. Harvey 2018

  7. The Innovation • Cyptocurrencieshave been around since the 1980s • The early ones, Digicash and Ecash failed because they did not provide a solution to the “double spend” problem. That is, with the same digital key you could spend twice or more. • Bitcoin solves the double spend problem Campbell R. Harvey 2018

  8. Triple-Entry Accounting • Usually, we think of a transaction as having a debit and a credit (double entry accounting) • With Bitcoin, there is a third entry. Every transaction goes into a repository of common knowledge. • This repository or public distributed ledger is highly secure and maintained by everyone on the network • The public distributed ledger is the final word – so there can be no disagreement about the debits and credits and there can be no “double spending” • The public ledger is called a“blockchain” Campbell R. Harvey 2018

  9. The Founder https://bitcoin.org/bitcoin.pdf Campbell R. Harvey 2018 Published on Internet November 2008

  10. Craig, Dorian, Hal, or Nick? The Founder Electronic payment system P2P No double spending Secure via hash Warning about majority of computing power https://bitcoin.org/bitcoin.pdf Published November 2008 Campbell R. Harvey 2018

  11. The Founder Published March 14, 2014 Campbell R. Harvey 2018

  12. The Founder Published March 14, 2014 Campbell R. Harvey 2018

  13. The Founder Campbell R. Harvey 2018 Published May 2, 2016. Earlier outed in Wired and Gizmodo (December 2015)

  14. The Founder https://www.cryptocoinsnews.com/technical-proof-craig-wright-not-satoshi-nakamoto/ Campbell R. Harvey 2018 Published May 2, 2016. Earlier outed in Wired and Gizmodo (December 2015)

  15. The Beginning • An Open Source Project, with developer mailing list and github repositories • Satoshi remained a visible member of the community until December, 2010 before disappearing • Satoshi handed over development to Gavin Andresen • Core development team maintains the reference client Bitcoin-QT (GUI) / bitcoind • There is are many competing proposals for the future of bitcoin – yet no centralized authority to decide on which one is the best Source: Brad Wheeler, Bitcoin: What is it? Campbell R. Harvey 2018

  16. Competing Forks • Bitcoin’s forks • Litecoin (October 7, 2011) [2.5 minute block time, 84 million max coins, and different hashing algo, scrypt (which is memory intensive). Also, first to adopt SegWit and first to have a Lightning Network transaction.] • Bitcoin Cash (August 1, 2017) [Increased blocksize to 8mb; it is only 1mb in Bitcoin] • Bitcoin Gold [Uses equihash. This is a memory intensive hashing program that is linked to the amount or RAM not processing power. Also used in Z-Cash.] Campbell R. Harvey 2018 http://orbilu.uni.lu/bitstream/10993/22277/2/946.pdf https://en.wikipedia.org/wiki/Bitcoin_scalability_problem

  17. Evolution of Bitcoin • Bitcoin changes • Bitcoin v0.1 was released January 9, 2009 • Latest version is v0.15.1 released November 11, 2017 https://bitcoin.org/en/version-history • List of BIPS (Bitcoin Improvement Proposals) at https://github.com/bitcoin/bips Campbell R. Harvey 2018

  18. Genesis Block • The network was “started” January 3, 2009 with the Genesis Block Campbell R. Harvey 2018

  19. Foundation/MIT Digital Currency Initiative • Gavin Andresen (Lead Core Dev) and team moved from Bitcoin Foundation to MIT Digitial Currency Initiative [Bitcoin price, April 22, 2015 = $451] http://gavintech.blogspot.com/2015/04/joining-mit-media-lab-digital-currency.html • Mike Hearn (senior developer) calls bitcoin a “failed project” [Bitcoin price January 15, 2015 = $429] https://www.theguardian.com/technology/2016/jan/15/mike-hearn-senior-bitcoin-developer-says-currency-failed-experiment Campbell R. Harvey 2018

  20. Many Obits 2015 2011 2012 2016 2013 2017 2014 https://99bitcoins.com/bitcoinobituaries/ Campbell R. Harvey 2018

  21. Many Obits Only other top-25 business school that offers a blockchain course is NYU. Instructor is David Yermack. https://99bitcoins.com/bitcoinobituaries/ Campbell R. Harvey 2018

  22. Many Obits The cryptocurrency “won’t end well,” he told an investor conference in New York on Tuesday, predicting it will eventually blow up. “It’s a fraud” and “worse than tulip bulbs.” If a JPMorgan trader began trading in bitcoin, he said, “I’d fire them in a second. For two reasons: It’s against our rules, and they’re stupid. And both are dangerous.” [Bitcoin price September 12, 2017= $4,198] Campbell R. Harvey 2018 https://www.bloomberg.com/news/articles/2017-09-12/jpmorgan-s-ceo-says-he-d-fire-traders-who-bet-on-fraud-bitcoin

  23. https://www.vanityfair.com/news/2017/09/jamie-dimon-billion-dollar-secret-jp-morganhttps://www.vanityfair.com/news/2017/09/jamie-dimon-billion-dollar-secret-jp-morgan Campbell R. Harvey 2018

  24. https://blogs.wsj.com/moneybeat/2018/01/09/jamie-dimon-i-regret-calling-bitcoin-a-fraud/https://blogs.wsj.com/moneybeat/2018/01/09/jamie-dimon-i-regret-calling-bitcoin-a-fraud/ Campbell R. Harvey 2018

  25. The Mechanics How does it work?* • Currently, 12.5 bitcoins are produced every 10 minutes • Only miners get new bitcoins • Size of each batch of new coins halves approximately every 4 years; coins divisible to 8 decimals places; 1 bitcoin=100,000,000 satoshi; bitcoin also known by BTC https://en.bitcoin.it/wiki/Units Called “bits” Campbell R. Harvey 2018 *I have borrowed liberally from a number of sources, including, King, Williams, and Yanofsky2013, Quartz.

  26. The Mechanics How does it work? • In the year 2140, new coins go to zero* which caps the number of coins at near 21 million, but production slows 3.125 Bitcoins 6.25 Bitcoins 12.5 Bitcoins 2016 25 Bitcoins 2012 *Assumes divisibility is unchanged from 100,000,000. It is would be a non-controversial change in the bitcoin code to change the divisibility. This would increase the production time – but would not impact the cap of 21 million. 50 Bitcoins per block 2009 Campbell R. Harvey 2018

  27. The Mechanics Mining • Miners are competitive bookkeepers • Think of a huge public distributed ledger containing the history of every bitcoin transaction • Every time someone wants to send bitcoins to someone else, the transfer is validated by all nodes on the network • Make sure the person has the bitcoins to transfer • If the person has the bitcoins, it is added to the ledger • To secure the ledger, the miners seal it behind computational code • There can be no double spending and no counterfeiting Campbell R. Harvey 2018

  28. The Mechanics Mining • Miners are rewarded for their work in validating and sealing the ledger • The miner rewarded is the first one to validate and seal Campbell R. Harvey 2018

  29. The Mechanics Double spending • Want to avoid spending the same currency more than once • Traditional banks have networks to prevent this. For example, you have $100 in your bank account and write two checks for $100. The first person to cash the check gets the $100 and the other bounces (and creates lots of fees) • With Bitcoin, there is no bouncing. The ledger* is consulted to make sure the person has the bitcoin to spend • Question: How do you ensure privacy and make the transactions transparent? *Also, the pending transactions are checked, the so called “memory pool”. Campbell R. Harvey 2018

  30. The Mechanics Bitcoin accounts? • There is no traditional account, like a bank account where the bank can check your balance • The ledger keeps track of all bitcointransfers – not the balances Campbell R. Harvey 2018

  31. The Mechanics Bitcoin basics • Each bitcoin address has a public+privatekey + a public address • Anyone can send to a public address • However, you need a private key to send a bitcoin from any particular address • Payments are irreversible Campbell R. Harvey 2018

  32. The Mechanics Simplified example: Alice buys something from Bob and sends him 1 bitcoin Alice Bob 1 BTC Campbell R. Harvey 2018

  33. The Mechanics Examples: Alice 1 BTC  Bob • Bob generates a random number (private key). There is a public address that is mathematically linked to the random number. • Bob sends the public address to Alice • Public address can change for every transaction. • Alice adds Bob’s address and the amount of bitcoins to a 'transaction' message. • Alice signs the transaction (more later on this!) • Alice broadcasts the transaction on the Bitcoin network for all to see. Campbell R. Harvey 2018

  34. The Mechanics Quoted in satoshi so 50 bitcoins Examples • Alice sends to Bob Campbell R. Harvey 2018 Graphics from King, Williams and Yanofsky (2013)

  35. The Mechanics Examples • Transaction sent to every Bitcoin node on the Internet • If the transaction is validated, it will be included in a block and eventually added to the ledger. Campbell R. Harvey 2018 Graphics from King, Williams and Yanofsky (2013)

  36. The Mechanics Examples continue: Bob buys something from Carol and sends her 1 bitcoin Alice Bob Carol 1 BTC 1 BTC Campbell R. Harvey 2018

  37. The Mechanics Examples • Bob sends Carol 1 bitcoin • Carol sets up a private key and a public address • Bob takes the bitcoin he got from Alice, uses his address and his private key to sign it over to Carol Campbell R. Harvey 2018 Graphics from King, Williams and Yanofsky (2013)

  38. The Mechanics Examples • Proposed transaction gets sent to all on network to ensure Bob has not already spent the bitcoin from Alice Other transactions that have occurred since Alice’s original transfer to Bob Campbell R. Harvey 2018 Graphics from King, Williams and Yanofsky (2013)

  39. The Mechanics Examples • If transaction validated, then added to a candidate block Campbell R. Harvey 2018 Graphics from King, Williams and Yanofsky (2013)

  40. The Mechanics The ledger • Ledger broken up into 10 minute “blocks” • Every block contains a reference to the block before it so you can trace every transaction all the way back to 2009 All of the blocks are called ablockchain Campbell R. Harvey 2018 Graphics from King, Williams and Yanofsky (2013)

  41. The Mechanics 2 Transferring ownership • A better metaphor for transferring ownership of bitcoins (instead of serial numbers) is to use the concept of lock boxes. • Basically, you're using your private key to open your lockbox and take out the values, then you're inserting it (say, via a one-way slot) into someone else's lockbox that can only be opened with a different key. Campbell R. Harvey 2018

  42. The Mechanics 2 Two people, Alice and Ted, send you bitcoin Ted Campbell R. Harvey 2018 https://www.cryptocoinsnews.com/bitcoin-transaction-really-works/

  43. The Mechanics 2 Contents of the wallet are not mixed up Campbell R. Harvey 2018 https://www.cryptocoinsnews.com/bitcoin-transaction-really-works/

  44. The Mechanics 2 You send 0.15BTC to Bob Campbell R. Harvey 2018 https://www.cryptocoinsnews.com/bitcoin-transaction-really-works/

  45. The Mechanics 2 Spending destroys UTXO (unspent transaction output) and creates new ones Campbell R. Harvey 2018 https://www.cryptocoinsnews.com/bitcoin-transaction-really-works/

  46. The Mechanics 3 Validation • Miners compete to add a new block to the chain • Need to complete a cryptographic “proof of work” • Problem is different for each block and involves a cryptographic hash functions which take an input and delivers an output • Each block contains the “Proof of Work” (it is difficult to produce but easy to check) Campbell R. Harvey 2018

  47. The Mechanics 3 Hash (SHA-256) • SHA-256 (Secure Hash Algorithm) developed by the NSA • Output is 64 numbers/characters (called hexadecimal, a-f + 0-9) no matter how long the input it receives Campbell R. Harvey 2018

  48. The Mechanics 3 Hash • It only goes one way. Once you have the output, you cannot go back to the input. Think of it as generating a unique identifier • Even a trivial change in the input, produces a completely different hash • On-line calculator example: http://www.xorbin.com/tools/sha256-hash-calculator • You also will have access to a Python program • SHA-512 at http://abunchofutils.com/u/computing/sha512-hash-calculator/ Campbell R. Harvey 2018

  49. The Mechanics 3 Hash • SHA-256 maximum input size is 264-1 bits • Large number? Suppose you put one penny on the first square of a chess board, two pennies on next, etc. • How much is on the 64th square? Campbell R. Harvey 2018

  50. The Mechanics 3 Hash • SHA-256 maximum message size is 264-1 bits • Large number? Suppose you put one penny on the first square of a chess board, two pennies on next, etc. • How much is on the last square? • $9,223,372,036,854,780.00 ($9.2 quadrillion) • US GDP $19,000,000,000.00 • Hash allows for 18.5 quadrillion bits of input Importantly, we are only talking about the inputs. To break the SHA-256, you need to evaluate 2256 (See FAQs). Campbell R. Harvey 2018