MITFLD / transcripts /1Qws70XGSq4.json
robotwang's picture
Add files using upload-large-folder tool
32186fa verified
Raw
History Blame Contribute Delete
150 kB
[{"text": "The following content is\nprovided under a Creative", "start": 1.09, "duration": 2.37}, {"text": "Commons license.", "start": 3.46, "duration": 1.39}, {"text": "Your support will help\nMIT OpenCourseWare", "start": 4.85, "duration": 2.21}, {"text": "continue to offer high quality\neducational resources for free.", "start": 7.06, "duration": 4.09}, {"text": "To make a donation or to\nview additional materials", "start": 11.15, "duration": 2.54}, {"text": "from hundreds of MIT courses,\nvisit MIT OpenCourseWare", "start": 13.69, "duration": 3.96}, {"text": "at ocw.mit.edu.", "start": 17.65, "duration": 0.9}, {"text": "TADGE DRYJA: Today we're going\nto talk about synchronization--", "start": 22.52, "duration": 2.7}, {"text": "how all these different\nnodes on the network", "start": 25.22, "duration": 2.73}, {"text": "come to consensus,\nhow they link up.", "start": 27.95, "duration": 3.84}, {"text": "So it's sort of bringing\nit all together.", "start": 31.79, "duration": 1.75}, {"text": "So so far in these\nlectures we've", "start": 33.54, "duration": 2.57}, {"text": "talked about signatures,\nmining and blocks, transactions", "start": 36.11, "duration": 4.8}, {"text": "and scripts.", "start": 40.91, "duration": 1.11}, {"text": "And now we're going to\nput it all together.", "start": 42.02, "duration": 1.967}, {"text": "How does this all actually work?", "start": 43.987, "duration": 1.333}, {"text": "What do all these components\ncome together to do?", "start": 45.32, "duration": 2.41}, {"text": "And how does this\nmake this cool money?", "start": 47.73, "duration": 4.16}, {"text": "Quick recap on\nsignatures that I think", "start": 51.89, "duration": 2.97}, {"text": "you got the idea\nfrom the homeworks,", "start": 54.86, "duration": 2.31}, {"text": "from the lectures-- you have\nthese public and private keys.", "start": 57.17, "duration": 3.81}, {"text": "This key pair where you\ngenerate the private key,", "start": 60.98, "duration": 2.52}, {"text": "you distribute the public key.", "start": 63.5, "duration": 2.252}, {"text": "The private key\ncan sign a message.", "start": 65.752, "duration": 2.548}, {"text": "And anyone can verify, given\nthe triple public key, message,", "start": 68.3, "duration": 5.94}, {"text": "signature group.", "start": 74.24, "duration": 1.842}, {"text": "This is useful for\nlots of things--", "start": 76.082, "duration": 1.458}, {"text": "providing identity, ownership,\nall sorts of things.", "start": 77.54, "duration": 2.85}, {"text": "And it's better than\npaper signatures.", "start": 80.39, "duration": 1.86}, {"text": "Paper signatures don't\nreally sign the message.", "start": 82.25, "duration": 3.87}, {"text": "They just sort of\nsign the paper.", "start": 86.12, "duration": 2.61}, {"text": "So if you change some\npart of a document,", "start": 88.73, "duration": 3.36}, {"text": "the signature still\nsort of looks OK.", "start": 92.09, "duration": 1.89}, {"text": "Maybe you can see--", "start": 93.98, "duration": 1.11}, {"text": "you want the paper\nto not be tampered.", "start": 95.09, "duration": 2.76}, {"text": "But you can sign a\nblank piece of paper", "start": 97.85, "duration": 2.67}, {"text": "and then add all this\ntext on afterwards.", "start": 100.52, "duration": 2.64}, {"text": "You can't do that\nwith these systems.", "start": 103.16, "duration": 3.22}, {"text": "So signatures are really cool.", "start": 106.38, "duration": 1.51}, {"text": "And they are sort of a necessary\nthing for this network to work.", "start": 107.89, "duration": 5.87}, {"text": "So mining and blocks--", "start": 113.76, "duration": 1.21}, {"text": "I think you sort of got the idea\nwith the Lamport signatures.", "start": 114.97, "duration": 2.91}, {"text": "If you've looked at the\ncurrent problem set,", "start": 117.88, "duration": 3.0}, {"text": "it makes a lot of sense.", "start": 120.88, "duration": 2.31}, {"text": "You change it nonce, hash a\nbunch of times while you change", "start": 123.19, "duration": 3.37}, {"text": "a nonce a bunch of times.", "start": 126.56, "duration": 1.13}, {"text": "Try to get a low output.", "start": 127.69, "duration": 1.87}, {"text": "So you get the idea of mining.", "start": 129.56, "duration": 1.64}, {"text": "You're proving work\nby repeatedly going", "start": 131.2, "duration": 3.72}, {"text": "through different nonces, trying\nto find a certain hash output", "start": 134.92, "duration": 3.27}, {"text": "that there's no shortcut to.", "start": 138.19, "duration": 1.8}, {"text": "You just have the\nguess and check.", "start": 139.99, "duration": 2.25}, {"text": "And now if you include\nthe previous data", "start": 142.24, "duration": 2.1}, {"text": "as part of your input\nto that hash function,", "start": 144.34, "duration": 2.73}, {"text": "you can make a chain of work.", "start": 147.07, "duration": 2.43}, {"text": "And that's what we call\na blockchain I guess.", "start": 149.5, "duration": 3.72}, {"text": "Any questions on this so far?", "start": 153.22, "duration": 1.735}, {"text": "It's the basic idea\nfrom two lectures ago.", "start": 154.955, "duration": 4.165}, {"text": "Cool.", "start": 159.12, "duration": 1.76}, {"text": "And a recap of what\nNeha said yesterday--", "start": 160.88, "duration": 3.935}, {"text": "there's transactions\nand scripts.", "start": 164.815, "duration": 1.375}, {"text": "I'm not going to go\ninto scripts too much", "start": 166.19, "duration": 2.61}, {"text": "yet, because in practice,\n99% of the scripts", "start": 168.8, "duration": 5.07}, {"text": "are just checking a\npublic key signature.", "start": 173.87, "duration": 2.94}, {"text": "You can do all sorts of other\ncrazy things with the scripts.", "start": 176.81, "duration": 4.35}, {"text": "But almost nobody does yet.", "start": 181.16, "duration": 2.85}, {"text": "Basically they say, OK, I'm\nsending to a public key hash.", "start": 184.01, "duration": 2.85}, {"text": "When I spend from it, I\nreveal the public key,", "start": 186.86, "duration": 2.43}, {"text": "check that the hash\nmatches, check a signature.", "start": 189.29, "duration": 3.602}, {"text": "And transactions have\ninputs and outputs.", "start": 192.892, "duration": 1.708}, {"text": "We went over this yesterday.", "start": 194.6, "duration": 1.26}, {"text": "Just a sort of\nreal-world numbers,", "start": 195.86, "duration": 6.26}, {"text": "this is how big\nthings are, \"ish,\"", "start": 202.12, "duration": 3.3}, {"text": "so a transaction ID\nand index to point", "start": 205.42, "duration": 3.39}, {"text": "to a previous transaction.", "start": 208.81, "duration": 1.47}, {"text": "The transaction ID is 32 bytes.", "start": 210.28, "duration": 2.19}, {"text": "The index is encoded as a\nfour byte, so 32-bit integer,", "start": 212.47, "duration": 4.207}, {"text": "which is kind of overkill,\nbecause I think the most that", "start": 216.677, "duration": 2.333}, {"text": "there's ever--", "start": 219.01, "duration": 0.935}, {"text": "the most outputs\nthere's ever been", "start": 219.945, "duration": 1.675}, {"text": "is like 1,000 or something.", "start": 221.62, "duration": 1.86}, {"text": "So you really don't need it to\nbe able to go up to 4 billion.", "start": 223.48, "duration": 3.96}, {"text": "But that's how it is.", "start": 227.44, "duration": 2.01}, {"text": "The signature ends up\nbeing about 100 bytes", "start": 229.45, "duration": 2.13}, {"text": "because you have to provide\nthe public key, which is either", "start": 231.58, "duration": 3.42}, {"text": "33 or 65.", "start": 235.0, "duration": 2.19}, {"text": "And then the signature itself\nis encoded to something", "start": 237.19, "duration": 2.34}, {"text": "like 70 bytes.", "start": 239.53, "duration": 1.83}, {"text": "Both of those things could\nbe much more efficient.", "start": 241.36, "duration": 2.68}, {"text": "But they're not yet.", "start": 244.04, "duration": 2.422}, {"text": "And the output is\nactually a lot smaller.", "start": 246.462, "duration": 1.708}, {"text": "An output, the script--", "start": 248.17, "duration": 1.56}, {"text": "the main thing is\nyour public key hash,", "start": 249.73, "duration": 2.38}, {"text": "which in Bitcoin is 20 bytes.", "start": 252.11, "duration": 2.15}, {"text": "And then you have those\nother little opcodes,", "start": 254.26, "duration": 2.25}, {"text": "which it adds a\nfew bytes, and then", "start": 256.51, "duration": 1.829}, {"text": "your amount, which is--\nso all amounts in Bitcoin", "start": 258.339, "duration": 3.12}, {"text": "are encoded as 8-byte,\nsigned 64-bit integers.", "start": 261.459, "duration": 3.946}, {"text": "So you can have\npretty high precision.", "start": 265.405, "duration": 2.875}, {"text": "And that's also overkill, since\nall the bitcoins ever mined,", "start": 268.28, "duration": 4.22}, {"text": "put together--", "start": 272.5, "duration": 1.62}, {"text": "if you added them all up, it's\nnowhere near 64 bits to the 64.", "start": 274.12, "duration": 4.98}, {"text": "It's like 2 to the 40 something.", "start": 279.1, "duration": 4.46}, {"text": "So it's also kind of\noverkill but yeah, whatever.", "start": 283.56, "duration": 2.62}, {"text": "So this ends up being for a one\ninput, one output transaction,", "start": 286.18, "duration": 4.32}, {"text": "less than 200 bytes.", "start": 290.5, "duration": 1.14}, {"text": "So that's a message,\npretty small.", "start": 294.3, "duration": 2.04}, {"text": "You can broadcast it\naround the network.", "start": 296.34, "duration": 2.646}, {"text": "Inputs point to old\noutputs, have signatures.", "start": 298.986, "duration": 2.074}, {"text": "Outputs have scripts\nand coin amounts.", "start": 301.06, "duration": 2.91}, {"text": "So what do we do with\nall these things?", "start": 303.97, "duration": 1.66}, {"text": "What is the mining process?", "start": 305.63, "duration": 1.73}, {"text": "So in the homework,\nyou're mining your name.", "start": 307.36, "duration": 3.198}, {"text": "You connect to the\nserver, figure out", "start": 310.558, "duration": 1.542}, {"text": "with the last block was, put\nyour name on, put a nonce,", "start": 312.1, "duration": 2.88}, {"text": "and continue to mine.", "start": 314.98, "duration": 1.71}, {"text": "That's not super useful,\nunless you want to prove that", "start": 316.69, "duration": 2.25}, {"text": "you're-- hey, this is me.", "start": 318.94, "duration": 3.0}, {"text": "In Bitcoin, the\nbasic idea is users", "start": 321.94, "duration": 2.28}, {"text": "are making these transactions.", "start": 324.22, "duration": 1.32}, {"text": "Transactions are moving coins\nfrom one place to another,", "start": 325.54, "duration": 2.98}, {"text": "from one key to another.", "start": 328.52, "duration": 2.3}, {"text": "They make the transactions, they\nsign them, and they broadcast.", "start": 330.82, "duration": 3.42}, {"text": "I'll get in to what\n\"broadcast\" means.", "start": 334.24, "duration": 2.62}, {"text": "So in the current\nproblem set, there's", "start": 336.86, "duration": 2.39}, {"text": "one server, which is not really\na robust distributed system,", "start": 339.25, "duration": 5.25}, {"text": "as people may have\nseen yesterday", "start": 344.5, "duration": 1.98}, {"text": "from about 1:30 to 3:00 PM,\nwhen the whole thing went down.", "start": 346.48, "duration": 5.91}, {"text": "In Bitcoin, it's\ncompletely peer-to-peer.", "start": 352.39, "duration": 3.09}, {"text": "Every node is the same.", "start": 355.48, "duration": 1.56}, {"text": "They're all listening\nfor people connecting in.", "start": 357.04, "duration": 2.14}, {"text": "They're all connecting\nout to other nodes.", "start": 359.18, "duration": 3.86}, {"text": "And they broadcast.", "start": 363.04, "duration": 0.92}, {"text": "So if someone sends\nyou a message,", "start": 363.96, "duration": 1.45}, {"text": "you'll pass it on to\nall the other people.", "start": 365.41, "duration": 2.38}, {"text": "So it's called a gossip network.", "start": 367.79, "duration": 2.3}, {"text": "In practice, it works OK.", "start": 370.09, "duration": 2.22}, {"text": "It's fairly heavy load\non some network traffic,", "start": 372.31, "duration": 2.88}, {"text": "but you can make transactions,\nsign them, broadcast them.", "start": 375.19, "duration": 3.69}, {"text": "And then someone,\nthe miner, takes", "start": 378.88, "duration": 3.31}, {"text": "all these recent\ntransactions that they've", "start": 382.19, "duration": 2.4}, {"text": "seen, and puts them into a\nblock, and then does some work.", "start": 384.59, "duration": 4.34}, {"text": "So those transactions\nare now confirmed,", "start": 388.93, "duration": 2.15}, {"text": "and people can build\nthe next block.", "start": 391.08, "duration": 3.46}, {"text": "So the only difference from\nthe current problem set", "start": 394.54, "duration": 2.3}, {"text": "is instead of putting\nyour name in, you put--", "start": 396.84, "duration": 3.6}, {"text": "you can put your name-- but\nyou also put all these messages", "start": 400.44, "duration": 2.85}, {"text": "that you've seen recently.", "start": 403.29, "duration": 1.62}, {"text": "And so you commit\nto them that way.", "start": 404.91, "duration": 2.25}, {"text": "You could do it by just\nsticking them all in,", "start": 407.16, "duration": 2.77}, {"text": "but instead, there's a bit\nmore advanced way to do it.", "start": 409.93, "duration": 4.85}, {"text": "You use what's called\na block header.", "start": 414.78, "duration": 2.67}, {"text": "So yeah, the block header\nitself is the message.", "start": 417.45, "duration": 2.97}, {"text": "So similar to the problem\nset, it's the block header", "start": 420.42, "duration": 2.67}, {"text": "that you need to hash to get a\nlow output value, not the block", "start": 423.09, "duration": 3.39}, {"text": "itself, which is\nkind of interesting.", "start": 426.48, "duration": 2.56}, {"text": "And the headers have a hash\nof all the transactions", "start": 429.04, "duration": 3.297}, {"text": "in the blocks.", "start": 432.337, "duration": 0.583}, {"text": "So you don't just put\nall the transactions", "start": 432.92, "duration": 1.81}, {"text": "into one big megabyte\ndata structure,", "start": 434.73, "duration": 2.82}, {"text": "hash the whole thing, and\nthen try to get a low output.", "start": 437.55, "duration": 2.31}, {"text": "You actually do some\nintermediate steps first.", "start": 439.86, "duration": 2.605}, {"text": "And what's interesting\nis it's actually", "start": 442.465, "duration": 1.625}, {"text": "just the headers that\nmake a chain, not", "start": 444.09, "duration": 1.95}, {"text": "the blocks themselves.", "start": 446.04, "duration": 1.54}, {"text": "So instead of blockchain, you\ncould call it a headerchain.", "start": 447.58, "duration": 2.86}, {"text": "So I'll talk about headers.", "start": 450.44, "duration": 2.82}, {"text": "The headers are 80 bytes.", "start": 453.26, "duration": 1.69}, {"text": "And they're actually quite\nsimilar to the blocks", "start": 454.95, "duration": 2.7}, {"text": "in problem set 2.", "start": 457.65, "duration": 1.25}, {"text": "So the main three\ncomponents are you've", "start": 458.9, "duration": 2.14}, {"text": "got the previous hash, the\nMerkle root, and the nonce.", "start": 461.04, "duration": 2.55}, {"text": "And so this is like\nin the problem set.", "start": 463.59, "duration": 1.9}, {"text": "You start with\nthe previous hash.", "start": 465.49, "duration": 1.85}, {"text": "Then you have data that\nyou're actually committing to.", "start": 467.34, "duration": 3.733}, {"text": "And then you have\nsome data that doesn't", "start": 471.073, "duration": 1.667}, {"text": "have any actual meaning,\njust to get the work done.", "start": 472.74, "duration": 3.22}, {"text": "So I can-- to reference, if\nyou look through the work", "start": 475.96, "duration": 4.43}, {"text": "people are doing right\nnow, this is all public,", "start": 480.39, "duration": 3.39}, {"text": "the current problem set.", "start": 483.78, "duration": 1.65}, {"text": "There's a previous\nhash, which is basically", "start": 485.43, "duration": 2.04}, {"text": "the hash of the line above it.", "start": 487.47, "duration": 2.29}, {"text": "And then there's some data\nyou're committing to, in this", "start": 489.76, "duration": 2.66}, {"text": "case people's user names, and\nthen some non-meaningful data", "start": 492.42, "duration": 4.62}, {"text": "here with just random numbers\nand stuff it looks like--", "start": 497.04, "duration": 6.04}, {"text": "so very similar.", "start": 503.08, "duration": 1.72}, {"text": "Any questions about this idea?", "start": 504.8, "duration": 1.25}, {"text": "Cool.", "start": 510.38, "duration": 0.5}, {"text": "So we use a Merkle root, which\nI think I talked about last week", "start": 513.97, "duration": 4.1}, {"text": "Monday, instead of\njust concatenating", "start": 518.07, "duration": 3.219}, {"text": "all the transactions and\nhashing them in together.", "start": 521.289, "duration": 2.401}, {"text": "You could do that.", "start": 523.69, "duration": 0.84}, {"text": "That actually would work.", "start": 524.53, "duration": 1.042}, {"text": "It wouldn't make\na huge difference.", "start": 525.572, "duration": 1.993}, {"text": "But this is a\nlittle nicer if you", "start": 527.565, "duration": 1.375}, {"text": "want to prove that a\ntransaction was in this block,", "start": 528.94, "duration": 4.11}, {"text": "without giving the whole block.", "start": 533.05, "duration": 2.79}, {"text": "So the idea is I\nhave these TXIDs.", "start": 535.84, "duration": 3.24}, {"text": "And a TXID, transaction ID, is\njust a hash of the transaction.", "start": 539.08, "duration": 5.46}, {"text": "Stick all the components of\nthe transaction into bytes,", "start": 544.54, "duration": 2.91}, {"text": "hash that, and you've\ngot what's called a TXID.", "start": 547.45, "duration": 2.22}, {"text": "And that's how you\nrefer to transactions.", "start": 549.67, "duration": 2.26}, {"text": "You hash these two together to\nget this intermediate point.", "start": 555.06, "duration": 3.76}, {"text": "Do the same thing\nup to the root.", "start": 558.82, "duration": 2.16}, {"text": "And so you can't change any of\nthese little transaction IDs", "start": 560.98, "duration": 4.44}, {"text": "without changing\nthe Merkle root.", "start": 565.42, "duration": 1.86}, {"text": "So it commits to\nall the transactions", "start": 567.28, "duration": 2.97}, {"text": "just the same way it would\nif you just concatenated them", "start": 570.25, "duration": 3.152}, {"text": "all together and hashed that.", "start": 573.402, "duration": 1.208}, {"text": "So it really-- we'll go in\nto, later, why this is useful.", "start": 577.15, "duration": 5.25}, {"text": "But in many cases, it really\ndoesn't help too much.", "start": 582.4, "duration": 4.76}, {"text": "Any getting questions\nabout Merkle, Merkle tree?", "start": 587.16, "duration": 2.21}, {"text": "Good.", "start": 589.37, "duration": 1.99}, {"text": "So the actual Bitcoin headers,\nwhich many things use,", "start": 591.36, "duration": 4.87}, {"text": "has a couple of fields.", "start": 596.23, "duration": 1.11}, {"text": "Some of them are\nactually not very useful.", "start": 597.34, "duration": 3.51}, {"text": "But the main two are previous\nhash, Merkle root, nonce.", "start": 600.85, "duration": 4.35}, {"text": "And then there's-- I'll\ntalk about the other things.", "start": 605.2, "duration": 2.26}, {"text": "So there's also a version\nfield right at the beginning.", "start": 607.46, "duration": 2.84}, {"text": "It's 4 bytes.", "start": 610.3, "duration": 1.7}, {"text": "It indicates block version.", "start": 612.0, "duration": 1.75}, {"text": "It's not clear what that's going\nto be used for in the future.", "start": 613.75, "duration": 3.78}, {"text": "It used to be used for sort\nof signaling protocol changes.", "start": 617.53, "duration": 3.44}, {"text": "I'm not sure that's going to\nbe the case going forward,", "start": 620.97, "duration": 2.53}, {"text": "because it didn't really\nwork very well for that.", "start": 623.5, "duration": 3.94}, {"text": "So right now I think they all\nstart like 02 and then a bunch", "start": 627.44, "duration": 3.53}, {"text": "of zeros.", "start": 630.97, "duration": 1.32}, {"text": "And that's the current\nversion, whatever that means.", "start": 632.29, "duration": 3.82}, {"text": "And if you mine something\nwith a different version,", "start": 636.11, "duration": 4.31}, {"text": "everyone will accept it.", "start": 640.42, "duration": 1.54}, {"text": "But there'll be like these\nwarnings that show up", "start": 641.96, "duration": 2.0}, {"text": "in your Bitcoin log files that\nsay, warning, unknown version", "start": 643.96, "duration": 4.56}, {"text": "detected.", "start": 648.52, "duration": 1.92}, {"text": "The idea is maybe, well, if the\ninversion increases or changes,", "start": 650.44, "duration": 3.27}, {"text": "maybe there's some new rules\nin this system, or new opcodes,", "start": 653.71, "duration": 3.87}, {"text": "or new something going on.", "start": 657.58, "duration": 1.663}, {"text": "And you're not aware\nof it, so you might", "start": 659.243, "duration": 1.667}, {"text": "need to upgrade your software.", "start": 660.91, "duration": 2.37}, {"text": "That was the idea anyway.", "start": 663.28, "duration": 2.77}, {"text": "In practice, what happens is--", "start": 666.05, "duration": 1.668}, {"text": "you'll see in your\nlogs all the time,", "start": 667.718, "duration": 1.542}, {"text": "that like, unknown\nversion detected.", "start": 669.26, "duration": 2.1}, {"text": "And it's just someone\njust set random numbers", "start": 671.36, "duration": 2.67}, {"text": "in the version field.", "start": 674.03, "duration": 1.41}, {"text": "And it doesn't seem to mean\nanything, so not super useful.", "start": 675.44, "duration": 4.24}, {"text": "Previous hash, just\nlike in the problem set,", "start": 679.68, "duration": 2.01}, {"text": "it's the hash of the\nprevious block, 32 bytes.", "start": 681.69, "duration": 3.22}, {"text": "Merkle root, as described\na few slides before--", "start": 684.91, "duration": 2.79}, {"text": "hash of all the\ntransactions in the block.", "start": 687.7, "duration": 1.86}, {"text": "Time, actually kind of complex--", "start": 692.458, "duration": 3.372}, {"text": "I'm not going to go into\nthe whole thing right here.", "start": 695.83, "duration": 3.33}, {"text": "So far we haven't really\ntalked about time.", "start": 699.16, "duration": 2.43}, {"text": "Does anyone know why we'd\nwant time in these headers?", "start": 701.59, "duration": 6.65}, {"text": "Yeah.", "start": 711.2, "duration": 0.5}, {"text": "AUDIENCE: You had\nmentioned earlier", "start": 711.7, "duration": 1.458}, {"text": "that you don't accept blocks\nbetween a certain interval", "start": 713.158, "duration": 3.512}, {"text": "if they were too late.", "start": 716.67, "duration": 1.788}, {"text": "TADGE DRYJA: Right.", "start": 718.458, "duration": 0.792}, {"text": "So it makes sense intuitively\nthat like if someone says, hey,", "start": 719.25, "duration": 3.6}, {"text": "I mined this in 1987.", "start": 722.85, "duration": 3.33}, {"text": "It's like well,\nthat seems crazy.", "start": 726.18, "duration": 2.46}, {"text": "Or if someone says,\nhere's a block.", "start": 728.64, "duration": 1.71}, {"text": "It came out in 2046.", "start": 730.35, "duration": 2.03}, {"text": "Like, this doesn't\nmake any sense.", "start": 732.38, "duration": 3.58}, {"text": "So intuitively,\nyeah, you shouldn't", "start": 735.96, "duration": 1.82}, {"text": "accept things that have\nsome crazy date that's", "start": 737.78, "duration": 2.22}, {"text": "clearly wrong.", "start": 740.0, "duration": 1.26}, {"text": "But why?", "start": 741.26, "duration": 0.87}, {"text": "Why do we need time at all?", "start": 742.13, "duration": 1.19}, {"text": "Yeah.", "start": 745.66, "duration": 0.5}, {"text": "AUDIENCE: If you want\nto lock the transaction", "start": 746.16, "duration": 1.875}, {"text": "until a certain time.", "start": 748.035, "duration": 1.795}, {"text": "TADGE DRYJA: Yeah, you could\nsay, here's a transaction,", "start": 749.83, "duration": 3.13}, {"text": "and I don't want it to\nbe valid before August 1.", "start": 752.96, "duration": 4.08}, {"text": "And so then, you could say,\nif it goes into a block,", "start": 757.04, "duration": 4.03}, {"text": "and that block has a\ntimestamp before August 1,", "start": 761.07, "duration": 3.5}, {"text": "consider the block invalid.", "start": 764.57, "duration": 1.86}, {"text": "You could.", "start": 766.43, "duration": 2.1}, {"text": "You can also do timestamping\nbased just on block height.", "start": 768.53, "duration": 3.45}, {"text": "But what's the main-- does\nanyone know the main reason", "start": 771.98, "duration": 2.26}, {"text": "to have height here?", "start": 774.24, "duration": 1.1}, {"text": "Yeah.", "start": 775.34, "duration": 0.615}, {"text": "AUDIENCE: Is it\nbecause if they're", "start": 775.955, "duration": 1.417}, {"text": "a competing transaction?", "start": 777.372, "duration": 1.548}, {"text": "And then you would\npick one or the other.", "start": 778.92, "duration": 4.76}, {"text": "TADGE DRYJA: So the competing\ntransactions, when they get in,", "start": 783.68, "duration": 2.64}, {"text": "they sort of get into a block.", "start": 786.32, "duration": 1.57}, {"text": "And that sort of solves\nthat competition.", "start": 787.89, "duration": 2.035}, {"text": "So you have two\ntransactions that", "start": 789.925, "duration": 1.375}, {"text": "both are mutually exclusive.", "start": 791.3, "duration": 2.35}, {"text": "Well, if they're both in the\nsame Merkle root and both", "start": 793.65, "duration": 2.683}, {"text": "in the same block,\nthen that block", "start": 796.333, "duration": 1.417}, {"text": "is considered invalid,\nbecause it's like,", "start": 797.75, "duration": 2.04}, {"text": "hey, you've given me a block.", "start": 799.79, "duration": 1.8}, {"text": "It's got two things that\ncan't both exist here.", "start": 801.59, "duration": 2.55}, {"text": "So throw the block away.", "start": 804.14, "duration": 2.88}, {"text": "If you find two blocks\nthat both seem to have--", "start": 807.02, "duration": 3.5}, {"text": "that sort of collide.", "start": 810.52, "duration": 1.36}, {"text": "They're both pointing to the--", "start": 811.88, "duration": 1.47}, {"text": "they've both got the\nsame previous hash.", "start": 813.35, "duration": 1.92}, {"text": "So they're both in the same\nheight, we call, of the chain.", "start": 815.27, "duration": 5.28}, {"text": "You could say, oh, well,\nwhichever one came out first.", "start": 820.55, "duration": 4.095}, {"text": "I'll look at the\ntimestamp and say, OK,", "start": 824.645, "duration": 1.625}, {"text": "the block that came out\nfirst will be the valid one.", "start": 826.27, "duration": 3.51}, {"text": "But the problem is this\nis claimed block creation.", "start": 829.78, "duration": 3.9}, {"text": "You can put whatever 4\nbytes you want in there.", "start": 833.68, "duration": 2.91}, {"text": "And so you can always\nsay, oh, I just", "start": 836.59, "duration": 1.98}, {"text": "wanted it exactly 1 second\nafter the previous block.", "start": 838.57, "duration": 3.12}, {"text": "It just took me a\nwhile to broadcast it.", "start": 841.69, "duration": 3.69}, {"text": "So you can't really\ntrust the timestamp", "start": 845.38, "duration": 2.25}, {"text": "to see which came first.", "start": 847.63, "duration": 1.83}, {"text": "If you could, you wouldn't need\nall this crazy mining stuff.", "start": 849.46, "duration": 2.55}, {"text": "And transactions themselves\ncould just have a timestamp.", "start": 852.01, "duration": 3.51}, {"text": "And you wouldn't need\nthis whole structure.", "start": 855.52, "duration": 2.34}, {"text": "So the fundamental\nreason you're mining", "start": 857.86, "duration": 2.19}, {"text": "is we can't trust people to\nsay when they did something.", "start": 860.05, "duration": 4.593}, {"text": "You can always say, no,\nthis transaction came first.", "start": 864.643, "duration": 2.167}, {"text": "No, this came first.", "start": 866.81, "duration": 1.64}, {"text": "So the real reason\nfor this blockchain", "start": 868.45, "duration": 1.71}, {"text": "is, OK, we know which\ncame before what.", "start": 870.16, "duration": 3.282}, {"text": "AUDIENCE: In practice,\nwhich one happens?", "start": 873.442, "duration": 1.708}, {"text": "Do people just lie and say\nit happened a second later?", "start": 875.15, "duration": 2.39}, {"text": "Or is it [INAUDIBLE]?", "start": 877.54, "duration": 1.328}, {"text": "TADGE DRYJA: Oh, in\npractice the timestamps", "start": 878.868, "duration": 1.792}, {"text": "are pretty unreliable.", "start": 880.66, "duration": 3.15}, {"text": "They can be off by minutes.", "start": 883.81, "duration": 4.52}, {"text": "It can be before the\nprevious block's time.", "start": 888.33, "duration": 2.32}, {"text": "And that's OK.", "start": 890.65, "duration": 2.4}, {"text": "It seems intuitively like, well,\nthat should just be a rule.", "start": 893.05, "duration": 2.937}, {"text": "And it probably-- it would have\nbeen cool if it was a rule and", "start": 895.987, "duration": 2.583}, {"text": "made things simpler\nfrom the beginning.", "start": 898.57, "duration": 2.1}, {"text": "But if you're pointing\nto a previous block,", "start": 900.67, "duration": 3.75}, {"text": "I'm building on top of it.", "start": 904.42, "duration": 1.41}, {"text": "And the previous block\ncame out at 10:15.", "start": 905.83, "duration": 4.04}, {"text": "And I set my timestamp\nto 10:12, 3 minutes prior", "start": 909.87, "duration": 3.73}, {"text": "to the previous block.", "start": 913.6, "duration": 1.41}, {"text": "Logically, that's impossible.", "start": 915.01, "duration": 1.433}, {"text": "I'm referencing\nsomething, and I'm", "start": 916.443, "duration": 1.417}, {"text": "saying I'm coming before it.", "start": 917.86, "duration": 1.62}, {"text": "But the software says that's OK.", "start": 919.48, "duration": 2.522}, {"text": "AUDIENCE: So if we're\ncreating a version,", "start": 922.002, "duration": 1.708}, {"text": "would it be useful to just\nget rid of version and time,", "start": 923.71, "duration": 3.263}, {"text": "like if we're creating\na new blockchain?", "start": 926.973, "duration": 1.667}, {"text": "TADGE DRYJA: So version,\nmaybe you could get rid of,", "start": 928.64, "duration": 2.297}, {"text": "or you could put it somewhere\nin the Merkle root or something.", "start": 930.937, "duration": 2.583}, {"text": "Time actually does have\na really useful purpose.", "start": 933.52, "duration": 2.91}, {"text": "Does anyone, maybe if you know?", "start": 939.15, "duration": 2.54}, {"text": "AUDIENCE: I don't\nknow, but does it", "start": 941.69, "duration": 2.02}, {"text": "play into the\ndifficulty of the mine?", "start": 943.71, "duration": 2.11}, {"text": "Does it?", "start": 945.82, "duration": 0.68}, {"text": "TADGE DRYJA: Yeah, so\nthe main reason for time", "start": 946.5, "duration": 2.85}, {"text": "here is to adjust\nthe difficulty.", "start": 949.35, "duration": 4.47}, {"text": "And that happens\nevery 2,016 blocks.", "start": 953.82, "duration": 3.15}, {"text": "You just look at, OK, how long\ndid this 2,016-block period", "start": 956.97, "duration": 2.94}, {"text": "take according to\nthese timestamps?", "start": 959.91, "duration": 2.88}, {"text": "And if it took two\nweeks, OK, we're good.", "start": 962.79, "duration": 2.29}, {"text": "The difficulty doesn't\nhave to change.", "start": 965.08, "duration": 1.76}, {"text": "If it took three weeks,\nthat means the blocks", "start": 966.84, "duration": 2.61}, {"text": "were coming out very slowly.", "start": 969.45, "duration": 1.62}, {"text": "And we need to reduce\nthe difficulty.", "start": 971.07, "duration": 3.06}, {"text": "If the 2,016 blocks came\nout in one week, that means,", "start": 974.13, "duration": 3.54}, {"text": "wow, people were\nmining really fast.", "start": 977.67, "duration": 2.8}, {"text": "And so we need to\nincrease the difficulty.", "start": 980.47, "duration": 2.04}, {"text": "So there's this negative\nfeedback mechanism", "start": 982.51, "duration": 2.81}, {"text": "based on this time.", "start": 985.32, "duration": 1.8}, {"text": "And it can be tweaked.", "start": 987.12, "duration": 2.31}, {"text": "It's not accurate.", "start": 989.43, "duration": 2.1}, {"text": "You can have things\ncoming in the wrong order.", "start": 991.53, "duration": 2.65}, {"text": "The general rule of thumb--", "start": 994.18, "duration": 1.9}, {"text": "the rule in the software\nis about two hours.", "start": 996.08, "duration": 2.89}, {"text": "If you see something\nthat's two hours off", "start": 998.97, "duration": 2.34}, {"text": "from what your internal clock\nsays, you will reject it.", "start": 1001.31, "duration": 4.86}, {"text": "But that's a huge gap.", "start": 1006.17, "duration": 2.55}, {"text": "Most network systems,\neveryone's got their clocks", "start": 1008.72, "duration": 3.63}, {"text": "to the same second at\nleast, or millisecond.", "start": 1012.35, "duration": 4.65}, {"text": "Two hours is like\nkind of enormous gaps.", "start": 1017.0, "duration": 3.67}, {"text": "But the system works\nOK, because you've", "start": 1020.67, "duration": 2.33}, {"text": "got these really long-term\ndifficulty adjustments that", "start": 1023.0, "duration": 3.359}, {"text": "only happen every 2,016 blocks,\nwhich in practice is something", "start": 1026.359, "duration": 3.451}, {"text": "like two weeks.", "start": 1029.81, "duration": 1.809}, {"text": "So if someone gets\nsomething a few minutes off,", "start": 1031.619, "duration": 3.47}, {"text": "it doesn't really\naffect things too much.", "start": 1035.089, "duration": 2.721}, {"text": "And it's really only used for,\nOK, look at the last 2,016", "start": 1037.81, "duration": 4.269}, {"text": "blocks, two weeks-ish of\nwork, of all these blocks,", "start": 1042.079, "duration": 3.301}, {"text": "and see how fast we\nneed to make things.", "start": 1045.38, "duration": 3.03}, {"text": "So that ties into the next\nfield, which is difficulty.", "start": 1048.41, "duration": 4.86}, {"text": "It's in a sort of weird\nfloating pointlike", "start": 1053.27, "duration": 2.07}, {"text": "format with a mantissa\nand exponent, which", "start": 1055.34, "duration": 3.78}, {"text": "is totally custom.", "start": 1059.12, "duration": 1.29}, {"text": "And you kind of have to write\nyour own code to deal with it.", "start": 1060.41, "duration": 3.21}, {"text": "But it basically\nsays, OK, what does", "start": 1063.62, "duration": 1.95}, {"text": "the number have to-- what does\nthe hash have to be below?", "start": 1065.57, "duration": 2.85}, {"text": "It's not just number of bits.", "start": 1068.42, "duration": 2.37}, {"text": "So in the problem set,\nI said 33 bits of work.", "start": 1070.79, "duration": 4.38}, {"text": "So that's fairly easy to\ndetect, because you just look", "start": 1075.17, "duration": 2.25}, {"text": "for 33 0-bits in the front.", "start": 1077.42, "duration": 2.49}, {"text": "In Bitcoin, it's not\njust number of bits.", "start": 1079.91, "duration": 2.13}, {"text": "It's actually a number\nthat it must be below.", "start": 1082.04, "duration": 2.438}, {"text": "If it were just number\nof bits, the problem", "start": 1084.478, "duration": 1.792}, {"text": "then is your adjustments are\nfairly coarse, because you can", "start": 1086.27, "duration": 3.99}, {"text": "only adjust by a factor of 2.", "start": 1090.26, "duration": 1.86}, {"text": "You can double your\ndifficulty or half it.", "start": 1092.12, "duration": 3.81}, {"text": "But with this, you can have much\nsmaller difficulty adjustments", "start": 1095.93, "duration": 3.66}, {"text": "of like a fraction of a percent.", "start": 1099.59, "duration": 1.35}, {"text": "Yeah, this field is\npretty much useless", "start": 1103.84, "duration": 4.033}, {"text": "since you can calculate\nit from the time", "start": 1107.873, "duration": 1.667}, {"text": "fields of the previous blocks.", "start": 1109.54, "duration": 1.983}, {"text": "So you could just\nhave it be implied.", "start": 1111.523, "duration": 1.542}, {"text": "But it's in there.", "start": 1115.63, "duration": 0.9}, {"text": "And you can just whatever.", "start": 1116.53, "duration": 1.26}, {"text": "It's an extra 4 bytes.", "start": 1117.79, "duration": 2.12}, {"text": "I don't think you\nactually-- like, you", "start": 1119.91, "duration": 2.5}, {"text": "don't have to store it\non a disk if you want,", "start": 1122.41, "duration": 1.92}, {"text": "because you can just figure\nit out from the other things.", "start": 1124.33, "duration": 3.563}, {"text": "AUDIENCE: Wouldn't you\nneed it for [INAUDIBLE]??", "start": 1127.893, "duration": 5.079}, {"text": "TADGE DRYJA: No, because you\ncan figure out what difficulty", "start": 1132.972, "duration": 2.458}, {"text": "is just from the headers.", "start": 1135.43, "duration": 1.042}, {"text": "I mean, it's in there.", "start": 1138.833, "duration": 0.917}, {"text": "I guess it's nice\nif you just want", "start": 1139.75, "duration": 1.92}, {"text": "to validate whether a single\nheader has enough work.", "start": 1141.67, "duration": 5.21}, {"text": "But it's like, how much\nwork does it claim it needs?", "start": 1146.88, "duration": 3.322}, {"text": "And then you can validate it.", "start": 1150.202, "duration": 1.208}, {"text": "But I don't know.", "start": 1151.41, "duration": 1.487}, {"text": "It's in there.", "start": 1152.897, "duration": 0.583}, {"text": "It doesn't-- you could take\nit out and reorganize the code", "start": 1153.48, "duration": 2.587}, {"text": "a little if you\nwanted to optimize it.", "start": 1156.067, "duration": 1.583}, {"text": "But that would change so\nmuch that no one bothers.", "start": 1157.65, "duration": 2.93}, {"text": "AUDIENCE: So when we talk about\nthe adjusting difficulties", "start": 1160.58, "duration": 2.85}, {"text": "and even just showing the\nproblem or proof of work, who", "start": 1163.43, "duration": 4.53}, {"text": "[INAUDIBLE] for\nthe problems that", "start": 1167.96, "duration": 2.22}, {"text": "will go to the central server?", "start": 1170.18, "duration": 3.08}, {"text": "TADGE DRYJA: So in\nthis, it's just everyone", "start": 1173.26, "duration": 1.91}, {"text": "broadcasts their blocks.", "start": 1175.17, "duration": 1.53}, {"text": "So if you've received a block or\nif you found a block yourself,", "start": 1176.7, "duration": 4.44}, {"text": "you just send it to all your\npeers that you're connected to.", "start": 1181.14, "duration": 3.48}, {"text": "And so there's no like, oh,\nthis is the canonical block.", "start": 1184.62, "duration": 5.56}, {"text": "There can be competing\nblocks where you have two", "start": 1190.18, "duration": 2.0}, {"text": "at the same time and just\nstochastically, one of them", "start": 1192.18, "duration": 3.93}, {"text": "will pull ahead,\nbecause, well, randomly.", "start": 1196.11, "duration": 3.0}, {"text": "So you can have\nconflicting things.", "start": 1199.11, "duration": 2.67}, {"text": "Yeah, and then the\nadjustments-- also,", "start": 1201.78, "duration": 1.74}, {"text": "everyone computes\nthe adjustments.", "start": 1203.52, "duration": 2.51}, {"text": "And this is an actually\nvery quick computation,", "start": 1206.03, "duration": 2.56}, {"text": "because you're just looking at--", "start": 1208.59, "duration": 4.08}, {"text": "you're not even looking\nat 2,016 timestamps.", "start": 1212.67, "duration": 2.58}, {"text": "You're basically just\nsaying, OK, if height--", "start": 1215.25, "duration": 2.67}, {"text": "so height is just what\nblock number it is.", "start": 1217.92, "duration": 2.16}, {"text": "So if you're-- right now,\nit's about 500 million.", "start": 1220.08, "duration": 3.76}, {"text": "No, sorry, 500,000.", "start": 1223.84, "duration": 2.325}, {"text": "So you basically\nin the code just", "start": 1226.165, "duration": 1.375}, {"text": "say, well, if\nheight modulo 2,016", "start": 1227.54, "duration": 3.28}, {"text": "is equal to 0, check\nheight minus 2,016's block.", "start": 1230.82, "duration": 7.98}, {"text": "Compare the two timestamps.", "start": 1238.8, "duration": 1.77}, {"text": "Subtract them.", "start": 1240.57, "duration": 1.38}, {"text": "Get a duration.", "start": 1241.95, "duration": 1.86}, {"text": "And then compare that\nduration to two weeks.", "start": 1243.81, "duration": 3.0}, {"text": "And then change the\ndifficulty proportionally.", "start": 1246.81, "duration": 2.77}, {"text": "So it's actually, like,\nsuper quick for everyone", "start": 1249.58, "duration": 2.4}, {"text": "to compute the new difficulty.", "start": 1251.98, "duration": 1.25}, {"text": "And they only do it\nonce every two weeks.", "start": 1253.23, "duration": 2.89}, {"text": "And it, yeah, it's\npretty straightforward.", "start": 1256.12, "duration": 3.15}, {"text": "There are weird\nattacks and stuff.", "start": 1259.27, "duration": 2.42}, {"text": "And it's kind of some weird\noff by 1 errors, where you're--", "start": 1261.69, "duration": 3.51}, {"text": "I don't remember.", "start": 1265.2, "duration": 0.8}, {"text": "Like, it's kind of confusing.", "start": 1266.0, "duration": 1.42}, {"text": "It's also confusing because\nthe test network, which", "start": 1267.42, "duration": 2.73}, {"text": "I haven't gone into but will\nuse probably in two weeks.", "start": 1270.15, "duration": 5.09}, {"text": "There's a Bitcoin test network,\nwhich operates pretty much", "start": 1275.24, "duration": 4.15}, {"text": "exactly the same as\nBitcoin, except everyone", "start": 1279.39, "duration": 2.4}, {"text": "agrees that the coins\nare not worth any money.", "start": 1281.79, "duration": 3.0}, {"text": "What's interesting is it's\nactually called testnet3.", "start": 1284.79, "duration": 3.06}, {"text": "The first two test networks\nhave the same setup.", "start": 1287.85, "duration": 3.69}, {"text": "However, the agreement that\nthey were not worth any money", "start": 1291.54, "duration": 2.43}, {"text": "broke down.", "start": 1293.97, "duration": 2.73}, {"text": "So at testnet1,\nsomeone said, hey,", "start": 1296.7, "duration": 1.83}, {"text": "I'll pay you a bitcoin for\na million testnet coins.", "start": 1298.53, "duration": 4.05}, {"text": "And once people\nsaw this happening,", "start": 1302.58, "duration": 1.53}, {"text": "they said, oh, well,\nyou just ruined testnet.", "start": 1304.11, "duration": 1.5}, {"text": "Now they're worth money.", "start": 1305.61, "duration": 1.29}, {"text": "So we'll go to testnet2.", "start": 1306.9, "duration": 1.14}, {"text": "It happened again.", "start": 1308.04, "duration": 1.18}, {"text": "Testnet3 has had\nsome staying power.", "start": 1309.22, "duration": 1.5}, {"text": "I think people realized that if\nthey try to buy testnet3 coins,", "start": 1310.72, "duration": 4.28}, {"text": "everyone's going to\nleave and go to testnet4.", "start": 1315.0, "duration": 3.365}, {"text": "So it's kind of fun.", "start": 1318.365, "duration": 3.865}, {"text": "I'd actually be OK with testnet3\ncoins being worth money,", "start": 1322.23, "duration": 2.85}, {"text": "because I have many,\nmany thousands of them.", "start": 1325.08, "duration": 5.19}, {"text": "But yeah, so one\ndifference, though,", "start": 1330.27, "duration": 8.2}, {"text": "between the test networks\nand the real network", "start": 1338.47, "duration": 2.3}, {"text": "is the difficulty adjustments.", "start": 1340.77, "duration": 1.83}, {"text": "So I think in the\nfirst test network,", "start": 1342.6, "duration": 3.48}, {"text": "it just worked\nexactly like Bitcoin.", "start": 1346.08, "duration": 2.31}, {"text": "But one of the problems\nwas people would mine,", "start": 1348.39, "duration": 3.21}, {"text": "and the difficulty\nwould increase.", "start": 1351.6, "duration": 2.43}, {"text": "And then people would\nstop mining, say, oh, I'm", "start": 1354.03, "duration": 2.22}, {"text": "going to test out\nmy mining software.", "start": 1356.25, "duration": 2.34}, {"text": "I'll mine a couple\nthousand blocks.", "start": 1358.59, "duration": 2.505}, {"text": "Maybe it only takes me\na day or two to do so,", "start": 1361.095, "duration": 1.875}, {"text": "because I have a very\nfast computer compared", "start": 1362.97, "duration": 2.79}, {"text": "to the rest of the network.", "start": 1365.76, "duration": 1.292}, {"text": "And then I say, OK,\nwell, it works, cool.", "start": 1367.052, "duration": 1.708}, {"text": "I'm going to go to\nthe real network now.", "start": 1368.76, "duration": 1.667}, {"text": "And I leave the test network.", "start": 1370.427, "duration": 1.323}, {"text": "And now the\ndifficulty increased,", "start": 1371.75, "duration": 1.69}, {"text": "because let's say 2,000\nor 4,000 blocks came out.", "start": 1373.44, "duration": 3.12}, {"text": "And they came out very quickly,\nso the difficulty went up.", "start": 1376.56, "duration": 2.85}, {"text": "And then all the\nmining power left.", "start": 1379.41, "duration": 1.77}, {"text": "And so now blocks\naren't coming out.", "start": 1381.18, "duration": 2.37}, {"text": "And since the adjustment\ncan be up or down", "start": 1383.55, "duration": 3.46}, {"text": "but happens based on number\nof blocks, not based on time,", "start": 1387.01, "duration": 5.18}, {"text": "if you have a very high\ndifficulty and the very low", "start": 1392.19, "duration": 3.24}, {"text": "hash rate relative\nto that difficulty,", "start": 1395.43, "duration": 2.67}, {"text": "it can take weeks\nor months or years", "start": 1398.1, "duration": 3.0}, {"text": "for the difficulty to reduce.", "start": 1401.1, "duration": 2.73}, {"text": "So testnet3 put in this\nsort of difficulty nerfing", "start": 1403.83, "duration": 4.26}, {"text": "code, which is probably wrong\nand not what they intended.", "start": 1408.09, "duration": 4.86}, {"text": "And it has this thing where\nlike if 20 minutes have gone by,", "start": 1412.95, "duration": 3.09}, {"text": "the difficulty lowers.", "start": 1416.04, "duration": 1.26}, {"text": "And it's kind of ugly.", "start": 1417.3, "duration": 3.24}, {"text": "So that's the main place\nI've dealt with this field.", "start": 1420.54, "duration": 4.643}, {"text": "One other rule with the\nrestriction-- the difficulty", "start": 1425.183, "duration": 2.167}, {"text": "can go up by at\nmost a factor of 4", "start": 1427.35, "duration": 3.27}, {"text": "and drop by at\nmost a factor of 4.", "start": 1430.62, "duration": 3.15}, {"text": "So if you mine 2,016\nblocks in one day,", "start": 1433.77, "duration": 4.08}, {"text": "the difficulty goes\nup 4x but does not", "start": 1437.85, "duration": 2.07}, {"text": "go up 14x or whatever\nthe implied would.", "start": 1439.92, "duration": 5.83}, {"text": "Any-- go ahead.", "start": 1445.75, "duration": 0.64}, {"text": "AUDIENCE: So the\ndifficulty is definitely", "start": 1446.39, "duration": 1.78}, {"text": "constant for two weeks then?", "start": 1448.17, "duration": 1.69}, {"text": "TADGE DRYJA: Yeah.", "start": 1449.86, "duration": 1.22}, {"text": "Well, sorry, not two weeks--", "start": 1451.08, "duration": 1.32}, {"text": "2,016 blocks, which is generally\naround two weeks, but yeah.", "start": 1452.4, "duration": 4.52}, {"text": "AUDIENCE: So it\nunblocks and blocks,", "start": 1456.92, "duration": 1.68}, {"text": "within literally an\nalmost two-week period,", "start": 1458.6, "duration": 1.5}, {"text": "that difficulty\nwould be the same.", "start": 1460.1, "duration": 1.28}, {"text": "TADGE DRYJA: Yeah, so if you\nactually look at the headers,", "start": 1461.38, "duration": 2.417}, {"text": "this is just the constant.", "start": 1463.797, "duration": 1.108}, {"text": "It just is always the same.", "start": 1464.905, "duration": 1.125}, {"text": "So it's kind of a silly\nfield to be in there.", "start": 1466.03, "duration": 1.875}, {"text": "You never need it, and\nit's always the same.", "start": 1467.905, "duration": 3.57}, {"text": "Any other questions\nabout-- yeah?", "start": 1471.475, "duration": 1.375}, {"text": "AUDIENCE: How many transactions\nare usually [INAUDIBLE]??", "start": 1472.85, "duration": 2.532}, {"text": "TADGE DRYJA: Oh,\nI'll get to that--", "start": 1475.382, "duration": 1.458}, {"text": "right now, a couple\nthousand, 4,000-ish.", "start": 1476.84, "duration": 3.33}, {"text": "We'll get to that I think.", "start": 1480.17, "duration": 2.41}, {"text": "But yeah, in the Merkle root--", "start": 1482.58, "duration": 1.25}, {"text": "so the height of the\nMerkle root's like 12-ish.", "start": 1483.83, "duration": 3.36}, {"text": "And it goes out to maybe\n4,000 transactions,", "start": 1487.19, "duration": 4.26}, {"text": "sometimes more,\nsometimes very few.", "start": 1491.45, "duration": 2.37}, {"text": "You'll find empty\nblocks that just", "start": 1493.82, "duration": 1.74}, {"text": "have one transaction in them.", "start": 1495.56, "duration": 3.43}, {"text": "And that transaction ID just\nbecomes the Merkle root,", "start": 1498.99, "duration": 3.2}, {"text": "because a height--", "start": 1502.19, "duration": 1.14}, {"text": "it's like a height-zero\nMerkle tree,", "start": 1503.33, "duration": 3.06}, {"text": "but yeah, something like that.", "start": 1506.39, "duration": 1.87}, {"text": "And then last-- pretty easy--", "start": 1508.26, "duration": 3.09}, {"text": "there's a nonce, 4 byte.", "start": 1511.35, "duration": 1.7}, {"text": "Anything you want goes in there.", "start": 1513.05, "duration": 1.53}, {"text": "You can think of it\nas a you went 32,", "start": 1514.58, "duration": 3.93}, {"text": "there's no meaning to it.", "start": 1518.51, "duration": 2.34}, {"text": "So does anyone see a problem\nwith this nonce field?", "start": 1520.85, "duration": 5.6}, {"text": "Yeah.", "start": 1526.45, "duration": 0.5}, {"text": "AUDIENCE: It's too small.", "start": 1526.95, "duration": 1.042}, {"text": "TADGE DRYJA: Yeah,\nit's too small.", "start": 1527.992, "duration": 1.698}, {"text": "4 bytes-- even in\nthe homework, people", "start": 1529.69, "duration": 3.83}, {"text": "are using 12 something\nbytes for a nonce.", "start": 1533.52, "duration": 4.44}, {"text": "With only 4 bytes of\nnonce, you can go through 2", "start": 1537.96, "duration": 3.03}, {"text": "to the 32 possibilities,\nwhich is not", "start": 1540.99, "duration": 4.5}, {"text": "enough to mine in\nalmost all cases,", "start": 1545.49, "duration": 2.07}, {"text": "because you're going to need\nto go through 2 to the 70", "start": 1547.56, "duration": 2.73}, {"text": "possibilities to find a block.", "start": 1550.29, "duration": 3.21}, {"text": "So what are some ideas for how\ndo you deal with this problem?", "start": 1553.5, "duration": 3.85}, {"text": "Like, it would be nice\nif it was just 8 bytes.", "start": 1557.35, "duration": 2.57}, {"text": "That'd make things simpler.", "start": 1559.92, "duration": 1.17}, {"text": "But the system is what it is.", "start": 1561.09, "duration": 1.71}, {"text": "It's very hard to change.", "start": 1562.8, "duration": 1.41}, {"text": "How, as a miner, would you\nwork around this issue?", "start": 1564.21, "duration": 4.782}, {"text": "AUDIENCE: Adjust the\nversion and time.", "start": 1568.992, "duration": 1.958}, {"text": "TADGE DRYJA: Yeah, so\nyou can adjust version.", "start": 1570.95, "duration": 1.875}, {"text": "So that may be why sometimes\nweird version numbers come up.", "start": 1572.825, "duration": 3.175}, {"text": "Time is a good one\ntoo, since time--", "start": 1576.0, "duration": 1.875}, {"text": "so yeah, adjust time\nand also Merkle root.", "start": 1581.61, "duration": 2.74}, {"text": "So time, if you're off by a\nfew seconds, nobody cares.", "start": 1584.35, "duration": 7.36}, {"text": "So use the low bits of this time\nfield as part of your nonce.", "start": 1591.71, "duration": 4.89}, {"text": "It's kind of in the wrong\nplace, but you can make chips", "start": 1596.6, "duration": 2.4}, {"text": "to sort of fiddle--", "start": 1599.0, "duration": 1.29}, {"text": "twiddle these bits as well.", "start": 1600.29, "duration": 3.06}, {"text": "What's also nice is that\nevery second you can sort of--", "start": 1603.35, "duration": 3.99}, {"text": "you can do it the wrong way.", "start": 1607.34, "duration": 1.26}, {"text": "And you can say,\noh, I'm just going", "start": 1608.6, "duration": 1.458}, {"text": "to take the least significant\n4 bits of my time field", "start": 1610.058, "duration": 4.392}, {"text": "and just use them as\nnonce space randomly.", "start": 1614.45, "duration": 2.29}, {"text": "What's nice is that the\nactual time progresses by one", "start": 1616.74, "duration": 3.98}, {"text": "bit every second.", "start": 1620.72, "duration": 2.25}, {"text": "So as long as your\nchip has enough space--", "start": 1622.97, "duration": 5.033}, {"text": "so you're like, OK,\nI've got 2 bit to 32", "start": 1628.003, "duration": 1.667}, {"text": "here, another 4 bits here,\nso I'm at 2 to the 36.", "start": 1629.67, "duration": 4.63}, {"text": "If you're chip only goes\nthrough 2 to the 36 hashes", "start": 1634.3, "duration": 3.36}, {"text": "every second, you're good\nbecause the actual time", "start": 1637.66, "duration": 3.0}, {"text": "progresses.", "start": 1640.66, "duration": 2.31}, {"text": "The other way you can do it\nis modify the Merkle root.", "start": 1642.97, "duration": 3.69}, {"text": "And you can do that-- so can\nyou think of ways to modify that", "start": 1646.66, "duration": 5.55}, {"text": "without breaking things?", "start": 1652.21, "duration": 2.472}, {"text": "AUDIENCE: Add or\ndrop the transaction.", "start": 1654.682, "duration": 1.768}, {"text": "TADGE DRYJA: Yeah,\nyou could add or you", "start": 1656.45, "duration": 1.14}, {"text": "could drop a transaction.", "start": 1657.59, "duration": 0.99}, {"text": "So you say, OK, I have\nall these transactions.", "start": 1658.58, "duration": 1.917}, {"text": "I'm going to drop one.", "start": 1660.497, "duration": 1.115}, {"text": "That's got some\ndisadvantages, because it", "start": 1661.612, "duration": 1.708}, {"text": "may pay fees to the miner.", "start": 1663.32, "duration": 1.827}, {"text": "AUDIENCE: Changing the order?", "start": 1665.147, "duration": 1.208}, {"text": "TADGE DRYJA: Yep,\nyou can swap them.", "start": 1666.355, "duration": 1.5}, {"text": "You can just say, OK, well,\nthese two are independent.", "start": 1670.55, "duration": 2.29}, {"text": "I'm going to swap them.", "start": 1672.84, "duration": 1.19}, {"text": "This will change,\nwhich will change that.", "start": 1674.03, "duration": 2.75}, {"text": "So you can swap\ntransactions around.", "start": 1676.78, "duration": 3.19}, {"text": "You can also edit what's called\nthe Coinbase, which I think", "start": 1679.97, "duration": 3.15}, {"text": "is in like one more slide.", "start": 1683.12, "duration": 2.32}, {"text": "So yeah, so there's\na bunch of ways", "start": 1685.44, "duration": 1.535}, {"text": "that you can change things.", "start": 1686.975, "duration": 1.125}, {"text": "And so this is really\nwhere you're going", "start": 1688.1, "duration": 1.7}, {"text": "to have all the variation.", "start": 1689.8, "duration": 1.9}, {"text": "You have 32-bit bytes here.", "start": 1691.7, "duration": 3.44}, {"text": "And just even if it\nwas just swapping,", "start": 1695.14, "duration": 1.663}, {"text": "and if you have 1,000\ntransactions, swap", "start": 1696.803, "duration": 1.667}, {"text": "in whatever order you want--", "start": 1698.47, "duration": 1.39}, {"text": "there's enough sort\nof entropy there", "start": 1699.86, "duration": 1.71}, {"text": "that you'll be able to find it.", "start": 1701.57, "duration": 1.768}, {"text": "So what's interesting is\nthat the nonce is there.", "start": 1703.338, "duration": 2.042}, {"text": "And it's important,\nbecause that's", "start": 1705.38, "duration": 1.417}, {"text": "where sort of the\nhigh-speed mining occurs.", "start": 1706.797, "duration": 4.493}, {"text": "But most mining chips will also\nhave circuitry to modify this,", "start": 1711.29, "duration": 4.32}, {"text": "because they're operating\nso quickly that they", "start": 1715.61, "duration": 2.67}, {"text": "will exhaust the\n4-byte nonce space", "start": 1718.28, "duration": 3.09}, {"text": "in a fraction of a second.", "start": 1721.37, "duration": 2.02}, {"text": "And so they'll have to\nswap two transactions,", "start": 1723.39, "duration": 3.4}, {"text": "recalculate a Merkle root, which\ninvolves a few dozen hashes,", "start": 1726.79, "duration": 5.013}, {"text": "and then go back here.", "start": 1731.803, "duration": 0.917}, {"text": "So it actually doesn't hurt\ntheir efficiency too much,", "start": 1732.72, "duration": 2.25}, {"text": "because, OK, I just did 4\nbillion hash operations.", "start": 1734.97, "duration": 4.01}, {"text": "And then I need to\ndo a few dozen more", "start": 1738.98, "duration": 2.13}, {"text": "to get to the next 4 billion.", "start": 1741.11, "duration": 2.43}, {"text": "So it doesn't hurt\nthings too much.", "start": 1743.54, "duration": 2.17}, {"text": "Also, in Bitcoin-- a\nsort of weird quirk--", "start": 1745.71, "duration": 3.64}, {"text": "it's called SHA-256d.", "start": 1749.35, "duration": 2.47}, {"text": "They do SHA-256.", "start": 1751.82, "duration": 1.56}, {"text": "And then from the output,\nthey do a SHA-256 again,", "start": 1753.38, "duration": 3.8}, {"text": "not sure why.", "start": 1757.18, "duration": 0.63}, {"text": "I think in one person's\nfirst problem set,", "start": 1757.81, "duration": 4.957}, {"text": "they inadvertently were\ndoing the same thing", "start": 1762.767, "duration": 1.833}, {"text": "and was like, yeah, that works.", "start": 1764.6, "duration": 3.11}, {"text": "Satoshi, whoever he\nor she was, or they,", "start": 1767.71, "duration": 2.862}, {"text": "just put that in there.", "start": 1770.572, "duration": 0.958}, {"text": "Any questions about this header\nin this format and anything", "start": 1771.53, "duration": 3.02}, {"text": "about it?", "start": 1774.55, "duration": 1.23}, {"text": "It's pretty compact.", "start": 1775.78, "duration": 0.99}, {"text": "It's 80 bytes.", "start": 1776.77, "duration": 0.81}, {"text": "AUDIENCE: [INAUDIBLE]\nincluding the Merkle root.", "start": 1781.244, "duration": 2.556}, {"text": "So if you end up\nmining something,", "start": 1783.8, "duration": 2.038}, {"text": "you don't have to\nput anything there.", "start": 1785.838, "duration": 1.542}, {"text": "So the only incentive\nis the transaction fees?", "start": 1787.38, "duration": 3.117}, {"text": "TADGE DRYJA: In the\nblock reward, which I'll", "start": 1790.497, "duration": 1.833}, {"text": "get to in a second, but yeah.", "start": 1792.33, "duration": 1.208}, {"text": "That's a good question.", "start": 1797.22, "duration": 1.17}, {"text": "Can you put nothing\nin as a Merkle?", "start": 1798.39, "duration": 2.32}, {"text": "I don't think so.", "start": 1800.71, "duration": 0.72}, {"text": "I'm pretty sure you\nneed one transaction.", "start": 1801.43, "duration": 1.34}, {"text": "AUDIENCE: Oh, that's right.", "start": 1802.77, "duration": 0.61}, {"text": "I mean, you need\nthe base for the--", "start": 1803.38, "duration": 1.84}, {"text": "because even if just did it, you\nneed a [INAUDIBLE] transaction.", "start": 1805.22, "duration": 2.9}, {"text": "TADGE DRYJA: You can do that.", "start": 1808.12, "duration": 0.74}, {"text": "And there's many blocks.", "start": 1808.86, "duration": 1.0}, {"text": "So in the first\nyear or so in 2009,", "start": 1809.86, "duration": 2.87}, {"text": "almost all the blocks are empty\nand only have one transaction,", "start": 1812.73, "duration": 3.15}, {"text": "because no one was using it.", "start": 1815.88, "duration": 1.2}, {"text": "But people were mining.", "start": 1817.08, "duration": 1.41}, {"text": "So it was very similar\nto the problem set, where", "start": 1818.49, "duration": 2.47}, {"text": "everyone's just mining,\nand they're not actually", "start": 1820.96, "duration": 2.0}, {"text": "using the system.", "start": 1822.96, "duration": 0.708}, {"text": "AUDIENCE: Bu then right now--", "start": 1823.668, "duration": 1.902}, {"text": "TADGE DRYJA: Right\nnow there's tons.", "start": 1825.57, "duration": 0.77}, {"text": "AUDIENCE: People aren't doing\nthat just because there's", "start": 1826.34, "duration": 1.36}, {"text": "transaction fees.", "start": 1827.7, "duration": 0.78}, {"text": "TADGE DRYJA: Right now--", "start": 1828.48, "duration": 0.66}, {"text": "AUDIENCE: It's their\nonly incentive?", "start": 1829.14, "duration": 0.81}, {"text": "People just decided--", "start": 1829.95, "duration": 1.14}, {"text": "TADGE DRYJA: No, you\nstill get more bitcoins.", "start": 1831.09, "duration": 2.01}, {"text": "So you still get a reward.", "start": 1833.1, "duration": 1.23}, {"text": "The reason you'll see empty\nblocks now is a little tricky.", "start": 1834.33, "duration": 5.71}, {"text": "We're not sure,\nbecause who knows?", "start": 1840.04, "duration": 2.4}, {"text": "But it's probably because of\nblind mining, where you receive", "start": 1842.44, "duration": 4.97}, {"text": "a block, and you\nhaven't actually", "start": 1847.41, "duration": 3.135}, {"text": "looked through the\ncontents of the block yet.", "start": 1850.545, "duration": 1.875}, {"text": "But you want to\nmine the next block.", "start": 1852.42, "duration": 2.61}, {"text": "But you're not sure what\ntransactions to put in.", "start": 1855.03, "duration": 2.79}, {"text": "You see this 80-byte\nheader, and you're like, oh,", "start": 1857.82, "duration": 2.16}, {"text": "someone find a block.", "start": 1859.98, "duration": 1.46}, {"text": "But you only have\nthe header, and you", "start": 1861.44, "duration": 1.57}, {"text": "want to build on top of it.", "start": 1863.01, "duration": 1.125}, {"text": "You have a bunch of transactions\nyou'd like to put in,", "start": 1866.64, "duration": 2.25}, {"text": "but they may have already been\nput into the previous one.", "start": 1868.89, "duration": 3.283}, {"text": "And so you're like,\nwell, I have no idea", "start": 1872.173, "duration": 1.667}, {"text": "what's in the previous one.", "start": 1873.84, "duration": 1.125}, {"text": "I'm just going to mine a\nblock with nothing in it,", "start": 1874.965, "duration": 2.295}, {"text": "that way I'm sure that\nI'm not going to conflict", "start": 1877.26, "duration": 2.515}, {"text": "with my previous one.", "start": 1879.775, "duration": 0.875}, {"text": "You'll often see a block with\nonly one transaction very soon", "start": 1883.59, "duration": 3.15}, {"text": "after its predecessor block.", "start": 1886.74, "duration": 1.77}, {"text": "AUDIENCE: So like every once\nin a while, it would check.", "start": 1888.51, "duration": 3.543}, {"text": "So you're saying if it happened\nand went to a block really", "start": 1892.053, "duration": 2.417}, {"text": "quickly, there's just more\nlikely to be more transactions.", "start": 1894.47, "duration": 2.727}, {"text": "TADGE DRYJA: Right, right,\nbecause a miner might--", "start": 1897.197, "duration": 2.083}, {"text": "it's actually an optimal\nstrategy for a miner", "start": 1899.28, "duration": 2.29}, {"text": "to say, look, first thing\nI'm going do, download", "start": 1901.57, "duration": 2.04}, {"text": "the 80-byte header.", "start": 1903.61, "duration": 2.97}, {"text": "Figure out if it's got\na valid proof of work.", "start": 1906.58, "duration": 2.07}, {"text": "If it does, I'm\ngoing to just assume", "start": 1908.65, "duration": 2.34}, {"text": "it's valid for the\nnext few seconds,", "start": 1910.99, "duration": 2.43}, {"text": "because it probably is.", "start": 1913.42, "duration": 2.58}, {"text": "And then I'm going to try to\nmine a block on top of that.", "start": 1916.0, "duration": 3.43}, {"text": "Reference this previous block.", "start": 1919.43, "duration": 1.25}, {"text": "Mine a block on top.", "start": 1920.68, "duration": 1.05}, {"text": "The thing is, I have no idea\nwhat's actually in the block.", "start": 1921.73, "duration": 2.85}, {"text": "I have no idea what contributes\nto this Merkle root,", "start": 1924.58, "duration": 2.46}, {"text": "because I haven't even\ndownloaded that data yet.", "start": 1927.04, "duration": 2.82}, {"text": "But I can build on top of\nit, just from the header.", "start": 1929.86, "duration": 3.03}, {"text": "But I can't include\ntransactions,", "start": 1932.89, "duration": 1.47}, {"text": "because I have no idea what\ntransactions are in here,", "start": 1934.36, "duration": 2.25}, {"text": "so they might conflict.", "start": 1936.61, "duration": 1.5}, {"text": "So I'll just mine sort of\nblind for a second or two.", "start": 1938.11, "duration": 3.81}, {"text": "And then download all the\ntransactions, validate it.", "start": 1941.92, "duration": 5.04}, {"text": "And now I can include\nmy transactions", "start": 1946.96, "duration": 1.89}, {"text": "that haven't been included.", "start": 1948.85, "duration": 2.12}, {"text": "And so that happens.", "start": 1950.97, "duration": 2.26}, {"text": "It can be an OK strategy.", "start": 1953.23, "duration": 2.1}, {"text": "Sometimes it can lead to\nyou mining an invalid block.", "start": 1955.33, "duration": 3.54}, {"text": "If someone produces an invalid\nblock, and you just see, oh,", "start": 1958.87, "duration": 3.31}, {"text": "well, it's got proof of work,\nyou grab that header, start", "start": 1962.18, "duration": 3.2}, {"text": "mining on top of it.", "start": 1965.38, "duration": 2.58}, {"text": "No matter what you\nmine, it's going", "start": 1967.96, "duration": 1.52}, {"text": "to be invalid, because it's\npointing to an invalid block.", "start": 1969.48, "duration": 2.98}, {"text": "That happened 2015 or 2016.", "start": 1972.46, "duration": 3.67}, {"text": "The summer of 2015 it happened.", "start": 1976.13, "duration": 2.057}, {"text": "And it was like quite extensive.", "start": 1978.187, "duration": 1.333}, {"text": "It was like seven\nor eight blocks", "start": 1979.52, "duration": 1.41}, {"text": "in a row that were all invalid,\nbecause none of the miners", "start": 1980.93, "duration": 2.94}, {"text": "were actually\nverifying anything.", "start": 1983.87, "duration": 2.31}, {"text": "They were just downloading\nthe headers from each other", "start": 1986.18, "duration": 2.49}, {"text": "and being like, yeah, I\nmean, you did the work.", "start": 1988.67, "duration": 4.05}, {"text": "So they were just\nassuming everyone else", "start": 1992.72, "duration": 2.19}, {"text": "was verifying the Merkle roots.", "start": 1994.91, "duration": 2.45}, {"text": "And yeah, so then it ended--", "start": 1997.36, "duration": 2.81}, {"text": "so they lost 25 times 8,\nhowever many bitcoins.", "start": 2000.17, "duration": 4.94}, {"text": "They lost hundreds of bitcoins,\nwhich at the time was still", "start": 2005.11, "duration": 3.78}, {"text": "worth quite a bit-- and now\nit's worth millions of dollars--", "start": 2008.89, "duration": 3.93}, {"text": "just because they weren't\nactually checking things.", "start": 2012.82, "duration": 2.76}, {"text": "AUDIENCE: If I mine a\nblock and it's empty,", "start": 2015.58, "duration": 2.26}, {"text": "do I decrease my chances\nof being mined afterwards?", "start": 2017.84, "duration": 3.23}, {"text": "TADGE DRYJA: No, actually,\nI would say you'd, sort", "start": 2021.07, "duration": 3.09}, {"text": "of game theoretically, you would\nincrease it, because you're not", "start": 2024.16, "duration": 5.53}, {"text": "depleting the mempool.", "start": 2029.69, "duration": 1.99}, {"text": "I need to talk about\nthe actual mining", "start": 2031.68, "duration": 1.73}, {"text": "coinbase and mempool and stuff.", "start": 2033.41, "duration": 1.45}, {"text": "But yeah, it's a\ntricky question.", "start": 2034.86, "duration": 1.67}, {"text": "And I'll try to get back to it.", "start": 2036.53, "duration": 1.41}, {"text": "If I don't, bug me again.", "start": 2037.94, "duration": 2.11}, {"text": "TX-- so in this\nMerkle root, you've", "start": 2040.05, "duration": 1.79}, {"text": "got all these transactions.", "start": 2041.84, "duration": 1.32}, {"text": "They have a specified order.", "start": 2043.16, "duration": 2.07}, {"text": "Transaction 0 is the\ncoinbase transaction.", "start": 2045.23, "duration": 2.82}, {"text": "And it's special.", "start": 2048.05, "duration": 1.169}, {"text": "It generates new coins,\nand it takes fees", "start": 2049.219, "duration": 2.746}, {"text": "from all the other\ntransactions in the block.", "start": 2051.965, "duration": 1.875}, {"text": "I think Neha mentioned\nthis yesterday,", "start": 2053.84, "duration": 2.74}, {"text": "where if you have a difference\nbetween the input amounts", "start": 2056.58, "duration": 3.559}, {"text": "and output amounts,\nthat's implicitly a fee.", "start": 2060.139, "duration": 4.091}, {"text": "So if your input--", "start": 2064.23, "duration": 1.86}, {"text": "so here, Neha's thing,\nyou're spending 20 coins.", "start": 2066.09, "duration": 3.29}, {"text": "You've got 5, 10, 4.", "start": 2069.38, "duration": 2.009}, {"text": "Well, there's only 19\ncoins in the output,", "start": 2071.389, "duration": 2.671}, {"text": "so there's an implicit\nfee of 1 coin.", "start": 2074.06, "duration": 4.409}, {"text": "That one coin can go\nto transactions 0.", "start": 2078.469, "duration": 4.351}, {"text": "So transaction 0 has\nessentially no input.", "start": 2082.82, "duration": 4.33}, {"text": "Transaction 0's input\nfield is just empty,", "start": 2087.15, "duration": 3.21}, {"text": "anything you want to put, any\nbytes you want to put in there.", "start": 2090.36, "duration": 2.67}, {"text": "Its output field\ngenerates new coins.", "start": 2093.03, "duration": 2.459}, {"text": "So that's currently\n12 and 1/2 coins.", "start": 2095.489, "duration": 2.101}, {"text": "So currently, if you mine\na block with only TX0,", "start": 2097.59, "duration": 3.54}, {"text": "you get 12 and 1/2 coins.", "start": 2101.13, "duration": 1.41}, {"text": "If you mine a block with\nthousands of transactions,", "start": 2102.54, "duration": 2.28}, {"text": "you get the 12 and 1/2\ncoins plus the difference", "start": 2104.82, "duration": 3.272}, {"text": "between the input and outputs\nof all the other transactions", "start": 2108.092, "duration": 2.458}, {"text": "in the block, which can\nbe even more than 12", "start": 2110.55, "duration": 2.94}, {"text": "and-- which can recently,\nlike in January or December,", "start": 2113.49, "duration": 4.17}, {"text": "there were quite a few blocks\nwhere they're getting 25, 26,", "start": 2117.66, "duration": 3.58}, {"text": "27 coins, because the total\nfees for the entire block", "start": 2121.24, "duration": 3.59}, {"text": "were more than 12 and 1/2 coins,\nwhich is hundreds of thousands", "start": 2124.83, "duration": 4.68}, {"text": "of dollars now.", "start": 2129.51, "duration": 0.72}, {"text": "So it's kind of cool.", "start": 2130.23, "duration": 2.31}, {"text": "The fees have since decreased.", "start": 2132.54, "duration": 1.59}, {"text": "Fees are highly variable.", "start": 2134.13, "duration": 1.65}, {"text": "And we'll talk about fees\nin a few more lectures.", "start": 2135.78, "duration": 3.15}, {"text": "And it's kind of a mess,\nbut it's an evolving area", "start": 2138.93, "duration": 3.87}, {"text": "in this whole network thing.", "start": 2142.8, "duration": 3.6}, {"text": "So you've got your\ncoinbase transaction.", "start": 2146.4, "duration": 2.01}, {"text": "That's important.", "start": 2148.41, "duration": 0.82}, {"text": "That's why people are doing this\nstuff, because they want money.", "start": 2149.23, "duration": 3.32}, {"text": "All the other transactions\ncan be shuffled around.", "start": 2152.55, "duration": 2.76}, {"text": "However, they can\nonly spend outputs", "start": 2155.31, "duration": 3.12}, {"text": "from previous transactions.", "start": 2158.43, "duration": 1.92}, {"text": "And previous means\nthey have an index", "start": 2160.35, "duration": 2.19}, {"text": "within the block that's lower.", "start": 2162.54, "duration": 2.07}, {"text": "So for example, you\nhave transaction", "start": 2164.61, "duration": 2.43}, {"text": "B spends an output of\ntransaction A. Transaction A", "start": 2167.04, "duration": 4.68}, {"text": "must come first in\nthe block ordering.", "start": 2171.72, "duration": 3.12}, {"text": "This makes it so that you can\ngo through in a linear fashion", "start": 2174.84, "duration": 2.7}, {"text": "and validate every\ntransaction in order.", "start": 2177.54, "duration": 2.64}, {"text": "Otherwise, you'd go through,\nsee, OK, transaction 0, I", "start": 2180.18, "duration": 2.973}, {"text": "don't have to validate that.", "start": 2183.153, "duration": 1.167}, {"text": "That's coinbase--\ntransaction 1, transaction 2.", "start": 2184.32, "duration": 2.908}, {"text": "And then you see transaction 3.", "start": 2187.228, "duration": 1.292}, {"text": "It appears to be\nspending something", "start": 2188.52, "duration": 1.92}, {"text": "you've never heard of.", "start": 2190.44, "duration": 2.2}, {"text": "So that would at first--", "start": 2192.64, "duration": 1.5}, {"text": "that would appear to be invalid.", "start": 2194.14, "duration": 1.638}, {"text": "And then maybe you go through\nanother few transactions,", "start": 2195.778, "duration": 2.292}, {"text": "say, oh, this creates the\noutput that this thing I just", "start": 2198.07, "duration": 4.44}, {"text": "saw before spends.", "start": 2202.51, "duration": 1.76}, {"text": "It's sort of out of order.", "start": 2204.27, "duration": 1.36}, {"text": "It makes things very\ncomplicated to validate.", "start": 2205.63, "duration": 2.19}, {"text": "And so this rule ensures that\nif you go through and just check", "start": 2207.82, "duration": 3.9}, {"text": "every transaction in order,\nit'll all make sense.", "start": 2211.72, "duration": 3.64}, {"text": "Yes.", "start": 2215.36, "duration": 0.5}, {"text": "AUDIENCE: Is there any benefit\nmoving earlier or later?", "start": 2215.86, "duration": 2.687}, {"text": "TADGE DRYJA: In the block?", "start": 2218.547, "duration": 1.083}, {"text": "AUDIENCE: Yeah.", "start": 2219.63, "duration": 1.53}, {"text": "TADGE DRYJA: No,\nI don't think so.", "start": 2221.16, "duration": 1.48}, {"text": "I mean, I can't think of one.", "start": 2222.64, "duration": 3.79}, {"text": "Yeah, it's just sort of random.", "start": 2226.43, "duration": 2.36}, {"text": "A lot of times they'll\norganize it by fee rate.", "start": 2228.79, "duration": 2.22}, {"text": "Or by default, they'll\njust organize it", "start": 2231.01, "duration": 2.34}, {"text": "by when they saw them first.", "start": 2233.35, "duration": 1.86}, {"text": "So it's pretty arbitrary.", "start": 2235.21, "duration": 1.535}, {"text": "AUDIENCE: Does\nthat mean that you", "start": 2236.745, "duration": 1.375}, {"text": "have to wait until\nthe transaction", "start": 2238.12, "duration": 1.705}, {"text": "that the major output\nhas been mined,", "start": 2239.825, "duration": 2.03}, {"text": "in order spend that again?", "start": 2241.855, "duration": 1.355}, {"text": "TADGE DRYJA: No,\nalthough if they did,", "start": 2243.21, "duration": 2.98}, {"text": "that would make the software\na lot simpler and easier", "start": 2246.19, "duration": 2.61}, {"text": "to deal with.", "start": 2248.8, "duration": 1.12}, {"text": "But that is not how it works.", "start": 2249.92, "duration": 1.93}, {"text": "So for example-- I'll draw\nit-- you can have a block where", "start": 2256.92, "duration": 6.48}, {"text": "there's-- let's do it this way.", "start": 2263.4, "duration": 1.95}, {"text": "So you have TX0.", "start": 2265.35, "duration": 1.2}, {"text": "There's coinbase transaction,\ntransaction 1, transaction 2,", "start": 2266.55, "duration": 4.68}, {"text": "transaction 3.", "start": 2271.23, "duration": 1.83}, {"text": "And transaction 3 may be\nspending something that", "start": 2273.06, "duration": 3.51}, {"text": "was generated in transaction 1.", "start": 2276.57, "duration": 2.7}, {"text": "That can happen.", "start": 2279.27, "duration": 1.32}, {"text": "So if you make transaction 1\nbroadcast it. it's unconfirmed.", "start": 2280.59, "duration": 4.71}, {"text": "You then make transaction\n3 broadcast it,", "start": 2285.3, "duration": 2.01}, {"text": "spends transaction 1.", "start": 2287.31, "duration": 1.84}, {"text": "The miner can put\nthose in the blocks.", "start": 2289.15, "duration": 1.7}, {"text": "They must put it in order.", "start": 2290.85, "duration": 1.53}, {"text": "So if this happens, you\ncan't switch them in order.", "start": 2292.38, "duration": 3.93}, {"text": "But that's considered OK.", "start": 2296.31, "duration": 1.71}, {"text": "It makes parallel-- it makes\nmulti-core validation more", "start": 2298.02, "duration": 3.66}, {"text": "annoying.", "start": 2301.68, "duration": 1.575}, {"text": "If you said, no, you can only\nuse outputs that have already", "start": 2303.255, "duration": 3.135}, {"text": "been confirmed, then\nthe block validation", "start": 2306.39, "duration": 3.45}, {"text": "becomes embarrassingly\nparallel, because you can just", "start": 2309.84, "duration": 2.4}, {"text": "validate every\ntransaction independently.", "start": 2312.24, "duration": 2.715}, {"text": "That would be kind of nice.", "start": 2314.955, "duration": 1.125}, {"text": "There's other\ninteresting reasons", "start": 2318.756, "duration": 1.644}, {"text": "why this is also useful.", "start": 2320.4, "duration": 2.195}, {"text": "I mean, if I were\ndesigning it, I", "start": 2322.595, "duration": 1.375}, {"text": "would say you have to\nconfirm, because it just", "start": 2323.97, "duration": 1.71}, {"text": "makes things simpler.", "start": 2325.68, "duration": 0.875}, {"text": "But I was not Satoshi.", "start": 2326.555, "duration": 2.175}, {"text": "So yeah, the order\nis fairly arbitrary.", "start": 2328.73, "duration": 1.83}, {"text": "Any other questions about block\nordering, Merkle root stuff?", "start": 2330.56, "duration": 2.5}, {"text": "And then we're going to\nhave a quick intermission", "start": 2333.06, "duration": 2.042}, {"text": "right at the halfway point.", "start": 2335.102, "duration": 1.132}, {"text": "Sounds good, so\n256-second break.", "start": 2338.98, "duration": 5.42}, {"text": "So now I'll talk about the\nsynchronization process.", "start": 2344.4, "duration": 2.67}, {"text": "How does this actually\nwork in the software", "start": 2347.07, "duration": 3.15}, {"text": "when you download Bitcoin?", "start": 2350.22, "duration": 1.92}, {"text": "So first, you download Bitcoin.", "start": 2352.14, "duration": 2.16}, {"text": "You go to bitcoin.org.", "start": 2354.3, "duration": 2.16}, {"text": "of Your friend hands you\na USB drive and says,", "start": 2356.46, "duration": 2.62}, {"text": "hey, I got some good stuff, man,\nthis new thing called Bitcoin.", "start": 2359.08, "duration": 3.95}, {"text": "And so you've got the\nBitcoin EXE file or DMG file,", "start": 2363.03, "duration": 4.08}, {"text": "or the binary, or the code.", "start": 2367.11, "duration": 1.592}, {"text": "And you want to know what's\nbeen going on for the last nine", "start": 2368.702, "duration": 2.458}, {"text": "years?", "start": 2371.16, "duration": 1.35}, {"text": "So first, you\ndownload the binary,", "start": 2372.51, "duration": 1.5}, {"text": "or you compile the code.", "start": 2374.01, "duration": 1.38}, {"text": "And you verify all the GPG\nsignatures of this code,", "start": 2375.39, "duration": 4.367}, {"text": "if you want to do this securely.", "start": 2379.757, "duration": 1.333}, {"text": "So I'm sure everyone has their\nPGP keys on the MIT PGP server", "start": 2381.09, "duration": 6.03}, {"text": "and goes to key signing parties\nheld on the weekends, right?", "start": 2387.12, "duration": 4.65}, {"text": "Yeah, no?", "start": 2391.77, "duration": 2.277}, {"text": "AUDIENCE: Keybase is cool.", "start": 2394.047, "duration": 1.083}, {"text": "Base", "start": 2395.13, "duration": 0.39}, {"text": "TADGE DRYJA: Keybase\nis also useful, yeah.", "start": 2395.52, "duration": 1.75}, {"text": "So I have my PGP key\nhash on my business card.", "start": 2397.27, "duration": 3.68}, {"text": "I don't think anyone's\nactually ever used it.", "start": 2400.95, "duration": 3.51}, {"text": "But the Bitcoin nerds\nactually do do this.", "start": 2404.46, "duration": 2.46}, {"text": "And they're very sort\nof annoying about it,", "start": 2406.92, "duration": 5.76}, {"text": "because a really\ngood attack vector", "start": 2412.68, "duration": 3.06}, {"text": "is to get someone to download\ncompromised Bitcoin code.", "start": 2415.74, "duration": 3.69}, {"text": "It's like the best\nattack vector ever", "start": 2419.43, "duration": 1.86}, {"text": "if you're trying to do\nsomething sneaky, mainly just", "start": 2421.29, "duration": 3.84}, {"text": "to steal all the money.", "start": 2425.13, "duration": 1.11}, {"text": "If you get them to download\na Bitcoin binary that you", "start": 2426.24, "duration": 2.55}, {"text": "control, that you put\nsome backdoor code in,", "start": 2428.79, "duration": 4.05}, {"text": "the code can be like two lines.", "start": 2432.84, "duration": 1.33}, {"text": "It's like, open a TCP\nconnection to my computer.", "start": 2434.17, "duration": 4.07}, {"text": "Send me all the private keys.", "start": 2438.24, "duration": 1.56}, {"text": "We're good.", "start": 2439.8, "duration": 0.99}, {"text": "Or if you want to be\nmore sophisticated,", "start": 2440.79, "duration": 3.0}, {"text": "every time they click Send\nand type in their password,", "start": 2443.79, "duration": 2.82}, {"text": "I just change all the addresses\nand all the outputs to me,", "start": 2446.61, "duration": 3.45}, {"text": "and like, every time\nthey try to send money.", "start": 2450.06, "duration": 1.85}, {"text": "To UI sort of shows that they're\nsending money but actually just", "start": 2451.91, "duration": 3.17}, {"text": "send to me.", "start": 2455.08, "duration": 0.5}, {"text": "And they won't find\nout for a little while.", "start": 2455.58, "duration": 1.792}, {"text": "There's a lot of\nthings where you", "start": 2457.372, "duration": 2.228}, {"text": "want to be running the\nright Bitcoin code.", "start": 2459.6, "duration": 3.33}, {"text": "And that's a hard problem.", "start": 2462.93, "duration": 1.77}, {"text": "Because we're sort of\noperating in this Trust List,", "start": 2464.7, "duration": 2.35}, {"text": "decentralized\nnetwork, how do you", "start": 2467.05, "duration": 2.54}, {"text": "get into this in the beginning?", "start": 2469.59, "duration": 2.378}, {"text": "If it's your friend\nand saying, hey, here's", "start": 2471.968, "duration": 1.792}, {"text": "the Bitcoin I'm running.", "start": 2473.76, "duration": 1.0}, {"text": "I know this is good.", "start": 2474.76, "duration": 0.86}, {"text": "Then it works.", "start": 2475.62, "duration": 0.787}, {"text": "But just a website-- what if\nsomeone hacks the website--", "start": 2476.407, "duration": 2.333}, {"text": "things like that?", "start": 2478.74, "duration": 0.93}, {"text": "It's like a huge rabbit hole.", "start": 2479.67, "duration": 1.35}, {"text": "And you can try to worry\nabout it for years.", "start": 2481.02, "duration": 4.02}, {"text": "But anyway, you\ndownload the binary,", "start": 2485.04, "duration": 1.5}, {"text": "assume you've somehow\ngotten the binary,", "start": 2486.54, "duration": 2.04}, {"text": "and you're pretty sure\nit's the right software.", "start": 2488.58, "duration": 2.7}, {"text": "So how do you connect\nto this network?", "start": 2491.28, "duration": 1.71}, {"text": "Well, there are these\nhardcoded DNS seeds in order", "start": 2492.99, "duration": 3.24}, {"text": "to find peers in the beginning.", "start": 2496.23, "duration": 1.44}, {"text": "If you know how DNS works, it's\nhow you look up IP addresses", "start": 2497.67, "duration": 2.97}, {"text": "based on a hostname.", "start": 2500.64, "duration": 1.26}, {"text": "There are some servers that will\nreturn multiple different IP", "start": 2501.9, "duration": 3.09}, {"text": "addresses every\ntime you query them.", "start": 2504.99, "duration": 4.28}, {"text": "And those are IP addresses\nof currently running", "start": 2509.27, "duration": 5.62}, {"text": "Bitcoin nodes.", "start": 2514.89, "duration": 1.152}, {"text": "So the idea is, OK, someone's\nrunning a Bitcoin node.", "start": 2516.042, "duration": 2.208}, {"text": "They've got their DNS server.", "start": 2518.25, "duration": 1.77}, {"text": "You query that DNS server,\nand it will hand you", "start": 2520.02, "duration": 2.55}, {"text": "out some IP addresses.", "start": 2522.57, "duration": 3.15}, {"text": "This is also sort\nof centralized,", "start": 2525.72, "duration": 2.82}, {"text": "slash trusted, slash whatever,\nin that if someone compromises", "start": 2528.54, "duration": 3.96}, {"text": "these four or five\nDNS servers, you", "start": 2532.5, "duration": 2.873}, {"text": "might not be able to connect\nto the Bitcoin network.", "start": 2535.373, "duration": 2.167}, {"text": "So in practice, it's not\ncompletely mathematically", "start": 2537.54, "duration": 2.64}, {"text": "secure in Trust List.", "start": 2540.18, "duration": 1.202}, {"text": "There's all these\nreal-world issues", "start": 2541.382, "duration": 1.458}, {"text": "that's like, how do I know\nI've got the right software?", "start": 2542.84, "duration": 2.44}, {"text": "How do I know I'm connecting\nto the actual Bitcoin network?", "start": 2545.28, "duration": 2.8}, {"text": "What if my ISP is\nblocking me and sending me", "start": 2548.08, "duration": 2.15}, {"text": "to some other network,\nor things like that?", "start": 2550.23, "duration": 3.31}, {"text": "So in practice, it sort\nof works OK right now.", "start": 2553.54, "duration": 2.81}, {"text": "You connect to the DNS seeds.", "start": 2556.35, "duration": 1.56}, {"text": "And then you connect\nto a Bitcoin node,", "start": 2557.91, "duration": 2.4}, {"text": "and you ask for headers.", "start": 2560.31, "duration": 1.11}, {"text": "You say, hey, I just showed up.", "start": 2561.42, "duration": 3.72}, {"text": "I know about one header.", "start": 2565.14, "duration": 1.35}, {"text": "There's a hardcoded header in\nthe code called the genesis", "start": 2566.49, "duration": 3.21}, {"text": "block that Satoshi did.", "start": 2569.7, "duration": 2.82}, {"text": "And you say, hey, I've\ngot this genesis block.", "start": 2572.52, "duration": 2.01}, {"text": "Do you know anything that builds\nabove this genesis block, that", "start": 2574.53, "duration": 3.6}, {"text": "comes after?", "start": 2578.13, "duration": 1.35}, {"text": "And they say, yes, I\nactually know 500,000 headers", "start": 2579.48, "duration": 3.108}, {"text": "that come after it.", "start": 2582.588, "duration": 0.792}, {"text": "And they'll start\nsending it to you.", "start": 2583.38, "duration": 2.04}, {"text": "They send it to you in\na couple of thousand", "start": 2585.42, "duration": 2.08}, {"text": "of headers at a time.", "start": 2587.5, "duration": 2.21}, {"text": "And then you start to download\nall those and verify them.", "start": 2589.71, "duration": 4.56}, {"text": "The header chain,\nyou get it first.", "start": 2594.27, "duration": 2.7}, {"text": "And it's actually very quick.", "start": 2596.97, "duration": 1.53}, {"text": "You can do it in under a minute\nif you have a good internet", "start": 2598.5, "duration": 2.458}, {"text": "connection.", "start": 2600.958, "duration": 0.632}, {"text": "And you verify all the work\nbefore you do anything else.", "start": 2601.59, "duration": 2.4}, {"text": "So this is nice in that\nthe attacker, in order", "start": 2603.99, "duration": 3.21}, {"text": "to sort of make you\ndo more work here,", "start": 2607.2, "duration": 3.45}, {"text": "would have to do a\nlot of proof of work.", "start": 2610.65, "duration": 3.28}, {"text": "But for you, it's very\nquick to verify everything.", "start": 2613.93, "duration": 2.96}, {"text": "Even half a million\nheaders, 30 seconds", "start": 2616.89, "duration": 3.545}, {"text": "if you've got a good internet\nconnection, something", "start": 2620.435, "duration": 2.125}, {"text": "like that, because all you're\ndoing is one hash per header.", "start": 2622.56, "duration": 3.51}, {"text": "You just download the\nheader, check the bits,", "start": 2626.07, "duration": 2.64}, {"text": "check the time, make\nsure the times are", "start": 2628.71, "duration": 1.65}, {"text": "like progressing reasonably.", "start": 2630.36, "duration": 2.67}, {"text": "If the times keep going\nbackwards for like,", "start": 2633.03, "duration": 2.24}, {"text": "I think it's 10 blocks, then\nyou consider it invalid.", "start": 2635.27, "duration": 4.025}, {"text": "But your computer\ncan actually do this.", "start": 2639.295, "duration": 1.625}, {"text": "It's 500,000 hash functions.", "start": 2640.92, "duration": 1.74}, {"text": "And I'm sure if you've\nseen for the problem set,", "start": 2642.66, "duration": 2.46}, {"text": "you can do that in a few\nseconds in many cases.", "start": 2645.12, "duration": 3.19}, {"text": "So you can verify the work\ndone throughout the entirety", "start": 2648.31, "duration": 2.99}, {"text": "of the Bitcoin's\nexistence pretty quickly.", "start": 2651.3, "duration": 4.22}, {"text": "So then you've got\n500,000 headers.", "start": 2655.52, "duration": 2.4}, {"text": "And now you need to actually\ndownload the blocks.", "start": 2657.92, "duration": 4.19}, {"text": "Any questions about\nheader synchronization?", "start": 2662.11, "duration": 4.34}, {"text": "Seems pretty\nstraight-- oh, yeah.", "start": 2666.45, "duration": 1.692}, {"text": "AUDIENCE: Can you\ncatch any of that work,", "start": 2668.142, "duration": 1.708}, {"text": "since you're going to see some\nof these every time you sync?", "start": 2669.85, "duration": 3.95}, {"text": "TADGE DRYJA: Well, yeah,\nyou save it to disk.", "start": 2673.8, "duration": 2.02}, {"text": "So you don't have to, like,\nif you shut your computer off,", "start": 2675.82, "duration": 2.84}, {"text": "turn it on the next\ntime, you've already", "start": 2678.66, "duration": 1.77}, {"text": "got all those headers on disk.", "start": 2680.43, "duration": 1.25}, {"text": "Basically, you save them to\ndisk once you've verified them.", "start": 2681.68, "duration": 3.61}, {"text": "So you download a\ncouple thousand.", "start": 2685.29, "duration": 1.42}, {"text": "It builds linearly,\nso it's nice for you", "start": 2686.71, "duration": 1.667}, {"text": "to like download them, validate,\nand as you validate, write them", "start": 2688.377, "duration": 2.666}, {"text": "to disk.", "start": 2691.043, "duration": 0.517}, {"text": "And then when you start\nbackup, they're on disk.", "start": 2691.56, "duration": 2.25}, {"text": "You trust your own disk.", "start": 2693.81, "duration": 1.08}, {"text": "If someone goes in\nand modifies things", "start": 2694.89, "duration": 1.77}, {"text": "on disk between running of\nBitcoin, all bets are off.", "start": 2696.66, "duration": 5.28}, {"text": "So you sort of\nimplicitly trust that.", "start": 2701.94, "duration": 2.31}, {"text": "So yeah, that's pretty\nquick, works well.", "start": 2704.25, "duration": 2.742}, {"text": "Then you get to\nthe real hard part,", "start": 2706.992, "duration": 1.458}, {"text": "where you now have to\nvalidate all these signatures", "start": 2708.45, "duration": 2.19}, {"text": "and download all\nthese transactions.", "start": 2710.64, "duration": 1.927}, {"text": "Any other questions?", "start": 2712.567, "duration": 0.833}, {"text": "Good?", "start": 2713.4, "duration": 2.1}, {"text": "So then it's called IBD,\ninitial block download.", "start": 2715.5, "duration": 3.652}, {"text": "So you get the headers first.", "start": 2719.152, "duration": 1.208}, {"text": "That's quick.", "start": 2720.36, "duration": 0.93}, {"text": "Now you start asking\nyour peers, hey, here's", "start": 2721.29, "duration": 3.06}, {"text": "this header from\n2009, block height 1.", "start": 2724.35, "duration": 5.16}, {"text": "Here's the header.", "start": 2729.51, "duration": 0.75}, {"text": "Can you give me the full block?", "start": 2730.26, "duration": 3.0}, {"text": "I have the header.", "start": 2733.26, "duration": 0.99}, {"text": "What are all the things that\ngo into the Merkle root?", "start": 2734.25, "duration": 3.2}, {"text": "So you request\nblocks from peers.", "start": 2737.45, "duration": 2.5}, {"text": "You match the transaction lists,\nthe Merkle root and the header.", "start": 2739.95, "duration": 3.06}, {"text": "And you process each\ntransaction in order.", "start": 2743.01, "duration": 1.89}, {"text": "So download it.", "start": 2744.9, "duration": 1.59}, {"text": "Say, OK, here's all\nthese transactions.", "start": 2746.49, "duration": 1.72}, {"text": "Let me take the\nhash of all of them.", "start": 2748.21, "duration": 1.97}, {"text": "Compute the Merkle root.", "start": 2750.18, "duration": 1.68}, {"text": "Make sure it matches\nthe Merkle root", "start": 2751.86, "duration": 1.98}, {"text": "I see in the header\nI've already gotten.", "start": 2753.84, "duration": 2.7}, {"text": "And now process\neach transaction.", "start": 2756.54, "duration": 2.8}, {"text": "So what do we do to\nprocess transactions?", "start": 2759.34, "duration": 3.61}, {"text": "So you've got this UTXO DB.", "start": 2762.95, "duration": 3.3}, {"text": "So this is unspent\ntransaction output.", "start": 2766.25, "duration": 3.97}, {"text": "So all the cool--", "start": 2770.22, "duration": 1.55}, {"text": "I'm sure in like 2030, there\nwill be a new slang term", "start": 2771.77, "duration": 3.21}, {"text": "where we'll just\ncall money UTXOs,", "start": 2774.98, "duration": 2.14}, {"text": "like, hey I've\ngot a lot of UTXO.", "start": 2777.12, "duration": 2.068}, {"text": "I mean, I'm already doing that.", "start": 2779.188, "duration": 1.292}, {"text": "And I'm pretty ahead\nof the times, so.", "start": 2780.48, "duration": 1.94}, {"text": "So you've got this\ndatabase, which", "start": 2785.02, "duration": 1.75}, {"text": "is basically a key-value store.", "start": 2786.77, "duration": 2.64}, {"text": "And it just has\ntransaction ID index--", "start": 2789.41, "duration": 3.99}, {"text": "so this sort of how\nyou reference inputs", "start": 2793.4, "duration": 4.65}, {"text": "in Bitcoin, the transaction\nID index as the key.", "start": 2798.05, "duration": 3.33}, {"text": "And then the value\nis just the output,", "start": 2801.38, "duration": 3.42}, {"text": "the scriptsig and 8-byte amount.", "start": 2804.8, "duration": 5.2}, {"text": "So it's pretty compact.", "start": 2810.0, "duration": 1.077}, {"text": "You've got all these key values.", "start": 2811.077, "duration": 1.333}, {"text": "And it's using level DB.", "start": 2812.41, "duration": 2.16}, {"text": "But you could use some other\nkey-value store database.", "start": 2814.57, "duration": 2.72}, {"text": "And the idea is, OK, every\ntime you get a transaction,", "start": 2817.29, "duration": 3.18}, {"text": "validate all the inputs.", "start": 2820.47, "duration": 1.357}, {"text": "Make sure all the\nsignatures are good.", "start": 2821.827, "duration": 1.583}, {"text": "Make sure it's spending\nthings that actually", "start": 2823.41, "duration": 2.13}, {"text": "exist in your UTXO set.", "start": 2825.54, "duration": 1.71}, {"text": "And delete those inputs\nfrom your UTXO DB.", "start": 2830.13, "duration": 3.74}, {"text": "You say, OK, this\ntransaction is spending", "start": 2833.87, "duration": 1.93}, {"text": "these inputs, so delete.", "start": 2835.8, "duration": 1.723}, {"text": "So [INAUDIBLE], sorry.", "start": 2837.523, "duration": 0.917}, {"text": "First, make sure the\ntransaction's valid,", "start": 2838.44, "duration": 2.46}, {"text": "given your current UTXO DB.", "start": 2840.9, "duration": 1.95}, {"text": "So validate that all\nthese inputs exist.", "start": 2842.85, "duration": 2.97}, {"text": "Validate all the\nsignatures are correct.", "start": 2845.82, "duration": 2.63}, {"text": "Then you're saying, OK,\nthis transaction is good.", "start": 2848.45, "duration": 2.85}, {"text": "Now I modify my database by\ndeleting all the inputs that", "start": 2851.3, "duration": 4.23}, {"text": "are consumed and adding\nall these new outputs", "start": 2855.53, "duration": 4.92}, {"text": "for the transaction.", "start": 2860.45, "duration": 2.83}, {"text": "So this modifies the\ndatabase in place.", "start": 2863.28, "duration": 2.85}, {"text": "And you're sort of\nconstantly reading", "start": 2866.13, "duration": 2.25}, {"text": "from it to validate\ninputs, and then writing", "start": 2868.38, "duration": 5.06}, {"text": "to it to delete inputs,\nand then writing to it", "start": 2873.44, "duration": 2.52}, {"text": "again to add outputs.", "start": 2875.96, "duration": 2.49}, {"text": "So it doesn't seem too bad.", "start": 2878.45, "duration": 2.49}, {"text": "But there's a lot\nof disk access.", "start": 2880.94, "duration": 2.06}, {"text": "And the UTXO DB is a key-value\nstore with a lot of keys.", "start": 2883.0, "duration": 3.28}, {"text": "The values are very small.", "start": 2886.28, "duration": 1.41}, {"text": "So it's not like a\ncrazy database problem,", "start": 2887.69, "duration": 3.21}, {"text": "if anyone's interested\nin databases and stuff.", "start": 2890.9, "duration": 3.6}, {"text": "But it can be slow.", "start": 2894.5, "duration": 1.59}, {"text": "And we want to\nreally optimize it.", "start": 2896.09, "duration": 2.6}, {"text": "So when you think the\ninitial block download,", "start": 2898.69, "duration": 3.63}, {"text": "you're doing this\n300 million times.", "start": 2902.32, "duration": 1.53}, {"text": "So there's about 300 million\ntransactions historically.", "start": 2903.85, "duration": 4.27}, {"text": "So you're validating signature,\ndeleting input, adding", "start": 2908.12, "duration": 3.02}, {"text": "output, 300 million times.", "start": 2911.14, "duration": 1.63}, {"text": "It ends up being about 170\ngigabytes of downloads.", "start": 2912.77, "duration": 3.23}, {"text": "And then the end\nresult, when you're", "start": 2916.0, "duration": 1.5}, {"text": "done modifying this\ndatabase, is that you", "start": 2917.5, "duration": 3.66}, {"text": "have 55 million transaction\noutputs remaining.", "start": 2921.16, "duration": 3.18}, {"text": "And it's about 3.2\ngigabytes of disk use.", "start": 2924.34, "duration": 3.91}, {"text": "So yeah, but you had to download\nthat 170 gigabytes to get", "start": 2928.25, "duration": 4.85}, {"text": "to the 3.2-gigabyte\nend state, because most", "start": 2933.1, "duration": 3.75}, {"text": "of the transactions that\nhave been created and most", "start": 2936.85, "duration": 2.22}, {"text": "of the outputs have\nthen later been spent.", "start": 2939.07, "duration": 2.82}, {"text": "So there's a lot of churn.", "start": 2941.89, "duration": 3.04}, {"text": "So yeah, of the 300 million--", "start": 2944.93, "duration": 1.827}, {"text": "sorry, these are not\nthe same numbers.", "start": 2946.757, "duration": 1.583}, {"text": "I was actually looking.", "start": 2948.34, "duration": 1.37}, {"text": "How many transaction\noutputs have been created", "start": 2949.71, "duration": 2.127}, {"text": "throughout all of Bitcoin?", "start": 2951.837, "duration": 1.083}, {"text": "And I couldn't find the number.", "start": 2952.92, "duration": 1.292}, {"text": "And I didn't want to write\nsoftware to figure it out.", "start": 2954.212, "duration": 2.908}, {"text": "But you can certainly figure\nit out from the blockchain.", "start": 2957.12, "duration": 5.34}, {"text": "But yeah, this is\ntransaction outputs.", "start": 2962.46, "duration": 2.46}, {"text": "How many total\ntransactions have TXOs?", "start": 2964.92, "duration": 2.548}, {"text": "I'm not sure.", "start": 2967.468, "duration": 0.542}, {"text": "But yeah, so it's pretty big.", "start": 2968.01, "duration": 1.65}, {"text": "But it's reasonable.", "start": 2969.66, "duration": 0.99}, {"text": "Like, we can do this\non today's computers.", "start": 2970.65, "duration": 1.75}, {"text": "If you've got a decent\nlaptop, this is possible.", "start": 2972.4, "duration": 2.3}, {"text": "This total time taken\ndepends on a lot of factors.", "start": 2974.7, "duration": 4.14}, {"text": "Has anyone actually done\ninitial block download", "start": 2978.84, "duration": 2.28}, {"text": "and synced to Bitcoin\nnode, and like,", "start": 2981.12, "duration": 1.62}, {"text": "want to say about how\nquickly they did it or?", "start": 2982.74, "duration": 2.747}, {"text": "OK, James, how long did it take?", "start": 2985.487, "duration": 1.333}, {"text": "AUDIENCE: For 0.15, it's\nactually quite quick.", "start": 2986.82, "duration": 3.72}, {"text": "On a spinning disk it will\ntake about six hours maybe.", "start": 2990.54, "duration": 3.577}, {"text": "TADGE DRYJA: On a spinning disk?", "start": 2994.117, "duration": 1.333}, {"text": "AUDIENCE: Yeah, yeah, with the\nnew one, it's really quick.", "start": 2995.45, "duration": 3.31}, {"text": "TADGE DRYJA:\nBecause I run 0.15.1", "start": 2998.76, "duration": 1.83}, {"text": "on a laptop with\na spinning disk,", "start": 3000.59, "duration": 1.8}, {"text": "and it'll take like overnight\nto just sync up a week or so.", "start": 3002.39, "duration": 4.83}, {"text": "It's really slow,\nbut I don't know.", "start": 3007.22, "duration": 1.47}, {"text": "AUDIENCE: Like, my\nmum tried to start it,", "start": 3008.69, "duration": 1.18}, {"text": "and it did it from scratch.", "start": 3009.87, "duration": 1.125}, {"text": "It did it in like eight hours.", "start": 3010.995, "duration": 1.402}, {"text": "TADGE DRYJA: Wow, cool, so eight\nhours to do the whole thing--", "start": 3012.397, "duration": 2.583}, {"text": "anyone else have tried it?", "start": 3014.98, "duration": 3.15}, {"text": "Yeah.", "start": 3018.13, "duration": 0.5}, {"text": "AUDIENCE: A while back\nit took me a week.", "start": 3018.63, "duration": 2.16}, {"text": "TADGE DRYJA: Yeah, a\nwhile back it took a week.", "start": 3020.79, "duration": 1.958}, {"text": "So the software has been\nimproved quite a bit.", "start": 3022.748, "duration": 2.522}, {"text": "So if you downloaded it--", "start": 3025.27, "duration": 2.84}, {"text": "like, I first\ndownloaded it in 2011.", "start": 3028.11, "duration": 1.89}, {"text": "And it took overnight\nto download everything.", "start": 3030.0, "duration": 2.75}, {"text": "And the download\nwas vastly smaller.", "start": 3032.75, "duration": 1.6}, {"text": "It was less than a gigabyte to\ndownload the entire blockchain.", "start": 3034.35, "duration": 2.61}, {"text": "So what's interesting\nis that the time taken", "start": 3036.96, "duration": 2.97}, {"text": "for initial block download\nover the last seven years", "start": 3039.93, "duration": 4.38}, {"text": "has been somewhat constant\nin that the blockchain gets", "start": 3044.31, "duration": 3.03}, {"text": "bigger and bigger.", "start": 3047.34, "duration": 0.75}, {"text": "But there's all\nthese optimizations", "start": 3048.09, "duration": 1.8}, {"text": "to the code and the databases.", "start": 3049.89, "duration": 2.1}, {"text": "And so that sort of keeps pace.", "start": 3051.99, "duration": 3.17}, {"text": "Although actually, I'd say\nrecently it's gotten faster,", "start": 3055.16, "duration": 2.67}, {"text": "because like 0.15--", "start": 3057.83, "duration": 1.9}, {"text": "wait, 0.11 or 0.12 had\na big speed-up as well.", "start": 3059.73, "duration": 4.1}, {"text": "AUDIENCE: They completely\nrefactored the net web code.", "start": 3063.83, "duration": 2.355}, {"text": "It used to be couples\nof the synchronization.", "start": 3066.185, "duration": 1.875}, {"text": "And then they decoupled it.", "start": 3068.06, "duration": 1.125}, {"text": "TADGE DRYJA: Yeah, I think\nthat was mostly Cory, right?", "start": 3069.185, "duration": 3.105}, {"text": "So Cory Fields, who\nalso works for the DCI,", "start": 3072.29, "duration": 2.91}, {"text": "helped to refactor the\ncode, make it a lot faster.", "start": 3075.2, "duration": 3.45}, {"text": "There's definitely still\noptimizations, a lot of cool--", "start": 3078.65, "duration": 4.44}, {"text": "a lot of it's pretty low-level\ntweaks kind of stuff.", "start": 3083.09, "duration": 3.03}, {"text": "But some of them are\npretty big things.", "start": 3086.12, "duration": 1.83}, {"text": "Most of the big things,\nlow-hanging fruit,", "start": 3087.95, "duration": 1.75}, {"text": "has already been gotten.", "start": 3089.7, "duration": 1.67}, {"text": "The worry is that long-term,\nthis just keeps going up.", "start": 3091.37, "duration": 3.84}, {"text": "As the blockchain gets\nbigger and longer,", "start": 3095.21, "duration": 2.678}, {"text": "it's going to take heart.", "start": 3097.888, "duration": 1.042}, {"text": "It's going to be\nharder to validate.", "start": 3098.93, "duration": 1.95}, {"text": "It can be parallelized\nto some extent.", "start": 3100.88, "duration": 2.34}, {"text": "But there's also network I/O\nconcerns, things like that.", "start": 3103.22, "duration": 3.54}, {"text": "So it's tricky but doable.", "start": 3106.76, "duration": 3.0}, {"text": "Any questions about\ninitial block download?", "start": 3109.76, "duration": 4.6}, {"text": "Good?", "start": 3114.36, "duration": 1.77}, {"text": "So here's a question.", "start": 3116.13, "duration": 3.0}, {"text": "You've got this UTXO DB.", "start": 3119.13, "duration": 2.22}, {"text": "What about this 170 gigabytes?", "start": 3121.35, "duration": 1.34}, {"text": "Do you have to store it?", "start": 3122.69, "duration": 1.0}, {"text": "Or can you delete it?", "start": 3123.69, "duration": 2.912}, {"text": "This you can't delete, right?", "start": 3126.602, "duration": 1.208}, {"text": "So you think this is OK?", "start": 3131.16, "duration": 2.65}, {"text": "Yeah, you can maybe\ndelete some of this.", "start": 3133.81, "duration": 1.79}, {"text": "Actually, there's\na lot of research", "start": 3135.6, "duration": 1.458}, {"text": "into maybe we can delete\nthis, accumulators, cool stuff", "start": 3137.058, "duration": 5.112}, {"text": "like that.", "start": 3142.17, "duration": 0.92}, {"text": "It would be really cool to have\nsome kind of data structure", "start": 3143.09, "duration": 2.56}, {"text": "where we can keep adding these--", "start": 3145.65, "duration": 2.31}, {"text": "we can add, remove, and\nprove, and then seek,", "start": 3147.96, "duration": 3.63}, {"text": "and see if something's\nin there, where it either", "start": 3151.59, "duration": 2.578}, {"text": "is like constant size, or login\nsize, or something like that.", "start": 3154.168, "duration": 2.542}, {"text": "That'd be really cool.", "start": 3156.71, "duration": 0.917}, {"text": "There are constructions\nlike that,", "start": 3157.627, "duration": 2.513}, {"text": "but they don't work for what\nwe're trying to do right now.", "start": 3160.14, "duration": 2.803}, {"text": "But there's a lot of\nresearch into that.", "start": 3162.943, "duration": 1.667}, {"text": "If anyone here finds\nsome cool data structure", "start": 3164.61, "duration": 2.46}, {"text": "that you can use for the UTXO\nDB that doesn't keep growing", "start": 3167.07, "duration": 4.22}, {"text": "linear at size of the number\nof keys, everyone in Bitcoin", "start": 3171.29, "duration": 3.46}, {"text": "will sing your praises forever.", "start": 3174.75, "duration": 3.99}, {"text": "But it's an active\nresearch area.", "start": 3178.74, "duration": 2.04}, {"text": "So pruning-- by default-- oh,\nthat should be a K, not an M,", "start": 3180.78, "duration": 5.43}, {"text": "sorry.", "start": 3186.21, "duration": 0.58}, {"text": "There's only 500K\nblocks, not 500M.", "start": 3186.79, "duration": 2.97}, {"text": "Anyway, by default, your client\nwill download all these blocks", "start": 3189.76, "duration": 4.16}, {"text": "and store them on the disk.", "start": 3193.92, "duration": 1.8}, {"text": "And that's important\nbecause what if someone", "start": 3195.72, "duration": 2.88}, {"text": "else requests them from you?", "start": 3198.6, "duration": 3.42}, {"text": "Everyone starts out as a noob.", "start": 3202.02, "duration": 1.62}, {"text": "Someone else comes\nand says, hey, guys,", "start": 3203.64, "duration": 1.86}, {"text": "I just downloaded Bitcoin.", "start": 3205.5, "duration": 2.25}, {"text": "What's going on for\nthe last nine years?", "start": 3207.75, "duration": 2.41}, {"text": "And you might want\nto give them blocks", "start": 3210.16, "duration": 1.7}, {"text": "to let them into the system.", "start": 3211.86, "duration": 3.35}, {"text": "So you can serve to\nothers who are doing IBD.", "start": 3215.21, "duration": 2.29}, {"text": "However, if you want, and\nyour hard drive's small,", "start": 3217.5, "duration": 2.48}, {"text": "or you have an SSD\nor something, you", "start": 3219.98, "duration": 1.63}, {"text": "can prune and delete the\nblocks after you've done IBD,", "start": 3221.61, "duration": 3.93}, {"text": "with no loss of security.", "start": 3225.54, "duration": 3.57}, {"text": "Anyone think of\ndownsides doing so?", "start": 3229.11, "duration": 3.0}, {"text": "Not really, right?", "start": 3238.14, "duration": 1.65}, {"text": "The only real downside\nis sort of this.", "start": 3239.79, "duration": 3.28}, {"text": "Well, not everyone can prune.", "start": 3243.07, "duration": 1.61}, {"text": "If everyone prunes, no new\nentrants to the system.", "start": 3244.68, "duration": 4.448}, {"text": "So it's a little\nbit of a tricky sort", "start": 3249.128, "duration": 1.542}, {"text": "of seed versus leech\nkind of problem,", "start": 3250.67, "duration": 3.21}, {"text": "where someone's got to be\nthere to serve up these blocks.", "start": 3253.88, "duration": 3.442}, {"text": "You don't have to trust them.", "start": 3257.322, "duration": 1.208}, {"text": "You're still validating\nall the work,", "start": 3258.53, "duration": 1.95}, {"text": "validating all the signatures.", "start": 3260.48, "duration": 1.59}, {"text": "They can't do anything bad.", "start": 3262.07, "duration": 2.37}, {"text": "But someone's got to be there\nto provide the network capacity.", "start": 3264.44, "duration": 4.057}, {"text": "And so it is tricky.", "start": 3268.497, "duration": 0.833}, {"text": "Like, most of the\nnodes on the network", "start": 3269.33, "duration": 1.68}, {"text": "are behind people's cable\nmodem firewall kind of thing.", "start": 3271.01, "duration": 3.3}, {"text": "So you can't actually\nconnect to them and download.", "start": 3274.31, "duration": 2.55}, {"text": "And if you run a node\nthat does allow people", "start": 3276.86, "duration": 2.46}, {"text": "to connect in and\nserve them blocks,", "start": 3279.32, "duration": 2.315}, {"text": "people will download\nquite a bit.", "start": 3281.635, "duration": 1.375}, {"text": "So I have one in the\noffice over there.", "start": 3283.01, "duration": 3.72}, {"text": "It ends up sending out about\nthree terabytes a month,", "start": 3286.73, "duration": 4.87}, {"text": "which is a lot.", "start": 3291.6, "duration": 0.84}, {"text": "Like, it's dozens of gigabytes\na day, 20, 30, I don't know.", "start": 3292.44, "duration": 5.36}, {"text": "So yeah, people are doing this.", "start": 3297.8, "duration": 1.77}, {"text": "People are connecting in and\ndownloading all the blocks,", "start": 3299.57, "duration": 2.64}, {"text": "either through IBD\nor just keeping up", "start": 3302.21, "duration": 1.86}, {"text": "with current transactions.", "start": 3304.07, "duration": 1.44}, {"text": "So yeah, pruning is possible.", "start": 3305.51, "duration": 1.95}, {"text": "But not everyone can do it, so\nit's sort of an unsolved issue", "start": 3307.46, "duration": 5.29}, {"text": "there.", "start": 3312.75, "duration": 0.5}, {"text": "There's a lot of\nresearch into how", "start": 3313.25, "duration": 1.417}, {"text": "we can do partial\npruning, where, OK, I'm", "start": 3314.667, "duration": 2.333}, {"text": "going to only store the last\nmonth's worth of blocks, which", "start": 3317.0, "duration": 3.18}, {"text": "is mostly what people do,\nbecause a lot of people", "start": 3320.18, "duration": 2.28}, {"text": "have intermittent connectivity,\nwhere they'll turn off", "start": 3322.46, "duration": 2.85}, {"text": "their node and then start it\nback up again a few days later.", "start": 3325.31, "duration": 2.91}, {"text": "And they just need to catch\nup with the last few blocks.", "start": 3328.22, "duration": 3.71}, {"text": "So pruning's cool.", "start": 3331.93, "duration": 0.75}, {"text": "That's been in since\n0.12 or something.", "start": 3332.68, "duration": 3.57}, {"text": "So I'll go through--", "start": 3336.25, "duration": 2.52}, {"text": "in practice, if you go\nto your Bitcoin node,", "start": 3338.77, "duration": 3.12}, {"text": "what does that actually store?", "start": 3341.89, "duration": 1.36}, {"text": "And if you just go to\nyour Bitcoin folder,", "start": 3343.25, "duration": 1.83}, {"text": "which in Unix-type OS's is\nlike home directory /.Bitcoin--", "start": 3345.08, "duration": 4.38}, {"text": "total random aside,\nI don't like how", "start": 3352.03, "duration": 2.46}, {"text": "they put a dot in front of all\nthe really important folders.", "start": 3354.49, "duration": 3.6}, {"text": "It's like they hide all the\nimportant things, like your GPG", "start": 3358.09, "duration": 2.76}, {"text": "folder, It's got a dot.", "start": 3360.85, "duration": 1.03}, {"text": "And your Bitcoin\nfolder's got a dot.", "start": 3361.88, "duration": 1.55}, {"text": "But like, downloads doesn't.", "start": 3363.43, "duration": 1.725}, {"text": "And like, who cares about that?", "start": 3365.155, "duration": 3.585}, {"text": "Anyway, so if you just\nls in your folder,", "start": 3368.74, "duration": 4.26}, {"text": "here's all the files.", "start": 3373.0, "duration": 1.62}, {"text": "And we'll just go\nthrough it real quick.", "start": 3374.62, "duration": 2.8}, {"text": "Here's the files,\nand I'll describe.", "start": 3377.42, "duration": 1.67}, {"text": "So there's a banlist.dat.", "start": 3379.09, "duration": 2.76}, {"text": "This is a list of IP\naddresses that you have", "start": 3381.85, "duration": 2.16}, {"text": "banned, because they're bad.", "start": 3384.01, "duration": 3.18}, {"text": "They're doing something weird.", "start": 3387.19, "duration": 1.36}, {"text": "So I'll get to it at the end.", "start": 3388.55, "duration": 1.37}, {"text": "I sort of am thinking of making\na ban list for the problem set,", "start": 3389.92, "duration": 3.72}, {"text": "because there are some nodes\nthat are doing non-good things.", "start": 3393.64, "duration": 3.27}, {"text": "That was what caused\nyesterday's outage.", "start": 3396.91, "duration": 3.48}, {"text": "Someone was connecting.", "start": 3400.39, "duration": 1.02}, {"text": "Although it was really my\nfault, because the server code", "start": 3401.41, "duration": 2.333}, {"text": "was not verifying\ninputs correctly.", "start": 3403.743, "duration": 2.287}, {"text": "But yeah, in Bitcoin,\nyou verify everything.", "start": 3406.03, "duration": 2.31}, {"text": "If people start sending you\nnonsense data, or they say,", "start": 3408.34, "duration": 2.49}, {"text": "hey, here's a block,\nand it's wrong,", "start": 3410.83, "duration": 1.59}, {"text": "or hey, here's a transaction,\nand the signatures are wrong,", "start": 3412.42, "duration": 3.51}, {"text": "you'll pretty quickly ban\nthem, because it's like, well,", "start": 3415.93, "duration": 3.67}, {"text": "if they're making a mistake--", "start": 3419.6, "duration": 1.687}, {"text": "it's computer.", "start": 3421.287, "duration": 0.583}, {"text": "There's no excuse\nfor making a mistake.", "start": 3421.87, "duration": 2.92}, {"text": "So either their software is\njust different than mine,", "start": 3424.79, "duration": 2.242}, {"text": "or something's wrong with their\nsoftware or their hardware,", "start": 3427.032, "duration": 2.458}, {"text": "I don't know.", "start": 3429.49, "duration": 0.542}, {"text": "But they're wasting my time.", "start": 3430.032, "duration": 1.738}, {"text": "They're sending\nme nonsense-- ban.", "start": 3431.77, "duration": 2.43}, {"text": "So you have your own ban list.", "start": 3434.2, "duration": 2.14}, {"text": "Then the blue ones are folders.", "start": 3436.34, "duration": 1.78}, {"text": "I'll talk about those later.", "start": 3438.12, "duration": 2.47}, {"text": "But you have peers.dat,\nwhich is good nodes.", "start": 3440.59, "duration": 2.76}, {"text": "So it's quite a\nbit, 4 megabytes.", "start": 3443.35, "duration": 2.31}, {"text": "And you keep track of here's\nall the different nodes", "start": 3445.66, "duration": 3.12}, {"text": "I've connected to for\nthe duration of however", "start": 3448.78, "duration": 3.57}, {"text": "long I've been using Bitcoin.", "start": 3452.35, "duration": 1.98}, {"text": "I keep track of all\ntheir IP addresses,", "start": 3454.33, "duration": 2.19}, {"text": "how much uptime they've had,\nwhat I've downloaded from them.", "start": 3456.52, "duration": 4.0}, {"text": "And so I sort of sort them and\nput the good ones at the top.", "start": 3460.52, "duration": 2.75}, {"text": "And like, OK, here's all\nthe different Bitcoin nodes.", "start": 3463.27, "duration": 3.06}, {"text": "So next time I start\nup Bitcoin, I'm", "start": 3466.33, "duration": 1.98}, {"text": "going to try to connect to them.", "start": 3468.31, "duration": 2.01}, {"text": "So this makes the\nnetwork very robust,", "start": 3470.32, "duration": 1.74}, {"text": "because everyone\nremembers everyone else.", "start": 3472.06, "duration": 2.46}, {"text": "And then when they need to--", "start": 3474.52, "duration": 1.2}, {"text": "if there's a network\ndisruption, maybe half the nodes", "start": 3475.72, "duration": 2.61}, {"text": "go off the network,\nyou can still", "start": 3478.33, "duration": 2.13}, {"text": "try to connect to all the rest.", "start": 3480.46, "duration": 1.98}, {"text": "And also peers will share their\npeers files, not directly,", "start": 3482.44, "duration": 4.47}, {"text": "but they'll sort of take\nrandom samplings of this file", "start": 3486.91, "duration": 2.49}, {"text": "and share it with each other,\nso that everyone sort of", "start": 3489.4, "duration": 2.25}, {"text": "knows about everyone else.", "start": 3491.65, "duration": 2.86}, {"text": "Then there's a wallet.dat,\nwhich is very important,", "start": 3494.51, "duration": 3.38}, {"text": "because that's got all\nyour precious UTXOs.", "start": 3497.89, "duration": 3.31}, {"text": "And we'll talk about\nwallets Monday, I think.", "start": 3501.2, "duration": 4.29}, {"text": "There's a bitcoin.conf,\nlittle config file.", "start": 3505.49, "duration": 2.28}, {"text": "You can set some settings\nand things like that;", "start": 3507.77, "duration": 2.865}, {"text": "a debug file, which shows\nall these weird messages;", "start": 3510.635, "duration": 3.705}, {"text": "and a mempool.dat.", "start": 3514.34, "duration": 1.41}, {"text": "So the mempool is a transaction\nyou've seen that you've not", "start": 3515.75, "duration": 4.38}, {"text": "seen in a block yet.", "start": 3520.13, "duration": 1.38}, {"text": "So people are\nbroadcasting transactions.", "start": 3521.51, "duration": 2.67}, {"text": "And you store them.", "start": 3524.18, "duration": 1.68}, {"text": "It used to be just in memory,\nhence the word \"mempool.\"", "start": 3525.86, "duration": 2.957}, {"text": "Now it's more like disk\npool, because you actually", "start": 3528.817, "duration": 2.083}, {"text": "store them on disk, because it\nsaves a little speed when you", "start": 3530.9, "duration": 3.27}, {"text": "shut down and start up again.", "start": 3534.17, "duration": 1.68}, {"text": "So any questions about just\nwhat all these files are doing?", "start": 3535.85, "duration": 3.27}, {"text": "Makes sense, so now the folders.", "start": 3542.467, "duration": 1.333}, {"text": "Chainstate blocks\nand database-- so any", "start": 3546.57, "duration": 2.28}, {"text": "guesses onto how\nbig these things are", "start": 3548.85, "duration": 2.37}, {"text": "based on previous slides or?", "start": 3551.22, "duration": 2.78}, {"text": "So how big is\nchainstate, for example?", "start": 3554.0, "duration": 1.97}, {"text": "Yes?", "start": 3558.83, "duration": 0.5}, {"text": "AUDIENCE: 3 gigs.", "start": 3559.33, "duration": 2.59}, {"text": "TADGE DRYJA: Yeah, 3 gigs.", "start": 3561.92, "duration": 2.23}, {"text": "This is a UTXO set, 3-ish gigs.", "start": 3564.15, "duration": 2.822}, {"text": "This is all the blocks.", "start": 3566.972, "duration": 0.958}, {"text": "What?", "start": 3567.93, "duration": 0.5}, {"text": "Oh, no.", "start": 3568.43, "duration": 0.958}, {"text": "And then database,\nactually, I have no idea.", "start": 3572.547, "duration": 1.833}, {"text": "Does anyone know what that is?", "start": 3574.38, "duration": 1.33}, {"text": "There's a database folder, and\nit's got one little log file.", "start": 3575.71, "duration": 3.14}, {"text": "And it's like 80 kilobytes.", "start": 3578.85, "duration": 1.56}, {"text": "I don't know what it is.", "start": 3580.41, "duration": 1.76}, {"text": "Do you guys know?", "start": 3582.17, "duration": 1.38}, {"text": "Yeah, I don't know.", "start": 3583.55, "duration": 2.08}, {"text": "But there's a blocks folder,\nand that's got all the blocks.", "start": 3585.63, "duration": 2.71}, {"text": "And that's your\nhuge amount of data.", "start": 3588.34, "duration": 4.1}, {"text": "And this is the UTXO\nset, not too bad.", "start": 3592.44, "duration": 2.83}, {"text": "So yeah, you can look in it.", "start": 3595.27, "duration": 2.02}, {"text": "It's reasonable but\nyeah, it's kind of big.", "start": 3597.29, "duration": 3.537}, {"text": "So any questions\nabout the data stuff?", "start": 3600.827, "duration": 1.583}, {"text": "I'm going to go into\nblockchain as a database,", "start": 3602.41, "duration": 2.25}, {"text": "real quick at the end.", "start": 3604.66, "duration": 2.13}, {"text": "So it's 186 gigabytes,\nor alternatively, you", "start": 3606.79, "duration": 3.69}, {"text": "can think of it as\njust 3 gigabytes.", "start": 3610.48, "duration": 1.83}, {"text": "But it's a really\ncrummy database.", "start": 3612.31, "duration": 1.707}, {"text": "So I've heard a\nlot that blockchain", "start": 3614.017, "duration": 1.458}, {"text": "is going to change the world.", "start": 3615.475, "duration": 1.275}, {"text": "And it's like a database\nthat's shared among everyone.", "start": 3616.75, "duration": 2.34}, {"text": "And you can query things.", "start": 3619.09, "duration": 1.975}, {"text": "It's a really bad database.", "start": 3621.065, "duration": 1.125}, {"text": "So for example,\nI'm going to have", "start": 3622.19, "duration": 2.96}, {"text": "some fun interactive\nquestions, where some of these", "start": 3625.15, "duration": 5.67}, {"text": "are answerable.", "start": 3630.82, "duration": 0.87}, {"text": "Some of these are not.", "start": 3631.69, "duration": 2.25}, {"text": "And I'm posing the question\nto my Bitcoin node.", "start": 3633.94, "duration": 3.567}, {"text": "So I posed this question\nto my Bitcoin node.", "start": 3637.507, "duration": 1.833}, {"text": "Hey, remember transaction\n9e95c3 dot, dot, dot,", "start": 3639.34, "duration": 3.63}, {"text": "from back in 2014?", "start": 3642.97, "duration": 1.89}, {"text": "And how do you think the\nBitcoin node will answer?", "start": 3644.86, "duration": 3.31}, {"text": "Will it answer, or\nwill it not be able to?", "start": 3648.17, "duration": 3.47}, {"text": "Any ideas?", "start": 3651.64, "duration": 0.64}, {"text": "Yeah.", "start": 3652.28, "duration": 0.5}, {"text": "AUDIENCE: Wait, where does\none be easiest [INAUDIBLE]??", "start": 3652.78, "duration": 2.415}, {"text": "TADGE DRYJA: 183 plus 3,\nso the total data usage", "start": 3658.1, "duration": 4.02}, {"text": "on this computer is 186 gigs.", "start": 3662.12, "duration": 3.176}, {"text": "The rest are kind of small.", "start": 3665.296, "duration": 3.776}, {"text": "AUDIENCE: What do you mean?", "start": 3669.072, "duration": 1.586}, {"text": "TADGE DRYJA: So I mean like,\nwhen you're using Bitcoin,", "start": 3670.658, "duration": 2.292}, {"text": "you've got 186 gigs\non your hard drive", "start": 3672.95, "duration": 2.73}, {"text": "or your SSD devoted to Bitcoin.", "start": 3675.68, "duration": 4.2}, {"text": "So you've got this 186-gigabyte\ndatabase, essentially.", "start": 3679.88, "duration": 4.02}, {"text": "But it's a really\ncrummy database.", "start": 3683.9, "duration": 2.43}, {"text": "And it can't do a lot of the\nthings you might expect it to.", "start": 3686.33, "duration": 3.34}, {"text": "So for example, this--", "start": 3689.67, "duration": 1.97}, {"text": "arbitrary transaction\nfrom the past-- you say,", "start": 3691.64, "duration": 1.98}, {"text": "hey, there was this transaction\na couple of years ago.", "start": 3693.62, "duration": 3.3}, {"text": "Give me the\ninformation about it.", "start": 3696.92, "duration": 1.86}, {"text": "And what do you think the\nresponse from the full node is?", "start": 3698.78, "duration": 2.395}, {"text": "AUDIENCE: It's valid.", "start": 3701.175, "duration": 0.875}, {"text": "TADGE DRYJA: What, sorry?", "start": 3702.05, "duration": 0.607}, {"text": "AUDIENCE: It's\nvalid or not valid.", "start": 3702.657, "duration": 1.193}, {"text": "TADGE DRYJA: It's\nvalid or not valid.", "start": 3703.85, "duration": 1.08}, {"text": "Any other ideas?", "start": 3704.93, "duration": 0.667}, {"text": "AUDIENCE: What's the header?", "start": 3705.597, "duration": 1.553}, {"text": "TADGE DRYJA: What, sorry?", "start": 3707.15, "duration": 0.585}, {"text": "AUDIENCE: What's the\nheader of [INAUDIBLE]??", "start": 3707.735, "duration": 1.185}, {"text": "TADGE DRYJA: It asks\ninstead for a header.", "start": 3708.92, "duration": 2.09}, {"text": "Any other ideas?", "start": 3711.01, "duration": 0.75}, {"text": "Yeah, so sort of that--\nit'll say, remember TX disk?", "start": 3711.76, "duration": 4.14}, {"text": "No, it's somewhere\nin the blocks maybe,", "start": 3715.9, "duration": 2.19}, {"text": "but I have no idea where.", "start": 3718.09, "duration": 1.41}, {"text": "It's not in the chainstate.", "start": 3719.5, "duration": 2.03}, {"text": "So it just stores the blocks.", "start": 3721.53, "duration": 2.49}, {"text": "Like, here's this block.", "start": 3724.02, "duration": 2.44}, {"text": "Here's that block, in line.", "start": 3726.46, "duration": 1.71}, {"text": "And if you say, hey,\nthere's this transaction.", "start": 3728.17, "duration": 2.66}, {"text": "OK, go look for it.", "start": 3730.83, "duration": 1.57}, {"text": "Oh, 2014, well, that might\nbe somewhere in the middle.", "start": 3732.4, "duration": 4.91}, {"text": "But yeah, if you don't know\nwhat block it's in, forget it.", "start": 3737.31, "duration": 3.352}, {"text": "So it does have an\nindex of blocks.", "start": 3740.662, "duration": 1.458}, {"text": "It'll tell you a block,\nbut transaction, no luck.", "start": 3742.12, "duration": 2.33}, {"text": "Yeah.", "start": 3744.45, "duration": 0.5}, {"text": "AUDIENCE: So it pretty much\ntells you if it exists,", "start": 3744.95, "duration": 1.894}, {"text": "and that's it.", "start": 3746.844, "duration": 0.636}, {"text": "TADGE DRYJA: It won't even\ntell you if this exists.", "start": 3747.48, "duration": 1.99}, {"text": "It has no idea.", "start": 3749.47, "duration": 0.625}, {"text": "AUDIENCE: What's the\n[INAUDIBLE] in the block though?", "start": 3750.095, "duration": 2.635}, {"text": "TADGE DRYJA: I might\nhave made that up.", "start": 3752.73, "duration": 2.377}, {"text": "So if you're saying, hey,\nhere's this transaction.", "start": 3755.107, "duration": 2.083}, {"text": "Do you remember it?", "start": 3757.19, "duration": 0.58}, {"text": "Does it exist?", "start": 3757.77, "duration": 0.7}, {"text": "I don't know.", "start": 3758.47, "duration": 1.14}, {"text": "Yeah.", "start": 3759.61, "duration": 0.5}, {"text": "AUDIENCE: If you ask-- if you\nquery about a certain block,", "start": 3760.11, "duration": 2.938}, {"text": "will it be able to?", "start": 3763.048, "duration": 0.792}, {"text": "TADGE DRYJA: Yes, and I'll--", "start": 3763.84, "duration": 1.557}, {"text": "yeah, good question.", "start": 3765.397, "duration": 0.833}, {"text": "But I'll get to that.", "start": 3766.23, "duration": 1.08}, {"text": "I think it's in\nthe later slides.", "start": 3767.31, "duration": 1.45}, {"text": "But yes, if you create\nyour base on a block hash,", "start": 3768.76, "duration": 4.13}, {"text": "then it does have\nthat in the database.", "start": 3772.89, "duration": 1.99}, {"text": "And it'll be able\nto get it for you.", "start": 3774.88, "duration": 1.5}, {"text": "Yeah, James.", "start": 3776.38, "duration": 0.67}, {"text": "AUDIENCE: I know what the\ndatabase directory does.", "start": 3777.05, "duration": 2.09}, {"text": "TADGE DRYJA: You know what\nthe database directory does.", "start": 3779.14, "duration": 1.6}, {"text": "AUDIENCE: Yeah,\nit's the journaling", "start": 3780.74, "duration": 1.5}, {"text": "for the other databases.", "start": 3782.24, "duration": 1.375}, {"text": "TADGE DRYJA: Journaling\nfor other databases--", "start": 3783.615, "duration": 1.875}, {"text": "OK, I didn't-- yeah, cool.", "start": 3785.49, "duration": 1.65}, {"text": "It's very small, so I\nguess it helps things work.", "start": 3787.14, "duration": 3.65}, {"text": "So this one-- do you\nknow this transaction?", "start": 3790.79, "duration": 3.03}, {"text": "No.", "start": 3793.82, "duration": 0.81}, {"text": "How about this?", "start": 3794.63, "duration": 1.95}, {"text": "Well, I've got this output.", "start": 3796.58, "duration": 3.06}, {"text": "It's still there in the UTX--\nlike, someone spent here.", "start": 3799.64, "duration": 4.59}, {"text": "It's like, this a\ntransaction in the first one.", "start": 3804.23, "duration": 2.34}, {"text": "It's an op_return output.", "start": 3806.57, "duration": 1.35}, {"text": "So it's got some extra data.", "start": 3807.92, "duration": 1.44}, {"text": "But op_return\nmeans it's invalid.", "start": 3809.36, "duration": 1.86}, {"text": "It can't spend it.", "start": 3811.22, "duration": 0.93}, {"text": "Can you tell me\nwhat the data is?", "start": 3812.15, "duration": 2.052}, {"text": "Do you think it'll be able to?", "start": 3814.202, "duration": 2.438}, {"text": "If you query, hey,\nhere's this output,", "start": 3816.64, "duration": 3.66}, {"text": "what do you think\nthe response will be?", "start": 3820.3, "duration": 3.04}, {"text": "Yea, nay?", "start": 3823.34, "duration": 2.031}, {"text": "Nay, OK, I'm seeing nays.", "start": 3825.371, "duration": 1.359}, {"text": "Yeah.", "start": 3826.73, "duration": 0.81}, {"text": "Nope.", "start": 3827.54, "duration": 0.545}, {"text": "If it's an op_return output,\neven though it's unspent,", "start": 3828.085, "duration": 2.545}, {"text": "well, it's unspendable.", "start": 3830.63, "duration": 1.65}, {"text": "So you don't put it\nin the UTXO database,", "start": 3832.28, "duration": 2.94}, {"text": "because you just see, oh, this\noutput, op_return is in there.", "start": 3835.22, "duration": 3.495}, {"text": "Don't bother putting it in.", "start": 3838.715, "duration": 1.125}, {"text": "No one will ever be\nable to spend it.", "start": 3839.84, "duration": 2.08}, {"text": "So there's no\nreason to put it in.", "start": 3841.92, "duration": 1.76}, {"text": "So op_returns are\nused to sort of commit", "start": 3843.68, "duration": 2.1}, {"text": "to data and all these\ndifferent protocols.", "start": 3845.78, "duration": 2.19}, {"text": "But the actual normal\ncode won't store them.", "start": 3847.97, "duration": 5.817}, {"text": "Anything else?", "start": 3853.787, "duration": 0.583}, {"text": "Next one, this one--", "start": 3854.37, "duration": 3.0}, {"text": "hey, I have a public key.", "start": 3857.37, "duration": 2.438}, {"text": "And here's the hash\nof my public key.", "start": 3859.808, "duration": 1.542}, {"text": "This is essentially an address.", "start": 3861.35, "duration": 1.292}, {"text": "So we didn't talk\nabout addresses.", "start": 3862.642, "duration": 1.523}, {"text": "But the Bitcoin addresses\nthat start with like a 1,", "start": 3864.165, "duration": 2.335}, {"text": "and then have these\nalphanumeric stuff--", "start": 3866.5, "duration": 3.2}, {"text": "it's just a different\nencoding, slightly shorter", "start": 3869.7, "duration": 2.01}, {"text": "than hexadecimal,\nfor a pubkey hash.", "start": 3871.71, "duration": 2.52}, {"text": "So you say, hey, I've got this.", "start": 3874.23, "duration": 2.07}, {"text": "I have a private key.", "start": 3876.3, "duration": 0.99}, {"text": "I just computed the public key.", "start": 3877.29, "duration": 1.36}, {"text": "I hashed it.", "start": 3878.65, "duration": 0.78}, {"text": "I got this.", "start": 3879.43, "duration": 1.53}, {"text": "Do I have any money?", "start": 3880.96, "duration": 1.23}, {"text": "I think I did.", "start": 3882.19, "duration": 1.06}, {"text": "I don't remember.", "start": 3883.25, "duration": 0.77}, {"text": "But I remember my private key.", "start": 3884.02, "duration": 1.08}, {"text": "I backed that up.", "start": 3885.1, "duration": 0.708}, {"text": "That was the important part.", "start": 3885.808, "duration": 1.722}, {"text": "Everyone says keep\nyour private keys.", "start": 3887.53, "duration": 1.92}, {"text": "So I have my private key.", "start": 3889.45, "duration": 1.74}, {"text": "But all this data and\nall this blockchain", "start": 3891.19, "duration": 2.85}, {"text": "stuff, I lost my computer.", "start": 3894.04, "duration": 1.317}, {"text": "But I have my private,\nso I've got my money.", "start": 3895.357, "duration": 1.833}, {"text": "How many coins do I have?", "start": 3897.19, "duration": 1.17}, {"text": "How many outputs?", "start": 3898.36, "duration": 2.22}, {"text": "What do you think the\nfull node will tell you?", "start": 3900.58, "duration": 4.73}, {"text": "Yeah, any ideas?", "start": 3905.31, "duration": 2.82}, {"text": "It'll say, I don't know.", "start": 3908.13, "duration": 1.638}, {"text": "Well, you're going to have\nto search through everything", "start": 3909.768, "duration": 2.292}, {"text": "in chainstate.", "start": 3912.06, "duration": 1.98}, {"text": "And it doesn't index based on\nthe public key script, only", "start": 3914.04, "duration": 3.0}, {"text": "the transaction ID index there.", "start": 3917.04, "duration": 1.98}, {"text": "It's a key-value store, and the\nkey is this 36-byte txid:index.", "start": 3919.02, "duration": 5.49}, {"text": "So this is a very real problem.", "start": 3924.51, "duration": 2.1}, {"text": "Like, OK, I backed up my key.", "start": 3926.61, "duration": 1.65}, {"text": "Or I took my private keys\nto some other computer", "start": 3928.26, "duration": 2.37}, {"text": "or something like that.", "start": 3930.63, "duration": 2.23}, {"text": "And this is fairly--", "start": 3932.86, "duration": 0.928}, {"text": "it's gotten a lot faster.", "start": 3933.788, "duration": 1.042}, {"text": "It used to take hours,\nwhere you had a hard drive,", "start": 3934.83, "duration": 3.15}, {"text": "and you're like, OK, import\na key to this wallet.", "start": 3937.98, "duration": 3.12}, {"text": "And it's like, well, when\ndid you do transactions?", "start": 3941.1, "duration": 2.33}, {"text": "It has to look through the\nentire blockchain, [INAUDIBLE]", "start": 3943.43, "duration": 2.63}, {"text": "and linearly, to see if\nany of these transactions", "start": 3946.06, "duration": 3.05}, {"text": "have an output that matches\nthat, and then says,", "start": 3949.11, "duration": 2.74}, {"text": "oh, yeah, you got\nmoney back in 2013.", "start": 3951.85, "duration": 1.7}, {"text": "Oh, then you spent it--", "start": 3953.55, "duration": 2.3}, {"text": "and sort of replays\nthings, because it", "start": 3955.85, "duration": 2.61}, {"text": "doesn't have an address index.", "start": 3958.46, "duration": 1.25}, {"text": "Next one-- this is an example.", "start": 3962.53, "duration": 2.41}, {"text": "How many coins-- so you say,\nhey, here's this output,", "start": 3964.94, "duration": 3.41}, {"text": "this transaction:1, how\nmany coins does it have?", "start": 3968.35, "duration": 3.51}, {"text": "Will the full node be\nable to tell you this?", "start": 3971.86, "duration": 3.11}, {"text": "Yea, nay?", "start": 3974.97, "duration": 2.57}, {"text": "I'm seeing a bunch of nays.", "start": 3977.54, "duration": 2.3}, {"text": "No, it will.", "start": 3979.84, "duration": 1.07}, {"text": "Yeah, this is the\none thing it can do.", "start": 3980.91, "duration": 3.7}, {"text": "So if you say, hey, 7434,\ndot, dot, dot, colon 1,", "start": 3984.61, "duration": 3.803}, {"text": "it'll know that.", "start": 3988.413, "duration": 0.667}, {"text": "That's in the UTXO DB,\nbecause that's the key", "start": 3989.08, "duration": 3.15}, {"text": "that the UTXO DB sorts by.", "start": 3992.23, "duration": 2.17}, {"text": "So yep, this is a UTXO.", "start": 3994.4, "duration": 2.6}, {"text": "It's unspent.", "start": 3997.0, "duration": 0.72}, {"text": "And it has a bunch of coins.", "start": 3997.72, "duration": 2.457}, {"text": "And this is fairly recent.", "start": 4000.177, "duration": 1.083}, {"text": "I was just looking through.", "start": 4001.26, "duration": 1.125}, {"text": "Someone got a couple\nmillion bucks worth, cool.", "start": 4002.385, "duration": 2.775}, {"text": "Is that a million?", "start": 4005.16, "duration": 0.888}, {"text": "Man.", "start": 4006.048, "duration": 2.922}, {"text": "Yeah, it's a new UTXO\nset, hasn't been spent,", "start": 4008.97, "duration": 2.43}, {"text": "and you can sort quickly\nbased on txid:index pair.", "start": 4011.4, "duration": 3.81}, {"text": "So I think this is in\nsome software called", "start": 4015.21, "duration": 2.97}, {"text": "an outpoint, where it's\nlike, you concatenate them.", "start": 4018.18, "duration": 2.61}, {"text": "And it ends up being 36 bytes.", "start": 4020.79, "duration": 2.52}, {"text": "This is 32 bytes.", "start": 4023.31, "duration": 0.81}, {"text": "This is 4.", "start": 4024.12, "duration": 0.795}, {"text": "So you sort of have\na 36-byte outpoint,", "start": 4024.915, "duration": 2.145}, {"text": "which describes what goes\ninto the UTXO database.", "start": 4027.06, "duration": 3.14}, {"text": "AUDIENCE: But once\nit gets respent,", "start": 4030.2, "duration": 1.776}, {"text": "it's hard to find it again.", "start": 4031.976, "duration": 1.374}, {"text": "TADGE DRYJA: Yeah,\nonce this is spent,", "start": 4033.35, "duration": 1.98}, {"text": "you delete it from the UTXO, and\nyou won't remember it anymore.", "start": 4035.33, "duration": 3.328}, {"text": "It'll just be, hey, you, how\nmany coins does this have?", "start": 4038.658, "duration": 2.292}, {"text": "You're like, well-- well,\nyou can still answer it.", "start": 4040.95, "duration": 2.28}, {"text": "You say \"none.\"", "start": 4043.23, "duration": 1.91}, {"text": "If it's spent, and you say, how\nmany coins does this guy have?", "start": 4045.14, "duration": 3.34}, {"text": "None.", "start": 4048.48, "duration": 0.5}, {"text": "It's not in the UTXO set.", "start": 4048.98, "duration": 1.042}, {"text": "Yeah, so the previous one--", "start": 4052.695, "duration": 1.125}, {"text": "I just copied these randomly.", "start": 4053.82, "duration": 1.208}, {"text": "So any questions about what is\nstored and what is not stored?", "start": 4058.01, "duration": 3.78}, {"text": "Basically, keeps\ntrack of UTXOs, and it", "start": 4064.41, "duration": 2.81}, {"text": "keeps track of historic\nblocks in order", "start": 4067.22, "duration": 1.75}, {"text": "to give them to people.", "start": 4068.97, "duration": 1.028}, {"text": "And it keeps after the headers.", "start": 4069.998, "duration": 1.292}, {"text": "The headers ends up being small.", "start": 4071.29, "duration": 1.43}, {"text": "All the headers\ntotal is like, what?", "start": 4072.72, "duration": 1.55}, {"text": "40 megs, something like that.", "start": 4074.27, "duration": 3.03}, {"text": "So yeah, you can\nadd further indices.", "start": 4077.3, "duration": 3.17}, {"text": "You could write software to\nanswer all these questions", "start": 4080.47, "duration": 2.84}, {"text": "very quickly.", "start": 4083.31, "duration": 2.1}, {"text": "But that's not what\nBitcoin does by default.", "start": 4085.41, "duration": 3.09}, {"text": "Those types of indices would\ntake a lot of extra space", "start": 4088.5, "duration": 3.72}, {"text": "and add a lot of CPU\nor things like that.", "start": 4092.22, "duration": 3.22}, {"text": "So a very common thing\nis an address index,", "start": 4095.44, "duration": 3.08}, {"text": "so people can ask if\nthey have any money.", "start": 4098.52, "duration": 1.77}, {"text": "So the second to last\none, where you say,", "start": 4100.29, "duration": 2.29}, {"text": "hey, I have this key hash.", "start": 4102.58, "duration": 2.787}, {"text": "Do I have any money?", "start": 4105.367, "duration": 0.833}, {"text": "Do I have any transactions?", "start": 4106.2, "duration": 1.65}, {"text": "Having an address\nindex is actually", "start": 4107.85, "duration": 2.129}, {"text": "pretty useful for\na lot of things,", "start": 4109.979, "duration": 2.261}, {"text": "for example, importing keys or\nlike web wallet kind of things.", "start": 4112.24, "duration": 4.84}, {"text": "But Bitcoin by default doesn't\ndo it, because, well, why?", "start": 4117.08, "duration": 5.518}, {"text": "You can make arguments that\nit would be actually useful", "start": 4122.598, "duration": 2.292}, {"text": "to have in the normal\ncode, but we don't.", "start": 4124.89, "duration": 4.219}, {"text": "Any other questions about\nwhat indices, what it can do,", "start": 4129.109, "duration": 3.591}, {"text": "what it cannot do?", "start": 4132.7, "duration": 1.93}, {"text": "Somewhat counterintuitive in\nmany cases, where you say, hey,", "start": 4134.63, "duration": 2.87}, {"text": "here's this transaction.", "start": 4137.5, "duration": 1.0}, {"text": "And you can't actually find it.", "start": 4138.5, "duration": 2.68}, {"text": "Or you have to scan through 180\ngigabytes in order to find it.", "start": 4141.18, "duration": 4.58}, {"text": "So wait, James, I\nhave a question.", "start": 4145.76, "duration": 1.53}, {"text": "So how big is an address index\nfor what you were working on?", "start": 4147.29, "duration": 4.7}, {"text": "AUDIENCE: Usually, equal to\nthe size of the chain inside.", "start": 4151.99, "duration": 2.81}, {"text": "TADGE DRYJA: Wow, so it\ncould be hundreds of gigs.", "start": 4154.8, "duration": 2.44}, {"text": "Yeah.", "start": 4157.24, "duration": 0.514}, {"text": "AUDIENCE: It only takes what?", "start": 4157.754, "duration": 1.208}, {"text": "At least for Bitcoin, it\ntakes usually multiple weeks", "start": 4158.962, "duration": 2.598}, {"text": "to generate.", "start": 4161.56, "duration": 0.698}, {"text": "TADGE DRYJA: Weeks to generate?", "start": 4162.258, "duration": 1.292}, {"text": "I bet you, well--", "start": 4163.55, "duration": 0.772}, {"text": "AUDIENCE: Although [INAUDIBLE]\nusually takes a few days", "start": 4164.322, "duration": 2.292}, {"text": "on the inside, which is\nwhat [INAUDIBLE] takes--", "start": 4166.614, "duration": 3.016}, {"text": "weeks.", "start": 4169.63, "duration": 0.87}, {"text": "TADGE DRYJA: Well,\nthat's inside.", "start": 4170.5, "duration": 1.62}, {"text": "So the other thing is, these\nare like fairly involved sort", "start": 4172.12, "duration": 5.13}, {"text": "of CSE software\nengineering problems.", "start": 4177.25, "duration": 2.1}, {"text": "And optimization really works.", "start": 4179.35, "duration": 2.16}, {"text": "If you download like Bitcoin\n0.9, it'll still work.", "start": 4181.51, "duration": 4.83}, {"text": "But you're never\ngoing to catch up.", "start": 4186.34, "duration": 1.889}, {"text": "Maybe not never, I don't know.", "start": 4188.229, "duration": 1.5}, {"text": "If you have a fast computer, but\nit'll take months and months.", "start": 4189.729, "duration": 3.21}, {"text": "And as people have been\nupdating the software", "start": 4192.939, "duration": 2.071}, {"text": "and making it faster,\nmaking it more efficient,", "start": 4195.01, "duration": 2.22}, {"text": "now it's quite fast.", "start": 4197.23, "duration": 1.08}, {"text": "And you can sync the\nwhole thing in a few hours", "start": 4198.31, "duration": 3.48}, {"text": "on a good computer.", "start": 4201.79, "duration": 2.02}, {"text": "So address index is one\nof those things where", "start": 4203.81, "duration": 1.97}, {"text": "it hasn't had like the full\nforce of all these Bitcoin", "start": 4205.78, "duration": 3.15}, {"text": "protocol coder people on it,\nbecause it's sort of seen", "start": 4208.93, "duration": 3.158}, {"text": "as like, well, yeah that's kind\nof a fun feature if you want.", "start": 4212.088, "duration": 2.542}, {"text": "But it's not like a\ncore utility of Bitcoin.", "start": 4214.63, "duration": 4.27}, {"text": "So yeah, it is a database,\nmaybe not the best way", "start": 4218.9, "duration": 4.14}, {"text": "to think of it though.", "start": 4223.04, "duration": 1.8}, {"text": "Don't think of the blockchain as\nlike a global shared database,", "start": 4224.84, "duration": 2.64}, {"text": "because it sort of is.", "start": 4227.48, "duration": 0.99}, {"text": "But it's a fairly\nspecific database", "start": 4228.47, "duration": 2.1}, {"text": "that isn't useful for\nmany other things.", "start": 4230.57, "duration": 3.9}, {"text": "Yeah, and it's also untrusted.", "start": 4234.47, "duration": 1.63}, {"text": "Another part of why\nis it's untrusted.", "start": 4236.1, "duration": 3.15}, {"text": "Most of these things\nexist so that they", "start": 4239.25, "duration": 2.31}, {"text": "can be used over the\npeer-to-peer peer network.", "start": 4241.56, "duration": 2.01}, {"text": "If you request a block,\nI'll give it to you.", "start": 4243.57, "duration": 2.04}, {"text": "If you give me a\ntransaction, I'll", "start": 4245.61, "duration": 1.53}, {"text": "match it against my UTXO set.", "start": 4247.14, "duration": 2.438}, {"text": "But an address index\ndoesn't work that way.", "start": 4249.578, "duration": 1.792}, {"text": "It's sort of trusted.", "start": 4251.37, "duration": 0.875}, {"text": "I can easily omit things.", "start": 4252.245, "duration": 2.555}, {"text": "If you say, hey, I've got a key.", "start": 4254.8, "duration": 1.49}, {"text": "What are the transactions\ninvolved with this key?", "start": 4256.29, "duration": 2.12}, {"text": "I can omit things very\neasily, and there's", "start": 4258.41, "duration": 1.75}, {"text": "no way for you to\nprove it or verify it.", "start": 4260.16, "duration": 2.49}, {"text": "So your DB queries aren't really\ngiven out to network peers.", "start": 4262.65, "duration": 4.17}, {"text": "And network peers are scary.", "start": 4266.82, "duration": 1.21}, {"text": "And you need to ban\nthem if they act funny.", "start": 4268.03, "duration": 3.16}, {"text": "And this happens all the time.", "start": 4271.19, "duration": 1.25}, {"text": "If you look through\nBitcoin logs,", "start": 4272.44, "duration": 1.92}, {"text": "and you have a node that's\nup, every few seconds, you're", "start": 4274.36, "duration": 2.748}, {"text": "going to be disconnecting\nfrom someone or banning them,", "start": 4277.108, "duration": 2.292}, {"text": "because they're doing something\ncrazy, trying to hack into you", "start": 4279.4, "duration": 2.94}, {"text": "or whatever.", "start": 4282.34, "duration": 1.11}, {"text": "So basically, all\nyou're doing is", "start": 4283.45, "duration": 1.56}, {"text": "you're providing headers,\nblocks, transactions.", "start": 4285.01, "duration": 2.94}, {"text": "And you're sharing the\nother IPs and nodes.", "start": 4287.95, "duration": 2.45}, {"text": "You try to simplify it.", "start": 4290.4, "duration": 2.79}, {"text": "Other questions?", "start": 4293.19, "duration": 1.59}, {"text": "Yeah, bad database, good for\nconsensus, it kind of works.", "start": 4294.78, "duration": 3.75}, {"text": "Everyone's got\nthe same UTXO set,", "start": 4298.53, "duration": 2.55}, {"text": "even though they\nall really would", "start": 4301.08, "duration": 1.62}, {"text": "like to change that UTXO set.", "start": 4302.7, "duration": 1.57}, {"text": "I would much rather\neveryone had a UTXO", "start": 4304.27, "duration": 1.85}, {"text": "set where I had\nthose 27-coin UTXO.", "start": 4306.12, "duration": 4.66}, {"text": "So almost everyone\nin the systems", "start": 4310.78, "duration": 1.79}, {"text": "would rather there was\na different UTXO set.", "start": 4312.57, "duration": 2.97}, {"text": "And yet, they all managed to\nagree on a single UTXO set,", "start": 4315.54, "duration": 3.16}, {"text": "so pretty cool.", "start": 4318.7, "duration": 2.15}]