0xa80f68ca86a30a0596bfe9a7f2dd1ebf19d5b08fa3dd6d01ad4c449f3b40f863
Transaction
Balance changes
Address | Token(s) swapped | Balance | Price | Value change | |
---|---|---|---|---|---|
| ETH | +$34.63 | |||
Ether | +0.013409758 | | +$34.63 | ||
| ETH | -$387.68 | |||
Ether | -0.15011582 | | -$387.68 | ||
| +7.2000000e+25 |
Invocation flow
Full trace
- 0DEPLOYMENTGENESIS 0x60806040526004361061025f575f3560e01c80635de0f2a011610143578063a9059cbb116100b5578063c3f70b5211610079578063c3f70b52146108d6578063…
- 1SLOAD(_name[data], _name[length]) ("", 0)
- 2SHA30x00000000000000000000000000000000000000000000000000000000000000060xf652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f
- 3SSTORE_name[0] " " to "Bitcoin As A State Transition Sy"
- 4SSTORE_name[1] " " to "stem From a technical standp"
- 5SSTORE_name[2] " " to "oint, the ledger of a cryptocurr"
- 6SSTORE_name[3] " " to "ency such as Bitcoin can be thou"
- 7SSTORE_name[4] " " to "ght of as a state transition sys"
- 8SSTORE_name[5] " " to "tem, where there is a *state* co"
- 9SSTORE_name[6] " " to "nsisting of the ownership status"
- 10SSTORE_name[7] " " to " of all existing bitcoins and a "
- 11SSTORE_name[8] " " to "*state transition function* that"
- 12SSTORE_name[9] " " to " takes a state and a transaction"
- 13SSTORE_name[10] " " to " and outputs a new state which i"
- 14SSTORE_name[11] " " to "s the result. In a standard bank"
- 15SSTORE_name[12] " " to "ing system, for example, the sta"
- 16SSTORE_name[13] " " to "te is a balance sheet, a transac"
- 17SSTORE_name[14] " " to "tion is a request to move $X fro"
- 18SSTORE_name[15] " " to "m A to B, and the state transiti"
- 19SSTORE_name[16] " " to "on function reduces the value in"
- 20SSTORE_name[17] " " to " A's account by $X and increases"
- 21SSTORE_name[18] " " to " the value in B's account by $X."
- 22SSTORE_name[19] " " to " If A's account has less than $X"
- 23SSTORE_name[20] " " to " in the first place, the state t"
- 24SSTORE_name[21] " " to "ransition function returns an er"
- 25SSTORE_name[22] " " to "ror. Hence, one can formally def"
- 26SSTORE_name[23] " " to "ine: The *state* in Bitcoin is"
- 27SSTORE_name[24] " " to " the collection of all coins (te"
- 28SSTORE_name[25] " " to "chnically, *unspent transaction "
- 29SSTORE_name[26] " " to "outputs* or UTXO) that have been"
- 30SSTORE_name[27] " " to " minted and not yet spent, with "
- 31SSTORE_name[28] " " to "each UTXO having a denomination "
- 32SSTORE_name[29] " " to "and an owner (defined by a 20-by"
- 33SSTORE_name[30] " " to "te address which is essentially "
- 34SSTORE_name[31] " " to "a cryptographic public keyfn1). "
- 35SSTORE_name[32] " " to "A transaction contains one or mo"
- 36SSTORE_name[33] " " to "re inputs, with each input conta"
- 37SSTORE_name[34] " " to "ining a reference to an existing"
- 38SSTORE_name[35] " " to " UTXO and a cryptographic signat"
- 39SSTORE_name[36] " " to "ure produced by the private key "
- 40SSTORE_name[37] " " to "associated with the owner's addr"
- 41SSTORE_name[38] " " to "ess, and one or more outputs, wi"
- 42SSTORE_name[39] " " to "th each output containing a new "
- 43SSTORE_name[40] " " to "UTXO to be added to the state. T"
- 44SSTORE_name[41] " " to "he state transition function APP"
- 45SSTORE_name[42] " " to "LY(S,TX) -> S' can be defined ro"
- 46SSTORE_name[43] " " to "ughly as follows: For each input"
- 47SSTORE_name[44] " " to " in TX: If the referenced UTXO i"
- 48SSTORE_name[45] " " to "s not in S, return an error. If "
- 49SSTORE_name[46] " " to "the provided signature does not "
- 50SSTORE_name[47] " " to "match the owner of the UTXO, ret"
- 51SSTORE_name[48] " " to "urn an error. If the sum of the "
- 52SSTORE_name[49] " " to "denominations of all input UTXO "
- 53SSTORE_name[50] " " to "is less than the sum of the deno"
- 54SSTORE_name[51] " " to "minations of all output UTXO, re"
- 55SSTORE_name[52] " " to "turn an error. Return S with all"
- 56SSTORE_name[53] " " to " input UTXO removed and all outp"
- 57SSTORE_name[54] " " to "ut UTXO added The first half of "
- 58SSTORE_name[55] " " to "the first step prevents transact"
- 59SSTORE_name[56] " " to "ion senders from spending coins "
- 60SSTORE_name[57] " " to "that do not exist, the second ha"
- 61SSTORE_name[58] " " to "lf of the first step prevents tr"
- 62SSTORE_name[59] " " to "ansaction senders from spending "
- 63SSTORE_name[60] " " to "other people's coins, and the se"
- 64SSTORE_name[61] " " to "cond step enforces conservation "
- 65SSTORE_name[62] " " to "of value. In order to use this f"
- 66SSTORE_name[63] " " to "or payment, the protocol is as f"
- 67SSTORE_name[64] " " to "ollows. Suppose Alice wants to s"
- 68SSTORE_name[65] " " to "end 11.7 BTC to Bob. First, Alic"
- 69SSTORE_name[66] " " to "e will look for a set of availab"
- 70SSTORE_name[67] " " to "le UTXO that she owns that total"
- 71SSTORE_name[68] " " to "s up to at least 11.7 BTC. Reali"
- 72SSTORE_name[69] " " to "stically, Alice will not be able"
- 73SSTORE_name[70] " " to " to get exactly 11.7 BTC; say th"
- 74SSTORE_name[71] " " to "at the smallest she can get is 6"
- 75SSTORE_name[72] " " to "+4+2=12. She then creates a tran"
- 76SSTORE_name[73] " " to "saction with those three inputs "
- 77SSTORE_name[74] " " to "and two outputs. The first outpu"
- 78SSTORE_name[75] " " to "t will be 11.7 BTC with Bob's ad"
- 79SSTORE_name[76] " " to "dress as its owner, and the seco"
- 80SSTORE_name[77] " " to "nd output will be the remaining "
- 81SSTORE_name[78] " " to "0.3 BTC *change*, with the owner"
- 82SSTORE_name[79] " " to " being Alice herself. Minin"
- 83SSTORE_name[80] " " to "g If we had access to a trus"
- 84SSTORE_name[81] " " to "tworthy centralized service, thi"
- 85SSTORE_name[82] " " to "s system would be trivial to imp"
- 86SSTORE_name[83] " " to "lement; it could simply be coded"
- 87SSTORE_name[84] " " to " exactly as described, using a c"
- 88SSTORE_name[85] " " to "entralized server's hard drive t"
- 89SSTORE_name[86] " " to "o keep track of the state. Howev"
- 90SSTORE_name[87] " " to "er, with Bitcoin we are trying t"
- 91SSTORE_name[88] " " to "o build a decentralized currency"
- 92SSTORE_name[89] " " to " system, so we will need to comb"
- 93SSTORE_name[90] " " to "ine the state transaction system"
- 94SSTORE_name[91] " " to " with a consensus system in orde"
- 95SSTORE_name[92] " " to "r to ensure that everyone agrees"
- 96SSTORE_name[93] " " to " on the order of transactions. B"
- 97SSTORE_name[94] " " to "itcoin's decentralized consensus"
- 98SSTORE_name[95] " " to " process requires nodes in the n"
- 99SSTORE_name[96] " " to "etwork to continuously attempt t"
- 100SSTORE_name[97] " " to "o produce packages of transactio"
- 101SSTORE_name[98] " " to "ns called *blocks*. The network "
- 102SSTORE_name[99] " " to "is intended to produce roughly o"
- 103SSTORE_name[100] " " to "ne block every ten minutes, with"
- 104SSTORE_name[101] " " to " each block containing a timesta"
- 105SSTORE_name[102] " " to "mp, a nonce, a reference to (ie."
- 106SSTORE_name[103] " " to " hash of) the previous block and"
- 107SSTORE_name[104] " " to " a list of all of the transactio"
- 108SSTORE_name[105] " " to "ns that have taken place since t"
- 109SSTORE_name[106] " " to "he previous block. Over time, th"
- 110SSTORE_name[107] " " to "is creates a persistent, ever-gr"
- 111SSTORE_name[108] " " to "owing, *blockchain* that constan"
- 112SSTORE_name[109] " " to "tly updates to represent the lat"
- 113SSTORE_name[110] " " to "est state of the Bitcoin ledger."
- 114SSTORE_name[111] " " to " The algorithm for checking if a"
- 115SSTORE_name[112] " " to " block is valid, expressed in th"
- 116SSTORE_name[113] " " to "is paradigm, is as follows: Chec"
- 117SSTORE_name[114] " " to "k if the previous block referenc"
- 118SSTORE_name[115] " " to "ed by the block exists and is va"
- 119SSTORE_name[116] " " to "lid. Check that the timestamp of"
- 120SSTORE_name[117] " " to " the block is greater than that "
- 121SSTORE_name[118] " " to "of the previous blockfn2 and les"
- 122SSTORE_name[119] " " to "s than 2 hours into the future C"
- 123SSTORE_name[120] " " to "heck that the proof-of-work on t"
- 124SSTORE_name[121] " " to "he block is valid. Let S[0] be t"
- 125SSTORE_name[122] " " to "he state at the end of the previ"
- 126SSTORE_name[123] " " to "ous block. Suppose TX is the blo"
- 127SSTORE_name[124] " " to "ck's transaction list with n tra"
- 128SSTORE_name[125] " " to "nsactions. For all i in 0...n-1,"
- 129SSTORE_name[126] " " to " set S[i+1] = APPLY(S[i],TX[i]) "
- 130SSTORE_name[127] " " to "If any application returns an er"
- 131SSTORE_name[128] " " to "ror, exit and return false. Retu"
- 132SSTORE_name[129] " " to "rn true, and register S[n] as th"
- 133SSTORE_name[130] " " to "e state at the end of this block"
- 134SSTORE_name[131] " " to ". Essentially, each transaction "
- 135SSTORE_name[132] " " to "in the block must provide a vali"
- 136SSTORE_name[133] " " to "d state transition from what was"
- 137SSTORE_name[134] " " to " the canonical state before the "
- 138SSTORE_name[135] " " to "transaction was executed to some"
- 139SSTORE_name[136] " " to " new state. Note that the state "
- 140SSTORE_name[137] " " to "is not encoded in the block in a"
- 141SSTORE_name[138] " " to "ny way; it is purely an abstract"
- 142SSTORE_name[139] " " to "ion to be remembered by the vali"
- 143SSTORE_name[140] " " to "dating node and can only be (sec"
- 144SSTORE_name[141] " " to "urely) computed for any block by"
- 145SSTORE_name[142] " " to " starting from the genesis state"
- 146SSTORE_name[143] " " to " and sequentially applying every"
- 147SSTORE_name[144] " " to " transaction in every block. Add"
- 148SSTORE_name[145] " " to "itionally, note that the order i"
- 149SSTORE_name[146] " " to "n which the miner includes trans"
- 150SSTORE_name[147] " " to "actions into the block matters; "
- 151SSTORE_name[148] " " to "if there are two transactions A "
- 152SSTORE_name[149] " " to "and B in a block such that B spe"
- 153SSTORE_name[150] " " to "nds a UTXO created by A, then th"
- 154SSTORE_name[151] " " to "e block will be valid if A comes"
- 155SSTORE_name[152] " " to " before B but not otherwise. The"
- 156SSTORE_name[153] " " to " one validity condition present "
- 157SSTORE_name[154] " " to "in the above list that is not fo"
- 158SSTORE_name[155] " " to "und in other systems is the requ"
- 159SSTORE_name[156] " " to "irement for *proof-of-work*. The"
- 160SSTORE_name[157] " " to " precise condition is that the d"
- 161SSTORE_name[158] " " to "ouble-SHA256 hash of every block"
- 162SSTORE_name[159] " " to ", treated as a 256-bit number, m"
- 163SSTORE_name[160] " " to "ust be less than a dynamically a"
- 164SSTORE_name[161] " " to "djusted target, which as of the "
- 165SSTORE_name[162] " " to "time of this writing is approxim"
- 166SSTORE_name[163] " " to "ately 2187. The purpose of this "
- 167SSTORE_name[164] " " to "is to make block creation comput"
- 168SSTORE_name[165] " " to "ationally *hard*, thereby preven"
- 169SSTORE_name[166] " " to "ting sybil attackers from remaki"
- 170SSTORE_name[167] " " to "ng the entire blockchain in thei"
- 171SSTORE_name[168] " " to "r favor. Because SHA256 is desig"
- 172SSTORE_name[169] " " to "ned to be a completely unpredict"
- 173SSTORE_name[170] " " to "able pseudorandom function, the "
- 174SSTORE_name[171] " " to "only way to create a valid block"
- 175SSTORE_name[172] " " to " is simply trial and error, repe"
- 176SSTORE_name[173] " " to "atedly incrementing the nonce an"
- 177SSTORE_name[174] " " to "d seeing if the new hash matches"
- 178SSTORE_name[175] " " to ". At the current target of ~2187"
- 179SSTORE_name[176] " " to ", the network must make an avera"
- 180SSTORE_name[177] " " to "ge of ~269 tries before a valid "
- 181SSTORE_name[178] " " to "block is found; in general, the "
- 182SSTORE_name[179] " " to "target is recalibrated by the ne"
- 183SSTORE_name[180] " " to "twork every 2016 blocks so that "
- 184SSTORE_name[181] " " to "on average a new block is produc"
- 185SSTORE_name[182] " " to "ed by some node in the network e"
- 186SSTORE_name[183] " " to "very ten minutes. In order to co"
- 187SSTORE_name[184] " " to "mpensate miners for this computa"
- 188SSTORE_name[185] " " to "tional work, the miner of every "
- 189SSTORE_name[186] " " to "block is entitled to include a t"
- 190SSTORE_name[187] " " to "ransaction giving themselves 25 "
- 191SSTORE_name[188] " " to "BTC out of nowhere. Additionally"
- 192SSTORE_name[189] " " to ", if any transaction has a highe"
- 193SSTORE_name[190] " " to "r total denomination in its inpu"
- 194SSTORE_name[191] " " to "ts than in its outputs, the diff"
- 195SSTORE_name[192] " " to "erence also goes to the miner as"
- 196SSTORE_name[193] " " to " a *transaction fee*. Incidental"
- 197SSTORE_name[194] " " to "ly, this is also the only mechan"
- 198SSTORE_name[195] " " to "ism by which BTC are issued; the"
- 199SSTORE_name[196] " " to " genesis state contained no coin"
- 200SSTORE_name[197] " " to "s at all. In order to better und"
- 201SSTORE_name[198] " " to "erstand the purpose of mining, l"
- 202SSTORE_name[199] " " to "et us examine what happens in th"
- 203SSTORE_name[200] " " to "e event of a malicious attacker."
- 204SSTORE_name[201] " " to " Since Bitcoin's underlying cryp"
- 205SSTORE_name[202] " " to "tography is known to be secure, "
- 206SSTORE_name[203] " " to "the attacker will target the one"
- 207SSTORE_name[204] " " to " part of the Bitcoin system that"
- 208SSTORE_name[205] " " to " is not protected by cryptograph"
- 209SSTORE_name[206] " " to "y directly: the order of transac"
- 210SSTORE_name[207] " " to "tions. The attacker's strategy i"
- 211SSTORE_name[208] " " to "s simple: Send 100 BTC to a merc"
- 212SSTORE_name[209] " " to "hant in exchange for some produc"
- 213SSTORE_name[210] " " to "t (preferably a rapid-delivery d"
- 214SSTORE_name[211] " " to "igital good) ait for the deliver"
- 215SSTORE_name[212] " " to "y of the product Produce another"
- 216SSTORE_name[213] " " to " transaction sending the same 10"
- 217SSTORE_name[214] " " to "0 BTC to himself Try to convince"
- 218SSTORE_name[215] " " to " the network that his transactio"
- 219SSTORE_name[216] " " to "n to himself was the one that ca"
- 220SSTORE_name[217] " " to "me first. Once step (1) has take"
- 221SSTORE_name[218] " " to "n place, after a few minutes som"
- 222SSTORE_name[219] " " to "e miner will include the transac"
- 223SSTORE_name[220] " " to "tion in a block, say block numbe"
- 224SSTORE_name[221] " " to "r 270000. After about one hour, "
- 225SSTORE_name[222] " " to "five more blocks will have been "
- 226SSTORE_name[223] " " to "added to the chain after that bl"
- 227SSTORE_name[224] " " to "ock, with each of those blocks i"
- 228SSTORE_name[225] " " to "ndirectly pointing to the transa"
- 229SSTORE_name[226] " " to "ction and thus *confirming* it. "
- 230SSTORE_name[227] " " to "At this point, the merchant will"
- 231SSTORE_name[228] " " to " accept the payment as finalized"
- 232SSTORE_name[229] " " to " and deliver the product; since "
- 233SSTORE_name[230] " " to "we are assuming this is a digita"
- 234SSTORE_name[231] " " to "l good, delivery is instant. Now"
- 235SSTORE_name[232] " " to ", the attacker creates another t"
- 236SSTORE_name[233] " " to "ransaction sending the 100 BTC t"
- 237SSTORE_name[234] " " to "o himself. If the attacker simpl"
- 238SSTORE_name[235] " " to "y releases it into the wild, the"
- 239SSTORE_name[236] " " to " transaction will not be process"
- 240SSTORE_name[237] " " to "ed; miners will attempt to run A"
- 241SSTORE_name[238] " " to "PPLY(S,TX) and notice that TX co"
- 242SSTORE_name[239] " " to "nsumes a UTXO which is no longer"
- 243SSTORE_name[240] " " to " in the state. So instead, the a"
- 244SSTORE_name[241] " " to "ttacker creates a *fork* of the "
- 245SSTORE_name[242] " " to "blockchain, starting by mining a"
- 246SSTORE_name[243] " " to "nother version of block 270000 p"
- 247SSTORE_name[244] " " to "ointing to the same block 269999"
- 248SSTORE_name[245] " " to " as a parent but with the new tr"
- 249SSTORE_name[246] " " to "ansaction in place of the old on"
- 250SSTORE_name[247] " " to "e. Because the block data is dif"
- 251SSTORE_name[248] " " to "ferent, this requires redoing th"
- 252SSTORE_name[249] " " to "e proof-of-work. Furthermore, th"
- 253SSTORE_name[250] " " to "e attacker's new version of bloc"
- 254SSTORE_name[251] " " to "k 270000 has a different hash, s"
- 255SSTORE_name[252] " " to "o the original blocks 270001 to "
- 256SSTORE_name[253] " " to "270005 do not *point* to it; thu"
- 257SSTORE_name[254] " " to "s, the original chain and the at"
- 258SSTORE_name[255] " " to "tacker's new chain are completel"
- 259SSTORE_name[256] " " to "y separate. The rule is that in "
- 260SSTORE_name[257] " " to "a fork the longest blockchain is"
- 261SSTORE_name[258] " " to " taken to be the truth, and so l"
- 262SSTORE_name[259] " " to "egitimate miners will work on th"
- 263SSTORE_name[260] " " to "e 270005 chain while the attacke"
- 264SSTORE_name[261] " " to "r alone is working on the 270000"
- 265SSTORE_name[262] " " to " chain. In order for the attacke"
- 266SSTORE_name[263] " " to "r to make his blockchain the lon"
- 267SSTORE_name[264] " " to "gest, he would need to have more"
- 268SSTORE_name[265] " " to " computational power than the re"
- 269SSTORE_name[266] " " to "st of the network combined in or"
- 270SSTORE_name[267] " " to "der to catch up (hence, *51% att"
- 271SSTORE_name[268] " " to "ack*). "
- 272SSTORE_name[length] 0 to 6
- 273SLOAD(_symbol[data], _symbol[length]) ("", 0)
- 274SSTORE(_symbol[data], _symbol[length]) ("" to "GENESIS", 0 to 7)
- 275SLOAD(areLimitsOn, emptyContractFull) (false, false)
- 276SSTORE(areLimitsOn, emptyContractFull) (false to true, false)
- 277SLOAD(areLimitsOn, emptyContractFull) (true, false)
- 278SSTORE(areLimitsOn, emptyContractFull) (true, false)
- 279SLOAD
- 280SLOAD
- 281SHA30x00000000000000000000000000000000000000000000000000000000000000060xf652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f
- 282SLOAD_name[0] "Bitcoin As A State Transition Sy"
- 283SLOAD_name[1] "stem From a technical standp"
- 284SLOAD_name[2] "oint, the ledger of a cryptocurr"
- 285SLOAD_name[3] "ency such as Bitcoin can be thou"
- 286SLOAD_name[4] "ght of as a state transition sys"
- 287SLOAD_name[5] "tem, where there is a *state* co"
- 288SLOAD_name[6] "nsisting of the ownership status"
- 289SLOAD_name[7] " of all existing bitcoins and a "
- 290SLOAD_name[8] "*state transition function* that"
- 291SLOAD_name[9] " takes a state and a transaction"
- 292SLOAD_name[10] " and outputs a new state which i"
- 293SLOAD_name[11] "s the result. In a standard bank"
- 294SLOAD_name[12] "ing system, for example, the sta"
- 295SLOAD_name[13] "te is a balance sheet, a transac"
- 296SLOAD_name[14] "tion is a request to move $X fro"
- 297SLOAD_name[15] "m A to B, and the state transiti"
- 298SLOAD_name[16] "on function reduces the value in"
- 299SLOAD_name[17] " A's account by $X and increases"
- 300SLOAD_name[18] " the value in B's account by $X."
- 301SLOAD_name[19] " If A's account has less than $X"
- 302SLOAD_name[20] " in the first place, the state t"
- 303SLOAD_name[21] "ransition function returns an er"
- 304SLOAD_name[22] "ror. Hence, one can formally def"
- 305SLOAD_name[23] "ine: The *state* in Bitcoin is"
- 306SLOAD_name[24] " the collection of all coins (te"
- 307SLOAD_name[25] "chnically, *unspent transaction "
- 308SLOAD_name[26] "outputs* or UTXO) that have been"
- 309SLOAD_name[27] " minted and not yet spent, with "
- 310SLOAD_name[28] "each UTXO having a denomination "
- 311SLOAD_name[29] "and an owner (defined by a 20-by"
- 312SLOAD_name[30] "te address which is essentially "
- 313SLOAD_name[31] "a cryptographic public keyfn1). "
- 314SLOAD_name[32] "A transaction contains one or mo"
- 315SLOAD_name[33] "re inputs, with each input conta"
- 316SLOAD_name[34] "ining a reference to an existing"
- 317SLOAD_name[35] " UTXO and a cryptographic signat"
- 318SLOAD_name[36] "ure produced by the private key "
- 319SLOAD_name[37] "associated with the owner's addr"
- 320SLOAD_name[38] "ess, and one or more outputs, wi"
- 321SLOAD_name[39] "th each output containing a new "
- 322SLOAD_name[40] "UTXO to be added to the state. T"
- 323SLOAD_name[41] "he state transition function APP"
- 324SLOAD_name[42] "LY(S,TX) -> S' can be defined ro"
- 325SLOAD_name[43] "ughly as follows: For each input"
- 326SLOAD_name[44] " in TX: If the referenced UTXO i"
- 327SLOAD_name[45] "s not in S, return an error. If "
- 328SLOAD_name[46] "the provided signature does not "
- 329SLOAD_name[47] "match the owner of the UTXO, ret"
- 330SLOAD_name[48] "urn an error. If the sum of the "
- 331SLOAD_name[49] "denominations of all input UTXO "
- 332SLOAD_name[50] "is less than the sum of the deno"
- 333SLOAD_name[51] "minations of all output UTXO, re"
- 334SLOAD_name[52] "turn an error. Return S with all"
- 335SLOAD_name[53] " input UTXO removed and all outp"
- 336SLOAD_name[54] "ut UTXO added The first half of "
- 337SLOAD_name[55] "the first step prevents transact"
- 338SLOAD_name[56] "ion senders from spending coins "
- 339SLOAD_name[57] "that do not exist, the second ha"
- 340SLOAD_name[58] "lf of the first step prevents tr"
- 341SLOAD_name[59] "ansaction senders from spending "
- 342SLOAD_name[60] "other people's coins, and the se"
- 343SLOAD_name[61] "cond step enforces conservation "
- 344SLOAD_name[62] "of value. In order to use this f"
- 345SLOAD_name[63] "or payment, the protocol is as f"
- 346SLOAD_name[64] "ollows. Suppose Alice wants to s"
- 347SLOAD_name[65] "end 11.7 BTC to Bob. First, Alic"
- 348SLOAD_name[66] "e will look for a set of availab"
- 349SLOAD_name[67] "le UTXO that she owns that total"
- 350SLOAD_name[68] "s up to at least 11.7 BTC. Reali"
- 351SLOAD_name[69] "stically, Alice will not be able"
- 352SLOAD_name[70] " to get exactly 11.7 BTC; say th"
- 353SLOAD_name[71] "at the smallest she can get is 6"
- 354SLOAD_name[72] "+4+2=12. She then creates a tran"
- 355SLOAD_name[73] "saction with those three inputs "
- 356SLOAD_name[74] "and two outputs. The first outpu"
- 357SLOAD_name[75] "t will be 11.7 BTC with Bob's ad"
- 358SLOAD_name[76] "dress as its owner, and the seco"
- 359SLOAD_name[77] "nd output will be the remaining "
- 360SLOAD_name[78] "0.3 BTC *change*, with the owner"
- 361SLOAD_name[79] " being Alice herself. Minin"
- 362SLOAD_name[80] "g If we had access to a trus"
- 363SLOAD_name[81] "tworthy centralized service, thi"
- 364SLOAD_name[82] "s system would be trivial to imp"
- 365SLOAD_name[83] "lement; it could simply be coded"
- 366SLOAD_name[84] " exactly as described, using a c"
- 367SLOAD_name[85] "entralized server's hard drive t"
- 368SLOAD_name[86] "o keep track of the state. Howev"
- 369SLOAD_name[87] "er, with Bitcoin we are trying t"
- 370SLOAD_name[88] "o build a decentralized currency"
- 371SLOAD_name[89] " system, so we will need to comb"
- 372SLOAD_name[90] "ine the state transaction system"
- 373SLOAD_name[91] " with a consensus system in orde"
- 374SLOAD_name[92] "r to ensure that everyone agrees"
- 375SLOAD_name[93] " on the order of transactions. B"
- 376SLOAD_name[94] "itcoin's decentralized consensus"
- 377SLOAD_name[95] " process requires nodes in the n"
- 378SLOAD_name[96] "etwork to continuously attempt t"
- 379SLOAD_name[97] "o produce packages of transactio"
- 380SLOAD_name[98] "ns called *blocks*. The network "
- 381SLOAD_name[99] "is intended to produce roughly o"
- 382SLOAD_name[100] "ne block every ten minutes, with"
- 383SLOAD_name[101] " each block containing a timesta"
- 384SLOAD_name[102] "mp, a nonce, a reference to (ie."
- 385SLOAD_name[103] " hash of) the previous block and"
- 386SLOAD_name[104] " a list of all of the transactio"
- 387SLOAD_name[105] "ns that have taken place since t"
- 388SLOAD_name[106] "he previous block. Over time, th"
- 389SLOAD_name[107] "is creates a persistent, ever-gr"
- 390SLOAD_name[108] "owing, *blockchain* that constan"
- 391SLOAD_name[109] "tly updates to represent the lat"
- 392SLOAD_name[110] "est state of the Bitcoin ledger."
- 393SLOAD_name[111] " The algorithm for checking if a"
- 394SLOAD_name[112] " block is valid, expressed in th"
- 395SLOAD_name[113] "is paradigm, is as follows: Chec"
- 396SLOAD_name[114] "k if the previous block referenc"
- 397SLOAD_name[115] "ed by the block exists and is va"
- 398SLOAD_name[116] "lid. Check that the timestamp of"
- 399SLOAD_name[117] " the block is greater than that "
- 400SLOAD_name[118] "of the previous blockfn2 and les"
- 401SLOAD_name[119] "s than 2 hours into the future C"
- 402SLOAD_name[120] "heck that the proof-of-work on t"
- 403SLOAD_name[121] "he block is valid. Let S[0] be t"
- 404SLOAD_name[122] "he state at the end of the previ"
- 405SLOAD_name[123] "ous block. Suppose TX is the blo"
- 406SLOAD_name[124] "ck's transaction list with n tra"
- 407SLOAD_name[125] "nsactions. For all i in 0...n-1,"
- 408SLOAD_name[126] " set S[i+1] = APPLY(S[i],TX[i]) "
- 409SLOAD_name[127] "If any application returns an er"
- 410SLOAD_name[128] "ror, exit and return false. Retu"
- 411SLOAD_name[129] "rn true, and register S[n] as th"
- 412SLOAD_name[130] "e state at the end of this block"
- 413SLOAD_name[131] ". Essentially, each transaction "
- 414SLOAD_name[132] "in the block must provide a vali"
- 415SLOAD_name[133] "d state transition from what was"
- 416SLOAD_name[134] " the canonical state before the "
- 417SLOAD_name[135] "transaction was executed to some"
- 418SLOAD_name[136] " new state. Note that the state "
- 419SLOAD_name[137] "is not encoded in the block in a"
- 420SLOAD_name[138] "ny way; it is purely an abstract"
- 421SLOAD_name[139] "ion to be remembered by the vali"
- 422SLOAD_name[140] "dating node and can only be (sec"
- 423SLOAD_name[141] "urely) computed for any block by"
- 424SLOAD_name[142] " starting from the genesis state"
- 425SLOAD_name[143] " and sequentially applying every"
- 426SLOAD_name[144] " transaction in every block. Add"
- 427SLOAD_name[145] "itionally, note that the order i"
- 428SLOAD_name[146] "n which the miner includes trans"
- 429SLOAD_name[147] "actions into the block matters; "
- 430SLOAD_name[148] "if there are two transactions A "
- 431SLOAD_name[149] "and B in a block such that B spe"
- 432SLOAD_name[150] "nds a UTXO created by A, then th"
- 433SLOAD_name[151] "e block will be valid if A comes"
- 434SLOAD_name[152] " before B but not otherwise. The"
- 435SLOAD_name[153] " one validity condition present "
- 436SLOAD_name[154] "in the above list that is not fo"
- 437SLOAD_name[155] "und in other systems is the requ"
- 438SLOAD_name[156] "irement for *proof-of-work*. The"
- 439SLOAD_name[157] " precise condition is that the d"
- 440SLOAD_name[158] "ouble-SHA256 hash of every block"
- 441SLOAD_name[159] ", treated as a 256-bit number, m"
- 442SLOAD_name[160] "ust be less than a dynamically a"
- 443SLOAD_name[161] "djusted target, which as of the "
- 444SLOAD_name[162] "time of this writing is approxim"
- 445SLOAD_name[163] "ately 2187. The purpose of this "
- 446SLOAD_name[164] "is to make block creation comput"
- 447SLOAD_name[165] "ationally *hard*, thereby preven"
- 448SLOAD_name[166] "ting sybil attackers from remaki"
- 449SLOAD_name[167] "ng the entire blockchain in thei"
- 450SLOAD_name[168] "r favor. Because SHA256 is desig"
- 451SLOAD_name[169] "ned to be a completely unpredict"
- 452SLOAD_name[170] "able pseudorandom function, the "
- 453SLOAD_name[171] "only way to create a valid block"
- 454SLOAD_name[172] " is simply trial and error, repe"
- 455SLOAD_name[173] "atedly incrementing the nonce an"
- 456SLOAD_name[174] "d seeing if the new hash matches"
- 457SLOAD_name[175] ". At the current target of ~2187"
- 458SLOAD_name[176] ", the network must make an avera"
- 459SLOAD_name[177] "ge of ~269 tries before a valid "
- 460SLOAD_name[178] "block is found; in general, the "
- 461SLOAD_name[179] "target is recalibrated by the ne"
- 462SLOAD_name[180] "twork every 2016 blocks so that "
- 463SLOAD_name[181] "on average a new block is produc"
- 464SLOAD_name[182] "ed by some node in the network e"
- 465SLOAD_name[183] "very ten minutes. In order to co"
- 466SLOAD_name[184] "mpensate miners for this computa"
- 467SLOAD_name[185] "tional work, the miner of every "
- 468SLOAD_name[186] "block is entitled to include a t"
- 469SLOAD_name[187] "ransaction giving themselves 25 "
- 470SLOAD_name[188] "BTC out of nowhere. Additionally"
- 471SLOAD_name[189] ", if any transaction has a highe"
- 472SLOAD_name[190] "r total denomination in its inpu"
- 473SLOAD_name[191] "ts than in its outputs, the diff"
- 474SLOAD_name[192] "erence also goes to the miner as"
- 475SLOAD_name[193] " a *transaction fee*. Incidental"
- 476SLOAD_name[194] "ly, this is also the only mechan"
- 477SLOAD_name[195] "ism by which BTC are issued; the"
- 478SLOAD_name[196] " genesis state contained no coin"
- 479SLOAD_name[197] "s at all. In order to better und"
- 480SLOAD_name[198] "erstand the purpose of mining, l"
- 481SLOAD_name[199] "et us examine what happens in th"
- 482SLOAD_name[200] "e event of a malicious attacker."
- 483SLOAD_name[201] " Since Bitcoin's underlying cryp"
- 484SLOAD_name[202] "tography is known to be secure, "
- 485SLOAD_name[203] "the attacker will target the one"
- 486SLOAD_name[204] " part of the Bitcoin system that"
- 487SLOAD_name[205] " is not protected by cryptograph"
- 488SLOAD_name[206] "y directly: the order of transac"
- 489SLOAD_name[207] "tions. The attacker's strategy i"
- 490SLOAD_name[208] "s simple: Send 100 BTC to a merc"
- 491SLOAD_name[209] "hant in exchange for some produc"
- 492SLOAD_name[210] "t (preferably a rapid-delivery d"
- 493SLOAD_name[211] "igital good) ait for the deliver"
- 494SLOAD_name[212] "y of the product Produce another"
- 495SLOAD_name[213] " transaction sending the same 10"
- 496SLOAD_name[214] "0 BTC to himself Try to convince"
- 497SLOAD_name[215] " the network that his transactio"
- 498SLOAD_name[216] "n to himself was the one that ca"
- 499SLOAD_name[217] "me first. Once step (1) has take"
- 500SLOAD_name[218] "n place, after a few minutes som"
- 501SLOAD_name[219] "e miner will include the transac"
- 502SLOAD_name[220] "tion in a block, say block numbe"
- 503SLOAD_name[221] "r 270000. After about one hour, "
- 504SLOAD_name[222] "five more blocks will have been "
- 505SLOAD_name[223] "added to the chain after that bl"
- 506SLOAD_name[224] "ock, with each of those blocks i"
- 507SLOAD_name[225] "ndirectly pointing to the transa"
- 508SLOAD_name[226] "ction and thus *confirming* it. "
- 509SLOAD_name[227] "At this point, the merchant will"
- 510SLOAD_name[228] " accept the payment as finalized"
- 511SLOAD_name[229] " and deliver the product; since "
- 512SLOAD_name[230] "we are assuming this is a digita"
- 513SLOAD_name[231] "l good, delivery is instant. Now"
- 514SLOAD_name[232] ", the attacker creates another t"
- 515SLOAD_name[233] "ransaction sending the 100 BTC t"
- 516SLOAD_name[234] "o himself. If the attacker simpl"
- 517SLOAD_name[235] "y releases it into the wild, the"
- 518SLOAD_name[236] " transaction will not be process"
- 519SLOAD_name[237] "ed; miners will attempt to run A"
- 520SLOAD_name[238] "PPLY(S,TX) and notice that TX co"
- 521SLOAD_name[239] "nsumes a UTXO which is no longer"
- 522SLOAD_name[240] " in the state. So instead, the a"
- 523SLOAD_name[241] "ttacker creates a *fork* of the "
- 524SLOAD_name[242] "blockchain, starting by mining a"
- 525SLOAD_name[243] "nother version of block 270000 p"
- 526SLOAD_name[244] "ointing to the same block 269999"
- 527SLOAD_name[245] " as a parent but with the new tr"
- 528SLOAD_name[246] "ansaction in place of the old on"
- 529SLOAD_name[247] "e. Because the block data is dif"
- 530SLOAD_name[248] "ferent, this requires redoing th"
- 531SLOAD_name[249] "e proof-of-work. Furthermore, th"
- 532SLOAD_name[250] "e attacker's new version of bloc"
- 533SLOAD_name[251] "k 270000 has a different hash, s"
- 534SLOAD_name[252] "o the original blocks 270001 to "
- 535SLOAD_name[253] "270005 do not *point* to it; thu"
- 536SLOAD_name[254] "s, the original chain and the at"
- 537SLOAD_name[255] "tacker's new chain are completel"
- 538SLOAD_name[256] "y separate. The rule is that in "
- 539SLOAD_name[257] "a fork the longest blockchain is"
- 540SLOAD_name[258] " taken to be the truth, and so l"
- 541SLOAD_name[259] "egitimate miners will work on th"
- 542SLOAD_name[260] "e 270005 chain while the attacke"
- 543SLOAD_name[261] "r alone is working on the 270000"
- 544SLOAD_name[262] " chain. In order for the attacke"
- 545SLOAD_name[263] "r to make his blockchain the lon"
- 546SLOAD_name[264] "gest, he would need to have more"
- 547SLOAD_name[265] " computational power than the re"
- 548SLOAD_name[266] "st of the network combined in or"
- 549SLOAD_name[267] "der to catch up (hence, *51% att"
- 550SLOAD_name[268] "ack*). "
- 551SLOAD(_symbol[data], _symbol[length]) ("GENESIS", 7)
- 552SLOAD(_symbol[data], _symbol[length]) ("GENESIS", 7)
- 553SLOAD(_symbol[data], _symbol[length]) ("GENESIS", 7)
- 554SLOAD(_name[data], _name[length]) ("", 0)
- 555SHA30x00000000000000000000000000000000000000000000000000000000000000030xc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b
- 556SSTORE_name[0] " " to "Bitcoin As A State Transition Sy"
- 557SSTORE_name[1] " " to "stem From a technical standp"
- 558SSTORE_name[2] " " to "oint, the ledger of a cryptocurr"
- 559SSTORE_name[3] " " to "ency such as Bitcoin can be thou"
- 560SSTORE_name[4] " " to "ght of as a state transition sys"
- 561SSTORE_name[5] " " to "tem, where there is a *state* co"
- 562SSTORE_name[6] " " to "nsisting of the ownership status"
- 563SSTORE_name[7] " " to " of all existing bitcoins and a "
- 564SSTORE_name[8] " " to "*state transition function* that"
- 565SSTORE_name[9] " " to " takes a state and a transaction"
- 566SSTORE_name[10] " " to " and outputs a new state which i"
- 567SSTORE_name[11] " " to "s the result. In a standard bank"
- 568SSTORE_name[12] " " to "ing system, for example, the sta"
- 569SSTORE_name[13] " " to "te is a balance sheet, a transac"
- 570SSTORE_name[14] " " to "tion is a request to move $X fro"
- 571SSTORE_name[15] " " to "m A to B, and the state transiti"
- 572SSTORE_name[16] " " to "on function reduces the value in"
- 573SSTORE_name[17] " " to " A's account by $X and increases"
- 574SSTORE_name[18] " " to " the value in B's account by $X."
- 575SSTORE_name[19] " " to " If A's account has less than $X"
- 576SSTORE_name[20] " " to " in the first place, the state t"
- 577SSTORE_name[21] " " to "ransition function returns an er"
- 578SSTORE_name[22] " " to "ror. Hence, one can formally def"
- 579SSTORE_name[23] " " to "ine: The *state* in Bitcoin is"
- 580SSTORE_name[24] " " to " the collection of all coins (te"
- 581SSTORE_name[25] " " to "chnically, *unspent transaction "
- 582SSTORE_name[26] " " to "outputs* or UTXO) that have been"
- 583SSTORE_name[27] " " to " minted and not yet spent, with "
- 584SSTORE_name[28] " " to "each UTXO having a denomination "
- 585SSTORE_name[29] " " to "and an owner (defined by a 20-by"
- 586SSTORE_name[30] " " to "te address which is essentially "
- 587SSTORE_name[31] " " to "a cryptographic public keyfn1). "
- 588SSTORE_name[32] " " to "A transaction contains one or mo"
- 589SSTORE_name[33] " " to "re inputs, with each input conta"
- 590SSTORE_name[34] " " to "ining a reference to an existing"
- 591SSTORE_name[35] " " to " UTXO and a cryptographic signat"
- 592SSTORE_name[36] " " to "ure produced by the private key "
- 593SSTORE_name[37] " " to "associated with the owner's addr"
- 594SSTORE_name[38] " " to "ess, and one or more outputs, wi"
- 595SSTORE_name[39] " " to "th each output containing a new "
- 596SSTORE_name[40] " " to "UTXO to be added to the state. T"
- 597SSTORE_name[41] " " to "he state transition function APP"
- 598SSTORE_name[42] " " to "LY(S,TX) -> S' can be defined ro"
- 599SSTORE_name[43] " " to "ughly as follows: For each input"
- 600SSTORE_name[44] " " to " in TX: If the referenced UTXO i"
- 601SSTORE_name[45] " " to "s not in S, return an error. If "
- 602SSTORE_name[46] " " to "the provided signature does not "
- 603SSTORE_name[47] " " to "match the owner of the UTXO, ret"
- 604SSTORE_name[48] " " to "urn an error. If the sum of the "
- 605SSTORE_name[49] " " to "denominations of all input UTXO "
- 606SSTORE_name[50] " " to "is less than the sum of the deno"
- 607SSTORE_name[51] " " to "minations of all output UTXO, re"
- 608SSTORE_name[52] " " to "turn an error. Return S with all"
- 609SSTORE_name[53] " " to " input UTXO removed and all outp"
- 610SSTORE_name[54] " " to "ut UTXO added The first half of "
- 611SSTORE_name[55] " " to "the first step prevents transact"
- 612SSTORE_name[56] " " to "ion senders from spending coins "
- 613SSTORE_name[57] " " to "that do not exist, the second ha"
- 614SSTORE_name[58] " " to "lf of the first step prevents tr"
- 615SSTORE_name[59] " " to "ansaction senders from spending "
- 616SSTORE_name[60] " " to "other people's coins, and the se"
- 617SSTORE_name[61] " " to "cond step enforces conservation "
- 618SSTORE_name[62] " " to "of value. In order to use this f"
- 619SSTORE_name[63] " " to "or payment, the protocol is as f"
- 620SSTORE_name[64] " " to "ollows. Suppose Alice wants to s"
- 621SSTORE_name[65] " " to "end 11.7 BTC to Bob. First, Alic"
- 622SSTORE_name[66] " " to "e will look for a set of availab"
- 623SSTORE_name[67] " " to "le UTXO that she owns that total"
- 624SSTORE_name[68] " " to "s up to at least 11.7 BTC. Reali"
- 625SSTORE_name[69] " " to "stically, Alice will not be able"
- 626SSTORE_name[70] " " to " to get exactly 11.7 BTC; say th"
- 627SSTORE_name[71] " " to "at the smallest she can get is 6"
- 628SSTORE_name[72] " " to "+4+2=12. She then creates a tran"
- 629SSTORE_name[73] " " to "saction with those three inputs "
- 630SSTORE_name[74] " " to "and two outputs. The first outpu"
- 631SSTORE_name[75] " " to "t will be 11.7 BTC with Bob's ad"
- 632SSTORE_name[76] " " to "dress as its owner, and the seco"
- 633SSTORE_name[77] " " to "nd output will be the remaining "
- 634SSTORE_name[78] " " to "0.3 BTC *change*, with the owner"
- 635SSTORE_name[79] " " to " being Alice herself. Minin"
- 636SSTORE_name[80] " " to "g If we had access to a trus"
- 637SSTORE_name[81] " " to "tworthy centralized service, thi"
- 638SSTORE_name[82] " " to "s system would be trivial to imp"
- 639SSTORE_name[83] " " to "lement; it could simply be coded"
- 640SSTORE_name[84] " " to " exactly as described, using a c"
- 641SSTORE_name[85] " " to "entralized server's hard drive t"
- 642SSTORE_name[86] " " to "o keep track of the state. Howev"
- 643SSTORE_name[87] " " to "er, with Bitcoin we are trying t"
- 644SSTORE_name[88] " " to "o build a decentralized currency"
- 645SSTORE_name[89] " " to " system, so we will need to comb"
- 646SSTORE_name[90] " " to "ine the state transaction system"
- 647SSTORE_name[91] " " to " with a consensus system in orde"
- 648SSTORE_name[92] " " to "r to ensure that everyone agrees"
- 649SSTORE_name[93] " " to " on the order of transactions. B"
- 650SSTORE_name[94] " " to "itcoin's decentralized consensus"
- 651SSTORE_name[95] " " to " process requires nodes in the n"
- 652SSTORE_name[96] " " to "etwork to continuously attempt t"
- 653SSTORE_name[97] " " to "o produce packages of transactio"
- 654SSTORE_name[98] " " to "ns called *blocks*. The network "
- 655SSTORE_name[99] " " to "is intended to produce roughly o"
- 656SSTORE_name[100] " " to "ne block every ten minutes, with"
- 657SSTORE_name[101] " " to " each block containing a timesta"
- 658SSTORE_name[102] " " to "mp, a nonce, a reference to (ie."
- 659SSTORE_name[103] " " to " hash of) the previous block and"
- 660SSTORE_name[104] " " to " a list of all of the transactio"
- 661SSTORE_name[105] " " to "ns that have taken place since t"
- 662SSTORE_name[106] " " to "he previous block. Over time, th"
- 663SSTORE_name[107] " " to "is creates a persistent, ever-gr"
- 664SSTORE_name[108] " " to "owing, *blockchain* that constan"
- 665SSTORE_name[109] " " to "tly updates to represent the lat"
- 666SSTORE_name[110] " " to "est state of the Bitcoin ledger."
- 667SSTORE_name[111] " " to " The algorithm for checking if a"
- 668SSTORE_name[112] " " to " block is valid, expressed in th"
- 669SSTORE_name[113] " " to "is paradigm, is as follows: Chec"
- 670SSTORE_name[114] " " to "k if the previous block referenc"
- 671SSTORE_name[115] " " to "ed by the block exists and is va"
- 672SSTORE_name[116] " " to "lid. Check that the timestamp of"
- 673SSTORE_name[117] " " to " the block is greater than that "
- 674SSTORE_name[118] " " to "of the previous blockfn2 and les"
- 675SSTORE_name[119] " " to "s than 2 hours into the future C"
- 676SSTORE_name[120] " " to "heck that the proof-of-work on t"
- 677SSTORE_name[121] " " to "he block is valid. Let S[0] be t"
- 678SSTORE_name[122] " " to "he state at the end of the previ"
- 679SSTORE_name[123] " " to "ous block. Suppose TX is the blo"
- 680SSTORE_name[124] " " to "ck's transaction list with n tra"
- 681SSTORE_name[125] " " to "nsactions. For all i in 0...n-1,"
- 682SSTORE_name[126] " " to " set S[i+1] = APPLY(S[i],TX[i]) "
- 683SSTORE_name[127] " " to "If any application returns an er"
- 684SSTORE_name[128] " " to "ror, exit and return false. Retu"
- 685SSTORE_name[129] " " to "rn true, and register S[n] as th"
- 686SSTORE_name[130] " " to "e state at the end of this block"
- 687SSTORE_name[131] " " to ". Essentially, each transaction "
- 688SSTORE_name[132] " " to "in the block must provide a vali"
- 689SSTORE_name[133] " " to "d state transition from what was"
- 690SSTORE_name[134] " " to " the canonical state before the "
- 691SSTORE_name[135] " " to "transaction was executed to some"
- 692SSTORE_name[136] " " to " new state. Note that the state "
- 693SSTORE_name[137] " " to "is not encoded in the block in a"
- 694SSTORE_name[138] " " to "ny way; it is purely an abstract"
- 695SSTORE_name[139] " " to "ion to be remembered by the vali"
- 696SSTORE_name[140] " " to "dating node and can only be (sec"
- 697SSTORE_name[141] " " to "urely) computed for any block by"
- 698SSTORE_name[142] " " to " starting from the genesis state"
- 699SSTORE_name[143] " " to " and sequentially applying every"
- 700SSTORE_name[144] " " to " transaction in every block. Add"
- 701SSTORE_name[145] " " to "itionally, note that the order i"
- 702SSTORE_name[146] " " to "n which the miner includes trans"
- 703SSTORE_name[147] " " to "actions into the block matters; "
- 704SSTORE_name[148] " " to "if there are two transactions A "
- 705SSTORE_name[149] " " to "and B in a block such that B spe"
- 706SSTORE_name[150] " " to "nds a UTXO created by A, then th"
- 707SSTORE_name[151] " " to "e block will be valid if A comes"
- 708SSTORE_name[152] " " to " before B but not otherwise. The"
- 709SSTORE_name[153] " " to " one validity condition present "
- 710SSTORE_name[154] " " to "in the above list that is not fo"
- 711SSTORE_name[155] " " to "und in other systems is the requ"
- 712SSTORE_name[156] " " to "irement for *proof-of-work*. The"
- 713SSTORE_name[157] " " to " precise condition is that the d"
- 714SSTORE_name[158] " " to "ouble-SHA256 hash of every block"
- 715SSTORE_name[159] " " to ", treated as a 256-bit number, m"
- 716SSTORE_name[160] " " to "ust be less than a dynamically a"
- 717SSTORE_name[161] " " to "djusted target, which as of the "
- 718SSTORE_name[162] " " to "time of this writing is approxim"
- 719SSTORE_name[163] " " to "ately 2187. The purpose of this "
- 720SSTORE_name[164] " " to "is to make block creation comput"
- 721SSTORE_name[165] " " to "ationally *hard*, thereby preven"
- 722SSTORE_name[166] " " to "ting sybil attackers from remaki"
- 723SSTORE_name[167] " " to "ng the entire blockchain in thei"
- 724SSTORE_name[168] " " to "r favor. Because SHA256 is desig"
- 725SSTORE_name[169] " " to "ned to be a completely unpredict"
- 726SSTORE_name[170] " " to "able pseudorandom function, the "
- 727SSTORE_name[171] " " to "only way to create a valid block"
- 728SSTORE_name[172] " " to " is simply trial and error, repe"
- 729SSTORE_name[173] " " to "atedly incrementing the nonce an"
- 730SSTORE_name[174] " " to "d seeing if the new hash matches"
- 731SSTORE_name[175] " " to ". At the current target of ~2187"
- 732SSTORE_name[176] " " to ", the network must make an avera"
- 733SSTORE_name[177] " " to "ge of ~269 tries before a valid "
- 734SSTORE_name[178] " " to "block is found; in general, the "
- 735SSTORE_name[179] " " to "target is recalibrated by the ne"
- 736SSTORE_name[180] " " to "twork every 2016 blocks so that "
- 737SSTORE_name[181] " " to "on average a new block is produc"
- 738SSTORE_name[182] " " to "ed by some node in the network e"
- 739SSTORE_name[183] " " to "very ten minutes. In order to co"
- 740SSTORE_name[184] " " to "mpensate miners for this computa"
- 741SSTORE_name[185] " " to "tional work, the miner of every "
- 742SSTORE_name[186] " " to "block is entitled to include a t"
- 743SSTORE_name[187] " " to "ransaction giving themselves 25 "
- 744SSTORE_name[188] " " to "BTC out of nowhere. Additionally"
- 745SSTORE_name[189] " " to ", if any transaction has a highe"
- 746SSTORE_name[190] " " to "r total denomination in its inpu"
- 747SSTORE_name[191] " " to "ts than in its outputs, the diff"
- 748SSTORE_name[192] " " to "erence also goes to the miner as"
- 749SSTORE_name[193] " " to " a *transaction fee*. Incidental"
- 750SSTORE_name[194] " " to "ly, this is also the only mechan"
- 751SSTORE_name[195] " " to "ism by which BTC are issued; the"
- 752SSTORE_name[196] " " to " genesis state contained no coin"
- 753SSTORE_name[197] " " to "s at all. In order to better und"
- 754SSTORE_name[198] " " to "erstand the purpose of mining, l"
- 755SSTORE_name[199] " " to "et us examine what happens in th"
- 756SSTORE_name[200] " " to "e event of a malicious attacker."
- 757SSTORE_name[201] " " to " Since Bitcoin's underlying cryp"
- 758SSTORE_name[202] " " to "tography is known to be secure, "
- 759SSTORE_name[203] " " to "the attacker will target the one"
- 760SSTORE_name[204] " " to " part of the Bitcoin system that"
- 761SSTORE_name[205] " " to " is not protected by cryptograph"
- 762SSTORE_name[206] " " to "y directly: the order of transac"
- 763SSTORE_name[207] " " to "tions. The attacker's strategy i"
- 764SSTORE_name[208] " " to "s simple: Send 100 BTC to a merc"
- 765SSTORE_name[209] " " to "hant in exchange for some produc"
- 766SSTORE_name[210] " " to "t (preferably a rapid-delivery d"
- 767SSTORE_name[211] " " to "igital good) ait for the deliver"
- 768SSTORE_name[212] " " to "y of the product Produce another"
- 769SSTORE_name[213] " " to " transaction sending the same 10"
- 770SSTORE_name[214] " " to "0 BTC to himself Try to convince"
- 771SSTORE_name[215] " " to " the network that his transactio"
- 772SSTORE_name[216] " " to "n to himself was the one that ca"
- 773SSTORE_name[217] " " to "me first. Once step (1) has take"
- 774SSTORE_name[218] " " to "n place, after a few minutes som"
- 775SSTORE_name[219] " " to "e miner will include the transac"
- 776SSTORE_name[220] " " to "tion in a block, say block numbe"
- 777SSTORE_name[221] " " to "r 270000. After about one hour, "
- 778SSTORE_name[222] " " to "five more blocks will have been "
- 779SSTORE_name[223] " " to "added to the chain after that bl"
- 780SSTORE_name[224] " " to "ock, with each of those blocks i"
- 781SSTORE_name[225] " " to "ndirectly pointing to the transa"
- 782SSTORE_name[226] " " to "ction and thus *confirming* it. "
- 783SSTORE_name[227] " " to "At this point, the merchant will"
- 784SSTORE_name[228] " " to " accept the payment as finalized"
- 785SSTORE_name[229] " " to " and deliver the product; since "
- 786SSTORE_name[230] " " to "we are assuming this is a digita"
- 787SSTORE_name[231] " " to "l good, delivery is instant. Now"
- 788SSTORE_name[232] " " to ", the attacker creates another t"
- 789SSTORE_name[233] " " to "ransaction sending the 100 BTC t"
- 790SSTORE_name[234] " " to "o himself. If the attacker simpl"
- 791SSTORE_name[235] " " to "y releases it into the wild, the"
- 792SSTORE_name[236] " " to " transaction will not be process"
- 793SSTORE_name[237] " " to "ed; miners will attempt to run A"
- 794SSTORE_name[238] " " to "PPLY(S,TX) and notice that TX co"
- 795SSTORE_name[239] " " to "nsumes a UTXO which is no longer"
- 796SSTORE_name[240] " " to " in the state. So instead, the a"
- 797SSTORE_name[241] " " to "ttacker creates a *fork* of the "
- 798SSTORE_name[242] " " to "blockchain, starting by mining a"
- 799SSTORE_name[243] " " to "nother version of block 270000 p"
- 800SSTORE_name[244] " " to "ointing to the same block 269999"
- 801SSTORE_name[245] " " to " as a parent but with the new tr"
- 802SSTORE_name[246] " " to "ansaction in place of the old on"
- 803SSTORE_name[247] " " to "e. Because the block data is dif"
- 804SSTORE_name[248] " " to "ferent, this requires redoing th"
- 805SSTORE_name[249] " " to "e proof-of-work. Furthermore, th"
- 806SSTORE_name[250] " " to "e attacker's new version of bloc"
- 807SSTORE_name[251] " " to "k 270000 has a different hash, s"
- 808SSTORE_name[252] " " to "o the original blocks 270001 to "
- 809SSTORE_name[253] " " to "270005 do not *point* to it; thu"
- 810SSTORE_name[254] " " to "s, the original chain and the at"
- 811SSTORE_name[255] " " to "tacker's new chain are completel"
- 812SSTORE_name[256] " " to "y separate. The rule is that in "
- 813SSTORE_name[257] " " to "a fork the longest blockchain is"
- 814SSTORE_name[258] " " to " taken to be the truth, and so l"
- 815SSTORE_name[259] " " to "egitimate miners will work on th"
- 816SSTORE_name[260] " " to "e 270005 chain while the attacke"
- 817SSTORE_name[261] " " to "r alone is working on the 270000"
- 818SSTORE_name[262] " " to " chain. In order for the attacke"
- 819SSTORE_name[263] " " to "r to make his blockchain the lon"
- 820SSTORE_name[264] " " to "gest, he would need to have more"
- 821SSTORE_name[265] " " to " computational power than the re"
- 822SSTORE_name[266] " " to "st of the network combined in or"
- 823SSTORE_name[267] " " to "der to catch up (hence, *51% att"
- 824SSTORE_name[268] " " to "ack*). "
- 825SSTORE_name[length] 0 to 6
- 826SLOAD(_symbol[data], _symbol[length]) ("", 0)
- 827SSTORE(_symbol[data], _symbol[length]) ("" to "GENESIS", 0 to 7)
- 828
- 829
- 831SSTOREmaxTransaction 0 to 360000000000000000000000
- 832SSTOREmaxWalletHolding 0 to 360000000000000000000000
- 833SSTOREcontractSellTreshold 0 to 72000000000000000000000
- 834SSTOREdevBuyTax 0 to 1
- 835SSTORE
- 836SLOAD
- 837SLOAD
- 838SSTOREtotalBuyTax 0 to 1
- 839SSTOREdevSellTax 0 to 1
- 840SSTORE
- 841SLOAD
- 842SLOAD
- 843SSTOREtotalSellTax 0 to 1
- 844
- 845
- 846
- 847
- 848SHA30x0000000000000000000000006dc0868d33f556e77252280696158defb3d6481100000000000000000000000000000000000000000000000000000000000000190x24b95acd8d68ccb989faa07aa5e9c5464d8a49cc331d405963d275f4513d7a4c
- 849
- 850SSTORE
- 851LOGExcludeFromFees (account= 0x6dc0868d33f556e77252280696158defb3d64811, isExcluded=true)
- 852
- 853SHA30x000000000000000000000000a291acaf4a8fe16a5b1f15c6d6004fa3ab7f58ca00000000000000000000000000000000000000000000000000000000000000190x4b57e9c0eb7a4aa7e446b9ab56f42c20814ee337f810ca27c3906ac904057f4c
- 854
- 855SSTORE
- 856LOGExcludeFromFees (account= GENESIS, isExcluded=true)
- 857
- 858SHA30x000000000000000000000000000000000000000000000000000000000000dead00000000000000000000000000000000000000000000000000000000000000190xc73b1d6eda13a615b81c31830292dbbbf5fbb07f472982e223002bd83d5c3dc4
- 859
- 860SSTORE
- 861LOGExcludeFromFees (account= 0x000000000000000000000000000000000000dead, isExcluded=true)
- 862
- 863
- 864SHA30x0000000000000000000000006dc0868d33f556e77252280696158defb3d6481100000000000000000000000000000000000000000000000000000000000000190x24b95acd8d68ccb989faa07aa5e9c5464d8a49cc331d405963d275f4513d7a4c
- 865
- 866
- 867LOGExcludeFromFees (account= 0x6dc0868d33f556e77252280696158defb3d64811, isExcluded=true)
- 868
- 869
- 870SHA30x0000000000000000000000006dc0868d33f556e77252280696158defb3d64811000000000000000000000000000000000000000000000000000000000000001a0x541aa79f898591504aa4a80120a2253f8a18db25462c5e5b445484b05a744eb9
- 871
- 872SSTORE
- 873
- 874SHA30x000000000000000000000000a291acaf4a8fe16a5b1f15c6d6004fa3ab7f58ca000000000000000000000000000000000000000000000000000000000000001a0xd3837daf64a2834650bf553e1c5241294b4f212fc256abd734959d542de7a45a
- 875
- 876SSTORE
- 877
- 878SHA30x000000000000000000000000000000000000000000000000000000000000dead000000000000000000000000000000000000000000000000000000000000001a0x428bdc965569ef4717764ecfd84e88946a9a226b52b813e6ab6a7f46aad86e88
- 879
- 880SSTORE
- 881
- 882
- 883SHA30x0000000000000000000000006dc0868d33f556e77252280696158defb3d64811000000000000000000000000000000000000000000000000000000000000001a0x541aa79f898591504aa4a80120a2253f8a18db25462c5e5b445484b05a744eb9
- 884
- 885
- 886SLOAD
- 887SSTORE_totalSupply 0 to 72000000000000000000000000
- 888SHA30x0000000000000000000000006dc0868d33f556e77252280696158defb3d6481100000000000000000000000000000000000000000000000000000000000000000xc7afe6154b4ebb298da9b40a16b233317597d3df4a6fbe462aabb52068a24998
- 889
- 890SHA30x0000000000000000000000006dc0868d33f556e77252280696158defb3d6481100000000000000000000000000000000000000000000000000000000000000000xc7afe6154b4ebb298da9b40a16b233317597d3df4a6fbe462aabb52068a24998
- 891SSTORE_balances[0x6dc0868d33f556e77252280696158defb3d64811] 0 to 72000000000000000000000000
- 892LOGTransfer (from= 0x0000000000000000000000000000000000000000, to= 0x6dc0868d33f556e77252280696158defb3d64811, value=72000000000000000000000000)
-