SHOW:
|
|
- or go back to the newest paste.
1 | - | Original WP Ported by Galaxy |
1 | + | Original WP Ported by Galaxy Stargraph |
2 | v1.0 2009 | |
3 | ||
4 | ||
5 | ||
6 | Bitcoin: A Peer-to-Peer Electronic Cash System | |
7 | ||
8 | ||
9 | Satoshi Nakamoto | |
10 | [email protected] | |
11 | www.bitcoin.org | |
12 | ||
13 | ||
14 | ||
15 | ABSTRACT. A purely peer-to-peer version of electronic cash would allow online | |
16 | payments to be sent directly from one party to another without going through a | |
17 | financial institution. Digital signatures provide part of the solution, but the main | |
18 | benefits are lost if a trusted third party is still required to prevent double-spending. | |
19 | We propose a solution to the double-spending problem using a peer-to-peer network. | |
20 | The network timestamps transactions by hashing them into an ongoing chain of | |
21 | hash-based proof-of-work, forming a record that cannot be changed without redoing | |
22 | the proof-of-work. The longest chain not only serves as proof of the sequence of | |
23 | events witnessed, but proof that it came from the largest pool of CPU power. As | |
24 | long as a majority of CPU power is controlled by nodes that are not cooperating to | |
25 | attack the network, they'll generate the longest chain and outpace attackers. The | |
26 | network itself requires minimal structure. Messages are broadcast on a best effort | |
27 | basis, and nodes can leave and rejoin the network at will, accepting the longest | |
28 | proof-of-work chain as proof of what happened while they were gone. | |
29 | ||
30 | ||
31 | ||
32 | 1. Introduction | |
33 | ||
34 | Commerce on the Internet has come to rely almost exclusively on financial institutions serving as | |
35 | trusted third parties to process electronic payments. While the system works well enough for | |
36 | most transactions, it still suffers from the inherent weaknesses of the trust based model. | |
37 | Completely non-reversible transactions are not really possible, since financial institutions cannot | |
38 | avoid mediating disputes. The cost of mediation increases transaction costs, limiting the | |
39 | minimum practical transaction size and cutting off the possibility for small casual transactions, | |
40 | and there is a broader cost in the loss of ability to make non-reversible payments for non- | |
41 | reversible services. With the possibility of reversal, the need for trust spreads. Merchants must | |
42 | be wary of their customers, hassling them for more information than they would otherwise need. | |
43 | A certain percentage of fraud is accepted as unavoidable. These costs and payment uncertainties | |
44 | can be avoided in person by using physical currency, but no mechanism exists to make payments | |
45 | over a communications channel without a trusted party. | |
46 | What is needed is an electronic payment system based on cryptographic proof instead of trust, | |
47 | allowing any two willing parties to transact directly with each other without the need for a trusted | |
48 | third party. Transactions that are computationally impractical to reverse would protect sellers | |
49 | from fraud, and routine escrow mechanisms could easily be implemented to protect buyers. In | |
50 | this paper, we propose a solution to the double-spending problem using a peer-to-peer distributed | |
51 | timestamp server to generate computational proof of the chronological order of transactions. The | |
52 | system is secure as long as honest nodes collectively control more CPU power than any | |
53 | cooperating group of attacker nodes. | |
54 | ||
55 | ||
56 | ||
57 | ||
58 | 1 | |
59 | ||
60 | ||
61 | ||
62 | 2. Transactions | |
63 | ||
64 | We define an electronic coin as a chain of digital signatures. Each owner transfers the coin to the | |
65 | next by digitally signing a hash of the previous transaction and the public key of the next owner | |
66 | and adding these to the end of the coin. A payee can verify the signatures to verify the chain of | |
67 | ownership. | |
68 | ||
69 | ___________________ ___________________ ___________________ | |
70 | | Transaction | | Transaction | | Transaction | | |
71 | | _____________ | | _____________ | | _____________ | | |
72 | | | Owner 1's | | | | Owner 2's | | | | Owner 3's | | | |
73 | | | Public Key | | | | Public Key | | | | Public Key | | | |
74 | | ``````|````|` | | ``````|````|` | | ``````|`````` | | |
75 | ````````````| | | |``````````````````| | | |``````````````````| | | | |
76 | | V V | | | V V | | | V V | | |
77 | | ______ | | | ______ | | | ______ | | |
78 | | | Hash | | | | | Hash | | | | | Hash | | | |
79 | | ```|`` | | | ```|`` | | | ```|`` | | |
80 | | | \ | | | \ | | | | | |
81 | | V \ | | V \ | | V | | |
82 | | ____________ \ | Verify | ____________ \ | Verify | ____________ | | |
83 | | | Owner 0's | `-------------->| Owner 1's | `-------------->| Owner 2's | | | |
84 | | | Signature | | ,-------->| Signature | | ,-------->| Signature | | | |
85 | | ```````````` | / Sign | ```````````` | / Sign | ```````````` | | |
86 | ``````````````````` / ``````````````````` / ``````````````````` | |
87 | / / | |
88 | _____________ / _____________ / _____________ | |
89 | | Owner 1's |--' | Owner 2's |--' | Owner 3's | | |
90 | | Private Key | | Private Key | | Private Key | | |
91 | ````````````` ````````````` ````````````` | |
92 | ||
93 | The problem of course is the payee can't verify that one of the owners did not double-spend | |
94 | the coin. A common solution is to introduce a trusted central authority, or mint, that checks every | |
95 | transaction for double spending. After each transaction, the coin must be returned to the mint to | |
96 | issue a new coin, and only coins issued directly from the mint are trusted not to be double-spent. | |
97 | The problem with this solution is that the fate of the entire money system depends on the | |
98 | company running the mint, with every transaction having to go through them, just like a bank. | |
99 | We need a way for the payee to know that the previous owners did not sign any earlier | |
100 | transactions. For our purposes, the earliest transaction is the one that counts, so we don't care | |
101 | about later attempts to double-spend. The only way to confirm the absence of a transaction is to | |
102 | be aware of all transactions. In the mint based model, the mint was aware of all transactions and | |
103 | decided which arrived first. To accomplish this without a trusted party, transactions must be | |
104 | publicly announced [1], and we need a system for participants to agree on a single history of the | |
105 | order in which they were received. The payee needs proof that at the time of each transaction, the | |
106 | majority of nodes agreed it was the first received. | |
107 | ||
108 | ||
109 | 3. Timestamp Server | |
110 | ||
111 | The solution we propose begins with a timestamp server. A timestamp server works by taking a | |
112 | hash of a block of items to be timestamped and widely publishing the hash, such as in a | |
113 | newspaper or Usenet post [2-5]. The timestamp proves that the data must have existed at the | |
114 | time, obviously, in order to get into the hash. Each timestamp includes the previous timestamp in | |
115 | its hash, forming a chain, with each additional timestamp reinforcing the ones before it. | |
116 | ||
117 | ________ ________ | |
118 | ----------->| Hash |--------------------->| Hash | | |
119 | ,--->| | ,--->| | | |
120 | | ```````` | ```````` | |
121 | ___________________________ ___________________________ | |
122 | | Block | | Block | | |
123 | | ______ ______ _____ | | ______ ______ _____ | | |
124 | | | Item | | Item | | ... | | | | Item | | Item | | ... | | | |
125 | | `````` `````` ````` | | `````` `````` ````` | | |
126 | ``````````````````````````` ``````````````````````````` | |
127 | ||
128 | ||
129 | ||
130 | ||
131 | 2 | |
132 | ||
133 | ||
134 | ||
135 | 4. Proof-of-Work | |
136 | ||
137 | To implement a distributed timestamp server on a peer-to-peer basis, we will need to use a proof | |
138 | of-work system similar to Adam Back's Hashcash [6], rather than newspaper or Usenet posts. | |
139 | The proof-of-work involves scanning for a value that when hashed, such as with SHA-256, the | |
140 | hash begins with a number of zero bits. The average work required is exponential in the number | |
141 | of zero bits required and can be verified by executing a single hash. | |
142 | For our timestamp network, we implement the proof-of-work by incrementing a nonce in the | |
143 | block until a value is found that gives the block's hash the required zero bits. Once the CPU | |
144 | effort has been expended to make it satisfy the proof-of-work, the block cannot be changed | |
145 | without redoing the work. As later blocks are chained after it, the work to change the block | |
146 | would include redoing all the blocks after it. | |
147 | ||
148 | _____________________________ _____________________________ | |
149 | | Block | | Block | | |
150 | | ___________ _______ | | ___________ _______ | | |
151 | ----->| Prev Hash | | Nonce | |----->| Prev Hash | | Nonce | | | |
152 | | ``````````` ``````` | | ``````````` ``````` | | |
153 | | ______ ______ _____ | | ______ ______ _____ | | |
154 | | | Tx | | Tx | | ... | | | | Tx | | Tx | | ... | | | |
155 | | `````` `````` ````` | | `````` `````` ````` | | |
156 | ````````````````````````````` ````````````````````````````` | |
157 | ||
158 | The proof-of-work also solves the problem of determining representation in majority decision | |
159 | making. If the majority were based on one-IP-address-one-vote, it could be subverted by anyone | |
160 | able to allocate many IPs. Proof-of-work is essentially one-CPU-one-vote. The majority | |
161 | decision is represented by the longest chain, which has the greatest proof-of-work effort invested | |
162 | in it. If a majority of CPU power is controlled by honest nodes, the honest chain will grow the | |
163 | fastest and outpace any competing chains. To modify a past block, an attacker would have to | |
164 | redo the proof-of-work of the block and all blocks after it and then catch up with and surpass the | |
165 | work of the honest nodes. We will show later that the probability of a slower attacker catching up | |
166 | diminishes exponentially as subsequent blocks are added. | |
167 | To compensate for increasing hardware speed and varying interest in running nodes over time, | |
168 | the proof-of-work difficulty is determined by a moving average targeting an average number of | |
169 | blocks per hour. If they're generated too fast, the difficulty increases. | |
170 | ||
171 | ||
172 | 5. Network | |
173 | ||
174 | The steps to run the network are as follows: | |
175 | ||
176 | 1) New transactions are broadcast to all nodes. | |
177 | 2) Each node collects new transactions into a block. | |
178 | 3) Each node works on finding a difficult proof-of-work for its block. | |
179 | 4) When a node finds a proof-of-work, it broadcasts the block to all nodes. | |
180 | 5) Nodes accept the block only if all transactions in it are valid and not already spent. | |
181 | 6) Nodes express their acceptance of the block by working on creating the next block in the | |
182 | chain, using the hash of the accepted block as the previous hash. | |
183 | ||
184 | Nodes always consider the longest chain to be the correct one and will keep working on | |
185 | extending it. If two nodes broadcast different versions of the next block simultaneously, some | |
186 | nodes may receive one or the other first. In that case, they work on the first one they received, | |
187 | but save the other branch in case it becomes longer. The tie will be broken when the next proof | |
188 | of-work is found and one branch becomes longer; the nodes that were working on the other | |
189 | branch will then switch to the longer one. | |
190 | ||
191 | ||
192 | ||
193 | ||
194 | 3 | |
195 | ||
196 | ||
197 | ||
198 | New transaction broadcasts do not necessarily need to reach all nodes. As long as they reach | |
199 | many nodes, they will get into a block before long. Block broadcasts are also tolerant of dropped | |
200 | messages. If a node does not receive a block, it will request it when it receives the next block and | |
201 | realizes it missed one. | |
202 | ||
203 | ||
204 | 6. Incentive | |
205 | ||
206 | By convention, the first transaction in a block is a special transaction that starts a new coin owned | |
207 | by the creator of the block. This adds an incentive for nodes to support the network, and provides | |
208 | a way to initially distribute coins into circulation, since there is no central authority to issue them. | |
209 | The steady addition of a constant of amount of new coins is analogous to gold miners expending | |
210 | resources to add gold to circulation. In our case, it is CPU time and electricity that is expended. | |
211 | The incentive can also be funded with transaction fees. If the output value of a transaction is | |
212 | less than its input value, the difference is a transaction fee that is added to the incentive value of | |
213 | the block containing the transaction. Once a predetermined number of coins have entered | |
214 | circulation, the incentive can transition entirely to transaction fees and be completely inflation | |
215 | free. | |
216 | The incentive may help encourage nodes to stay honest. If a greedy attacker is able to | |
217 | assemble more CPU power than all the honest nodes, he would have to choose between using it | |
218 | to defraud people by stealing back his payments, or using it to generate new coins. He ought to | |
219 | find it more profitable to play by the rules, such rules that favour him with more new coins than | |
220 | everyone else combined, than to undermine the system and the validity of his own wealth. | |
221 | ||
222 | ||
223 | 7. Reclaiming Disk Space | |
224 | ||
225 | Once the latest transaction in a coin is buried under enough blocks, the spent transactions before | |
226 | it can be discarded to save disk space. To facilitate this without breaking the block's hash, | |
227 | transactions are hashed in a Merkle Tree [7][2][5], with only the root included in the block's hash. | |
228 | Old blocks can then be compacted by stubbing off branches of the tree. The interior hashes do | |
229 | not need to be stored. | |
230 | ||
231 | ___________________________________________ ___________________________________________ | |
232 | | Block ____________________________ | | Block ____________________________ | | |
233 | | | Block Header (Block Hash) | | | | Block Header (Block Hash) | | | |
234 | | | ___________ _______ | | | | ___________ _______ | | | |
235 | | | | Prev Hash | | Nonce | | | | | | Prev Hash | | Nonce | | | | |
236 | | | ``````````` ``````` | | | | ``````````` ``````` | | | |
237 | | | _______________ | | | | _______________ | | | |
238 | | | | Root Hash | | | | | | Root Hash | | | | |
239 | | | `+```````````+` | | | | `+```````````+` | | | |
240 | | ``````/`````````````\``````` | | ``````/`````````````\``````` | | |
241 | | / \ | | / \ | | |
242 | | _____/__ __\_____ | | _____/__ __\_____ | | |
243 | | | Hash01 | | Hash23 | | | | Hash01 | | Hash23 | | | |
244 | | `+````+` `+````+` | | ```````` `+````+` | | |
245 | | / \ / \ | | / \ | | |
246 | | / \ / \ | | / \ | | |
247 | | _____ _____ _____ _____ | | _____ _____ | | |
248 | | |Hash0| |Hash1| |Hash2| |Hash3| | | |Hash2| |Hash3| | | |
249 | | ``+`` ``+`` ``+`` ``+`` | | ``+`` ``+`` | | |
250 | | | | | | | | | | | | |
251 | | __|__ __|__ __|__ __|__ | | __|__ __|__ | | |
252 | | | Tx0 | | Tx1 | | Tx2 | | Tx3 | | | | Tx2 | | Tx3 | | | |
253 | | ````` ````` ````` ````` | | ````` ````` | | |
254 | ``````````````````````````````````````````` ``````````````````````````````````````````` | |
255 | Transactions Hashed in a Merkle Tree After Pruning Tx0-2 from the Block | |
256 | ||
257 | ||
258 | A block header with no transactions would be about 80 bytes. If we suppose blocks are | |
259 | generated every 10 minutes, 80 bytes * 6 * 24 * 365 = 4.2MB per year. With computer systems | |
260 | typically selling with 2GB of RAM as of 2008, and Moore's Law predicting current growth of | |
261 | 1.2GB per year, storage should not be a problem even if the block headers must be kept in | |
262 | memory. | |
263 | ||
264 | ||
265 | ||
266 | ||
267 | 4 | |
268 | ||
269 | ||
270 | ||
271 | 8. Simplified Payment Verification | |
272 | ||
273 | It is possible to verify payments without running a full network node. A user only needs to keep | |
274 | a copy of the block headers of the longest proof-of-work chain, which he can get by querying | |
275 | network nodes until he's convinced he has the longest chain, and obtain the Merkle branch | |
276 | linking the transaction to the block it's timestamped in. He can't check the transaction for | |
277 | himself, but by linking it to a place in the chain, he can see that a network node has accepted it, | |
278 | and blocks added after it further confirm the network has accepted it. | |
279 | ||
280 | Longest Proof-of-Work Chain | |
281 | _____________________________ _____________________________ _____________________________ | |
282 | | Block | | Block | | Block | | |
283 | | ___________ _______ | | ___________ _______ | | ___________ _______ | | |
284 | ----->| Prev Hash | | Nonce | |----->| Prev Hash | | Nonce | |----->| Prev Hash | | Nonce | |---> | |
285 | | ``````````` ``````` | | ``````````` ``````` | | ``````````` ``````` | | |
286 | | _______________ | | _______________ | | _______________ | | |
287 | | | Merkle Root | | | | Merkle Root | | | | Merkle Root | | | |
288 | | ``````````````` | | `+```````````+` | | ``````````````` | | |
289 | ````````````````````````````` ``````/`````````````\```````` ````````````````````````````` | |
290 | / \ | |
291 | _____/__ __\_____ | |
292 | | Hash01 | | Hash23 | | |
293 | ```````` ``````+` | |
294 | \ Merkle Branch for Tx3 | |
295 | \ | |
296 | _____ | |
297 | |Hash3| | |
298 | ``+`` | |
299 | | | |
300 | __|__ | |
301 | | Tx3 | | |
302 | ````` | |
303 | ||
304 | As such, the verification is reliable as long as honest nodes control the network, but is more | |
305 | vulnerable if the network is overpowered by an attacker. While network nodes can verify | |
306 | transactions for themselves, the simplified method can be fooled by an attacker's fabricated | |
307 | transactions for as long as the attacker can continue to overpower the network. One strategy to | |
308 | protect against this would be to accept alerts from network nodes when they detect an invalid | |
309 | block, prompting the user's software to download the full block and alerted transactions to | |
310 | confirm the inconsistency. Businesses that receive frequent payments will probably still want to | |
311 | run their own nodes for more independent security and quicker verification. | |
312 | ||
313 | ||
314 | 9. Combining and Splitting Value | |
315 | ||
316 | Although it would be possible to handle coins individually, it would be unwieldy to make a | |
317 | separate transaction for every cent in a transfer. To allow value to be split and combined, | |
318 | transactions contain multiple inputs and outputs. Normally there will be either a single input | |
319 | from a larger previous transaction or multiple inputs combining smaller amounts, and at most two | |
320 | outputs: one for the payment, and one returning the change, if any, back to the sender. | |
321 | ||
322 | ________________ | |
323 | | Transaction | | |
324 | | ____ _____ | | |
325 | ----->| In | | Out |-----> | |
326 | | ```` ````` | | |
327 | | ____ _____ | | |
328 | ----->| In | | ... |-----> | |
329 | | ```` ````` | | |
330 | | _____ | | |
331 | ----->| ... | | | |
332 | | ````` | | |
333 | ```````````````` | |
334 | ||
335 | It should be noted that fan-out, where a transaction depends on several transactions, and those | |
336 | transactions depend on many more, is not a problem here. There is never the need to extract a | |
337 | complete standalone copy of a transaction's history. | |
338 | ||
339 | ||
340 | ||
341 | ||
342 | 5 | |
343 | ||
344 | ||
345 | ||
346 | 10. Privacy | |
347 | ||
348 | The traditional banking model achieves a level of privacy by limiting access to information to the | |
349 | parties involved and the trusted third party. The necessity to announce all transactions publicly | |
350 | precludes this method, but privacy can still be maintained by breaking the flow of information in | |
351 | another place: by keeping public keys anonymous. The public can see that someone is sending | |
352 | an amount to someone else, but without information linking the transaction to anyone. This is | |
353 | similar to the level of information released by stock exchanges, where the time and size of | |
354 | individual trades, the "tape", is made public, but without telling who the parties were. | |
355 | ||
356 | Traditional Privacy Model _____________ ______________ | ______________ | |
357 | ____________ ____________ | | | | | | | | |
358 | | Identities |---|Transactions|-->| Trusted |-->| Counterparty | | | Public | | |
359 | ```````````` ```````````` | Third Party | | | | | | | |
360 | ````````````` `````````````` | `````````````` | |
361 | ||
362 | New Privacy Model ______________ | |
363 | ____________ | ____________ | | | |
364 | | Identities | | |Transactions|-->| Public | | |
365 | ```````````` | ```````````` | | | |
366 | `````````````` | |
367 | ||
368 | As an additional firewall, a new key pair should be used for each transaction to keep them | |
369 | from being linked to a common owner. Some linking is still unavoidable with multi-input | |
370 | transactions, which necessarily reveal that their inputs were owned by the same owner. The risk | |
371 | is that if the owner of a key is revealed, linking could reveal other transactions that belonged to | |
372 | the same owner. | |
373 | ||
374 | ||
375 | 11. Calculations | |
376 | ||
377 | We consider the scenario of an attacker trying to generate an alternate chain faster than the honest | |
378 | chain. Even if this is accomplished, it does not throw the system open to arbitrary changes, such | |
379 | as creating value out of thin air or taking money that never belonged to the attacker. Nodes are | |
380 | not going to accept an invalid transaction as payment, and honest nodes will never accept a block | |
381 | containing them. An attacker can only try to change one of his own transactions to take back | |
382 | money he recently spent. | |
383 | The race between the honest chain and an attacker chain can be characterized as a Binomial | |
384 | Random Walk. The success event is the honest chain being extended by one block, increasing its | |
385 | lead by +1, and the failure event is the attacker's chain being extended by one block, reducing the | |
386 | gap by -1. | |
387 | The probability of an attacker catching up from a given deficit is analogous to a Gambler's | |
388 | Ruin problem. Suppose a gambler with unlimited credit starts at a deficit and plays potentially an | |
389 | infinite number of trials to try to reach breakeven. We can calculate the probability he ever | |
390 | reaches breakeven, or that an attacker ever catches up with the honest chain, as follows [8]: | |
391 | ||
392 | p = probability an honest node finds the next block | |
393 | q = probability the attacker finds the next block | |
394 | qz = probability the attacker will ever catch up from z blocks behind | |
395 | ||
396 | , . | |
397 | / 1 if p<=q \ | |
398 | qz=| | | |
399 | \ (q/p)^z if p>q / | |
400 | ` ` | |
401 | ||
402 | ||
403 | ||
404 | ||
405 | 6 | |
406 | ||
407 | ||
408 | ||
409 | Given our assumption that p > q, the probability drops exponentially as the number of blocks the | |
410 | attacker has to catch up with increases. With the odds against him, if he doesn't make a lucky | |
411 | lunge forward early on, his chances become vanishingly small as he falls further behind. | |
412 | We now consider how long the recipient of a new transaction needs to wait before being | |
413 | sufficiently certain the sender can't change the transaction. We assume the sender is an attacker | |
414 | who wants to make the recipient believe he paid him for a while, then switch it to pay back to | |
415 | himself after some time has passed. The receiver will be alerted when that happens, but the | |
416 | sender hopes it will be too late. | |
417 | The receiver generates a new key pair and gives the public key to the sender shortly before | |
418 | signing. This prevents the sender from preparing a chain of blocks ahead of time by working on | |
419 | it continuously until he is lucky enough to get far enough ahead, then executing the transaction at | |
420 | that moment. Once the transaction is sent, the dishonest sender starts working in secret on a | |
421 | parallel chain containing an alternate version of his transaction. | |
422 | The recipient waits until the transaction has been added to a block and z blocks have been | |
423 | linked after it. He doesn't know the exact amount of progress the attacker has made, but | |
424 | assuming the honest blocks took the average expected time per block, the attacker's potential | |
425 | progress will be a Poisson distribution with expected value: | |
426 | ||
427 | q | |
428 | A = z--- | |
429 | p | |
430 | ||
431 | To get the probability the attacker could still catch up now, we multiply the Poisson density for | |
432 | each amount of progress he could have made by the probability he could catch up from that point: | |
433 | ||
434 | oo | |
435 | _____ | |
436 | \ / \ | |
437 | \ A^k e^-k | (q/p)^(z-k) if k<=z | | |
438 | | ---------- | | | |
439 | / k! | 1 if k>z | | |
440 | / \ / | |
441 | ~~~~~ | |
442 | k=0 | |
443 | ||
444 | Rearranging to avoid summing the infinite tail of the distribution... | |
445 | ||
446 | z | |
447 | _____ | |
448 | \ | |
449 | \ A^k e^-k / \ | |
450 | 1 - | ---------- | 1-(q/p)^(z-k) | | |
451 | / k! \ / | |
452 | / | |
453 | ~~~~~ | |
454 | ||
455 | Converting to C code... | |
456 | ||
457 | #include <math.h> | |
458 | double AttackerSuccessProbability(double q, int z) | |
459 | { | |
460 | double p = 1.0 - q; | |
461 | double lambda = z * (q / p); | |
462 | double sum = 1.0; | |
463 | int i, k; | |
464 | for (k = 0; k <= z; k++) | |
465 | { | |
466 | double poisson = exp(-lambda); | |
467 | for (i = 1; i <= k; i++) | |
468 | poisson *= lambda / i; | |
469 | sum -= poisson * (1 - pow(q / p, z - k)); | |
470 | } | |
471 | return sum; | |
472 | } | |
473 | ||
474 | ||
475 | ||
476 | ||
477 | 7 | |
478 | ||
479 | ||
480 | ||
481 | Running some results, we can see the probability drop off exponentially with z | |
482 | q=0.1 | |
483 | z=0 P=1.0000000 | |
484 | z=1 P=0.2045873 | |
485 | z=2 P=0.0509779 | |
486 | z=3 P=0.0131722 | |
487 | z=4 P=0.0034552 | |
488 | z=5 P=0.0009137 | |
489 | z=6 P=0.0002428 | |
490 | z=7 P=0.0000647 | |
491 | z=8 P=0.0000173 | |
492 | z=9 P=0.0000046 | |
493 | z=10 P=0.0000012 | |
494 | ||
495 | q=0.1 | |
496 | z=0 P=1.0000000 | |
497 | z=1 P=0.2045873 | |
498 | z=2 P=0.0509779 | |
499 | z=3 P=0.0131722 | |
500 | z=4 P=0.0034552 | |
501 | z=5 P=0.0009137 | |
502 | z=6 P=0.0002428 | |
503 | z=7 P=0.0000647 | |
504 | z=8 P=0.0000173 | |
505 | z=9 P=0.0000046 | |
506 | z=10 P=0.0000012 | |
507 | ||
508 | Solving for P less than 0.1%... | |
509 | ||
510 | P < 0.001 | |
511 | q=0.10 z=5 | |
512 | q=0.15 z=8 | |
513 | q=0.20 z=11 | |
514 | q=0.25 z=15 | |
515 | q=0.30 z=24 | |
516 | q=0.35 z=41 | |
517 | q=0.40 z=89 | |
518 | q=0.45 z=340 | |
519 | ||
520 | ||
521 | 12. Conclusion | |
522 | ||
523 | We have proposed a system for electronic transactions without relying on trust. We started with | |
524 | the usual framework of coins made from digital signatures, which provides strong control of | |
525 | ownership, but is incomplete without a way to prevent double-spending. To solve this, we | |
526 | proposed a peer-to-peer network using proof-of-work to record a public history of transactions | |
527 | that quickly becomes computationally impractical for an attacker to change if honest nodes | |
528 | control a majority of CPU power. The network is robust in its unstructured simplicity. Nodes | |
529 | work all at once with little coordination. They do not need to be identified, since messages are | |
530 | not routed to any particular place and only need to be delivered on a best effort basis. Nodes can | |
531 | leave and rejoin the network at will, accepting the proof-of-work chain as proof of what | |
532 | happened while they were gone. They vote with their CPU power, expressing their acceptance of | |
533 | valid blocks by working on extending them and rejecting invalid blocks by refusing to work on | |
534 | them. Any needed rules and incentives can be enforced with this consensus mechanism. | |
535 | ||
536 | ||
537 | ||
538 | ||
539 | ||
540 | 8 | |
541 | ||
542 | ||
543 | ||
544 | References | |
545 | ||
546 | [1] W. Dai, "b-money," http://www.weidai.com/bmoney.txt, 1998. | |
547 | ||
548 | [2] H. Massias, X.S. Avila, and J.-J. Quisquater, "Design of a secure timestamping service with minimal | |
549 | trust requirements," In 20th Symposium on Information Theory in the Benelux, May 1999. | |
550 | ||
551 | [3] S. Haber, W.S. Stornetta, "How to time-stamp a digital document," In Journal of Cryptology, vol 3, no | |
552 | 2, pages 99-111, 1991. | |
553 | ||
554 | [4] D. Bayer, S. Haber, W.S. Stornetta, "Improving the efficiency and reliability of digital time-stamping," | |
555 | In Sequences II: Methods in Communication, Security and Computer Science, pages 329-334, 1993. | |
556 | ||
557 | [5] S. Haber, W.S. Stornetta, "Secure names for bit-strings," In Proceedings of the 4th ACM Conference | |
558 | on Computer and Communications Security, pages 28-35, April 1997. | |
559 | ||
560 | [6] A. Back, "Hashcash - a denial of service counter-measure," | |
561 | http://www.hashcash.org/papers/hashcash.pdf, 2002. | |
562 | ||
563 | [7] R.C. Merkle, "Protocols for public key cryptosystems," In Proc. 1980 Symposium on Security and | |
564 | Privacy, IEEE Computer Society, pages 122-133, April 1980. | |
565 | ||
566 | [8] W. Feller, "An introduction to probability theory and its applications," 1957. | |
567 | ||
568 | ||
569 | ||
570 | ||
571 | ||
572 | ||
573 | ||
574 | ||
575 | ||
576 | ||
577 | ||
578 | ||
579 | ||
580 | ||
581 | ||
582 | ||
583 | ||
584 | ||
585 | ||
586 | ||
587 | ||
588 | ||
589 | ||
590 | ||
591 | ||
592 | ||
593 | 9 |