<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Moshe Shababo on Medium]]></title>
        <description><![CDATA[Stories by Moshe Shababo on Medium]]></description>
        <link>https://medium.com/@moshababo?source=rss-630140a9547e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*-vi-JAJTSoqGHycaMJ-gEA.png</url>
            <title>Stories by Moshe Shababo on Medium</title>
            <link>https://medium.com/@moshababo?source=rss-630140a9547e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 16:13:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@moshababo/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Hard-drive space as a tangible, scarce Sybil resistance resource: the PoST protocol]]></title>
            <link>https://medium.com/@moshababo/hard-drive-space-as-a-tangible-scarce-sybil-resistance-resource-the-post-protocol-3b62407fa4c6?source=rss-630140a9547e------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b62407fa4c6</guid>
            <category><![CDATA[cryptocurency]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[mining]]></category>
            <dc:creator><![CDATA[Moshe Shababo]]></dc:creator>
            <pubDate>Mon, 23 Dec 2019 13:24:41 GMT</pubDate>
            <atom:updated>2019-12-24T10:52:09.962Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wdWkmV98q9AsiISDlfyrLg.jpeg" /></figure><p>Proof of Space-Time (PoST) is a new cryptographic primitive, designed to replace Proof of Work (PoW) as a proof-of-resource-consumption scheme, and so as a Sybil-resistance mechanism for permissionless cryptocurrencies. It was introduced in 2016 by <a href="https://talmoran.net/">Tal Moran</a> and <a href="https://www.cs.bgu.ac.il/~ilanorv/">Ilan Orlov</a> in a paper titled “<a href="https://eprint.iacr.org/2016/035.pdf">Simple Proofs of Space-Time and Rational Proofs of Storage</a>.”</p><p>A PoST allows a prover to convince a verifier that they expended a certain amount of a “space-time” resource: a specific amount of space allocated over a specific time period, during which the space cannot be used for anything else. PoST requires significantly less energy than PoW, since the “difficulty” can be increased by extending the time period over which the space is allocated, without introducing additional ongoing computational work.</p><p>PoST is a two-phase protocol. In the first phase, the <em>initialization phase </em>(executed once), the prover commits to generate and store some pseudorandom data, derived from a specific seed. In the second phase, the <em>execution phase</em> (executed periodically), the prover proves that they still have access to the data at some particular point in time.</p><p>Unfortunately, the protocol does not allow a prover to prove<em> </em>they <em>stored</em> the data, since an adversary can instead store only the initial seed (which can be used to regenerate the data). To overcome this problem, generating the data involves computational work, which can be parameterized such that the cost of regenerating the data is much higher than the cost of simply storing it.</p><p>This leads to the definition of the PoST resource as a trade-off between space-time and computational work, where under reasonable cost assumptions, a rational user will always prefer to use the lower-cost space-time resource over computational work (while at the same time a non-rational user has greater cost and does not gain any advantage). It means that there may be a strategy which does not require a prover to expend space over time, but if the parameters are set correctly, this strategy will be significantly more expensive.</p><p>For this reason, using PoST in the context of a cryptocurrency, where profit is the main motive for participation, we can guarantee that rational users would prefer to use the space-time resource, so it can be claimed that the cryptocurrency is energy efficient. However, if the <em>initialization</em> cost became lower than the cost of storing the data due to fluctuation in the market price of compute power relative to storage, the protocol essentially devolves to PoW. To avoid that, a <em>market-based mechanism</em> can be used to determine the difficulty level, similar in spirit to the difficulty adjustment in PoW-based cryptocurrencies such as Bitcoin.</p><h3>PoST vs PoS</h3><p>Two very similar proposals for Proof of Space (PoS), with similar intentions, have been previously published (<a href="http://dx.doi.org/10.1007/978-3-662-48000-7_29">1</a>, <a href="http://dx.doi.org/10.1007/978-3-319-10879-7_31">2</a>). But unlike Proof of Space, the PoST definition takes into account amortization attacks (using the same space resource for different proofs), rationality of using the space-time resource over CPU work, and an explicit time element (ensuring that the space is committed for a fixed length of time). Moreover, PoST uses a different and much simpler technique, making use of the fact that we explicitly allow a space-time tradeoff, and only relies upon the security of cryptographic hash functions.</p><p>Unlike existing Proof of Space constructions, the computational difficulty of the PoST initialization phase can be adjusted without linearly increasing either the amount of space or the verification cost. Hence it is possible to use it to prove that a reasonable amount of storage has been committed over a long period of time. In addition, in the case of an adjustment in difficulty (due to CPU and storage market relative price fluctuation), PoST supports simple incremental difficulty adjustment — that is, already-initialized users only have to pay the marginal work cost between difficulty levels, instead of rerunning the entire initialization phase from scratch. A downside of PoST is that the prover must read its entire storage for every proof, so the algorithm requires linear time, while in Proof of Space this is not required, so the algorithm runs in polylog time. This makes Proof of Space suitable for producing proofs in short intervals (e.g., every 10 seconds), while PoST is suitable for long ones (e.g., weeks or even months).</p><h3>Construction</h3><p>To allow public verifiability, and to ensure that the data generated in the initialization phase is cheaper to store than to regenerate, generating this data must entail PoW. To avoid the prover having to send all of the data to the verifier, the prover doesn’t construct one large PoW, but rather a table containing many entries, where each entry is a PoW that can be independently verified.</p><h4>Phases</h4><ul><li><strong>Initialization —</strong> the prover performs computational work that results in pseudorandom data, generated with respect to a specific seed, organized as table entries. The seed may be a public key, so that an adversary which does not hold the corresponding private key cannot claim custody over the same data.</li><li><strong>Execution — </strong>the prover receives a challenge that cannot be predicted, reads (or recomputes) the entire data, and generates a proof in response to the challenge to prove that the data exists at the time of invoking the algorithm.</li></ul><p><strong>The execution phase can be repeated multiple times</strong> without rerunning the initialization phase. This point is critical, since the initialization phase requires work, while the execution phase is energy efficient (i.e., it requires relatively few computational steps). Thus, although using PoST to generate a single proof does not give any advantage over PoW, using it to generate many such proofs allows the work required during the initialization phase to be amortized over all of the proofs, which makes the construction energy efficient.</p><h4>Proving</h4><p>Proving occurs on every iteration of the execution phase, as a response to a received challenge<em>, </em>and at the end of the initialization phase, when the challenge is empty. This makes proving interactive between the prover and a verifier, except during the initialization phase, where the challenge is fixed (i.e., empty) and non-interactive.</p><p>The <em>time</em> element of the space-time resource is the elapsed time between successive phases of generating, and chaining, the PoST: the initialization phase, or the previous execution phase, and the latest execution phase. Unlike the <em>space</em> element, the time element is not publicly verifiable (i.e., depending solely on the content of the proof), but rather requires a verifier to measure the elapsed time between phases. However, it can be made non-interactive and publicly-verifiable by adding a Proof of Elapsed Time (PoET) to the construction.</p><p>To generate a proof, the prover commits to the data by constructing a Merkle tree whose leaves are labeled with the table entries. Each leaf label contains concatenated group of entries, and each internal node’s label is the output of a hash function on the concatenation of its children’s labels, salted with the challenge. This forces the prover to commit to its knowledge of the leaves <strong>at the time it generates the proof</strong>.</p><p>Once constructed, the prover needs to provide the opening of the Merkle tree commitment (Merkle proofs, i.e., Merkle paths to the root of the tree) for a random set of 100 entries. The indices for these entries can be selected by the verifier as a response to the prover commitment (Merkle root). But this option isn’t used, because it can easily be made non-interactive by using the <a href="https://en.wikipedia.org/wiki/Fiat%E2%80%93Shamir_heuristic">Fiat-Shamir heuristic</a>: the Merkle root hash is used to deterministically derive the random set of indices.</p><p>The prover cannot merely generate the data for the selected entries and skip all others, because they are forced to commit to the entire table and to a specific Merkle root before the indices are known. If they happened to “skip” an entry which will end up being selected, the proof would be invalid. This means that the prover is forced to either generate a large fraction of the table, or spend a lot of computational work trying to find a Merkle root that will produce a “good” set of indices. By setting the parameters correctly, we ensure that in the second case the amount of work the prover must do is more than the initialization cost.</p><p>The publicly-verifiable proof contains the Merkle root, the data for the selected entries from the PoW initialization phase, and their commitment openings (Merkle proofs). Common labels from the 100 distinct Merkle paths are eliminated to reduce proof size.</p><h4>Verifying</h4><p>The verifier first derives the same pseudorandom set of indices for 100 entries from the Merkle root, similarly to the prover, using the Fiat-Shamir heuristic. Then she computes the Merkle root from the commitment openings to verify that it matches the expected root value. Then she extracts the chosen entries from the proven leaves (each containing a group of entries), and verifies that the PoW is valid for their respective indices and seed.</p><h3>Why generic PoW isn’t sufficient</h3><p>Generating the data in the initialization phase involves computational PoW, but the standard definitions of PoW do not rule out an adversary that can store a small amount of data and use it to regenerate the entire data set with very low computational overhead. Thus, to ensure the prover must indeed store the entire data set, the protocol is constructed using the abstract notion of <em>incompressible proof-of-work</em> (IPoW), a more restrictive variant of PoW.</p><p>The most popular form of PoW, the Hash-Preimage PoW, was introduced in <a href="http://www.hashcash.org/papers/hashcash.pdf">Hashcash</a> and is being used in Bitcoin and Ethereum. It involves finding a certain value (called a nonce) that, when added to some fixed data (e.g., the contents of a block, known here as the <em>preimage</em>) and hashed, satisfies a certain difficulty criteria. This is not yet an incompressible PoW: although compressing the hash output is impossible, compressing the preimage isn’t. By constructing the optimal compression scheme and instructing honest users to use it, it can be turned into IPoW.</p><p>However, the Hash-Preimage IPoW sets an upper limit on the amount of storage we can fill for a given initialization cost (number of hashes): with a predetermined sequence of values, one just needs to store a single bit for each item, indicating whether the item is a “good” preimage or not. Thus, due to the compression scheme, each hash invocation can “contribute” at most a single bit to the total storage.</p><h4>The Partial-Hash IPoW</h4><p>In order to be able to fill more space without increasing the initialization cost, a different IPoW is needed. <em>Partial-Hash IPoW</em> is a simple solution where the amount of work for every IPoW is always a single hash invocation, but the amount of storage the hash output would fill is adjustable (from 1 bit up to the entire output length). It is considered incompressible because, although the hash input might be smaller than the storage the output fills, the required CPU work for regenerating the output cannot be made cheaper, since it is already just a single hash invocation.</p><p>Verification of the Partial-Hash IPoW also requires a hash invocation, which makes it equal in cost to the proof generation. This makes the Partial-Hash IPoW highly non-desirable for any construction besides ones in which the prover proves many distinct IPoWs, while the verifier is required to verify only a small portion of them — as in PoST.</p><h3>PoST deterministic nature</h3><p>The entire PoST construction, from the Partial-Hash IPoW for generating the data to the Merkle tree commitment and openings, is completely deterministic: the number of required hash invocations for any given space-time resource is known in advance. This makes PoST different in nature from PoW, where successfully generating a proof is probabilistic. In contrast, PoST allows us to guarantee that anyone spending the required resources is eligible to produce a valid proof. Thus PoST can be used to replace the lottery-based mechanism for block production (and so for rewards) in PoW with a deterministic one, and doesn’t make leader-election a required part of the consensus protocol. This means that PoST can be used to create a race-free cryptocurrency protocol.</p><h4>Related links</h4><ul><li>Tal Moran presentation: <a href="https://www.youtube.com/watch?v=Hkdm0dLKZQI">https://www.youtube.com/watch?v=Hkdm0dLKZQI</a></li><li>Spacemesh implementation: <a href="https://github.com/spacemeshos/post">https://github.com/spacemeshos/post</a></li></ul><p>Special thanks to Lane Rettig, Barak Shani, Tal Moran and Yael Hoffman for feedback and editing!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b62407fa4c6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Proof-of-Work: Female Seduction, Good Name for Kings, Combatting Junk Mail and Crypto-Anarchism]]></title>
            <link>https://medium.com/@moshababo/proof-of-work-female-seduction-good-name-for-kings-combatting-junk-mail-and-crypto-anarchism-3f780aff301f?source=rss-630140a9547e------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f780aff301f</guid>
            <category><![CDATA[bitcoin-mining]]></category>
            <category><![CDATA[satoshi-nakamoto]]></category>
            <category><![CDATA[proof-of-work]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Moshe Shababo]]></dc:creator>
            <pubDate>Sat, 20 Jan 2018 20:17:34 GMT</pubDate>
            <atom:updated>2019-11-12T14:10:47.215Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/430/1*WlZCiQ5C6Emp6UmurNvJUw.jpeg" /></figure><p>Let’s say, hypothetically, that you would like to torture someone.</p><p>One possible way, and perhaps one of the cruelest, would be to simply make him work, but to give his labor a character of complete uselessness. Just make him do something that has no utility, no purpose, and no meaning. And to make it even worse, make it be something really stupid that he cannot even strive to do skillfully.</p><p>Assuming you do not have the resources nor the will to continuously watch him, his work must produce something that will serve as a measurement of the amount of effort that he has exerted. In other words, his work must produce a proof-of-work.</p><p>To achieve this, we can utilize basic Probability concepts. Let’s make him toss a coin. Again, and again, and again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*fddAn99U_99ViUvJ18gq5A.jpeg" /></figure><p>His coin tosses will be in a set of rounds, and we’ll assume that we can always have a record of the latest round. This single round will provide sufficient evidence as to the amount of effort he has exerted through the entire day.</p><h4>Probability 101</h4><p>When you flip a fair coin, the chance of getting heads or tails is 1 to 2. If so, then the chance of getting 2 consecutive heads is 1 to 4. This means that it will take, on average, 4 attempts.</p><p>Same for getting 5 consecutive heads. The chances are 1 to 32, and so will require about 32 rounds, which is a total of 160 coin tosses.</p><h4>The Daily Quota</h4><p>If we received a record of 5 consecutive heads, we can know for sure that the amount of work that someone put into this achievement is equivalent to about 32 rounds - 160 tosses. Assuming that each toss takes about 2 seconds, it means that <strong>this is a proof-of-work of around 5 minutes of coin tossing.</strong></p><p>To make this a bit harder, we can require our useless-work machine to show us a record of a round of 12 consecutive heads. This will require about 4,096 attempts - 49,152 coin tosses. This takes about 13.5 hours. Just enough to keep our man alive for the next day.</p><h3>Introduction: Proof-of-Work</h3><p>Few things can upset a human being more than useless and meaningless work. And the idea of using this work merely to produce a proof that it happened is even more outrageous.</p><p>We live in a world of scarce resources, and so we have evolved as highly-utilitarian creatures. <strong>We cannot afford useless work, because it can kill us. </strong>But beyond the boundaries of our perception, in a limitless world of cyclic transformations, the so-called “useless” has some great features.</p><blockquote>“So you want to live ‘according to nature?’ Oh, you noble Stoics, what a fraud is in this phrase! Imagine something like nature, boundlessly extravagant, boundlessly indifferent, without purpose or consideration, without mercy or justice, fertile and barren and uncertain at the same time, imagine to yourselves indifference as a power — how could you live according to this indifference? <strong>Living — isn’t that wanting specifically to be something other than this nature?</strong>” (<em>Nietzsche, Beyond Good and Evil, paragraph 9)</em></blockquote><p>What would sound like sheer blasphemy to us is in fact an important feature for the evolution of life on this planet. Our wasteful Mother Nature chose Proof-of-Work in order to establish an honest signaling mechanism in a context of conflicting interests, such as in sexual selection. And in this signaling mechanism one does not merely send a message. One sends a proof.</p><h3>Female Seduction and The Handicap Principle</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*mhCgpMI1RqVSadh3tgJFlQ.jpeg" /></figure><p>The Handicap Principle is a hypothesis originally proposed in 1975 by Israeli biologist <a href="https://en.wikipedia.org/wiki/Amotz_Zahavi">Amotz Zahavi</a>. It offers an explanation to one of the most troublesome problems of Darwin’s Theory of Evolution.</p><p>Darwin explained that the heavy antlers of the male deer, and the long, extravagantly-colored tails of the male peacock fulfill an important role of attracting females, i.e., in sexual selection. <strong>On the contrary, it is also known that these characteristics directly threaten their survival.</strong></p><p>If you are a peacock that is displaying its beauty to a willing mate, you are more likely to be eaten by a predator. And if you are a deer with huge antlers stuck to your skull, you are more likely to be slow and cumbersome, as well as weakened by utilizing crucial amounts of nutrients to grow them every year.</p><p>If so, then how come natural selection doesn’t eradicate these kinds of behaviors, but rather encourages their distribution? Darwin did not have a reasonable explanation to <strong>why females prefer males that are more likely to be killed.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Qk2iE4UzJLFhHDwg7L8Zw.jpeg" /></figure><p>Females wish to select the most potent males around, while males, under selective pressure, wish to signal their high-fitness levels. Under these circumstances, a problem arises: Why wouldn’t the males lie? How can the females trust their signaling?</p><p>According to the Handicap Principle Hypothesis, <strong>the only way to secure communication signals is to put a high price tag on them</strong>. The more they cost, the greater their credibility. So by paying the highest possible price, by acting in a way that hurts your fitness, your chances of survival, and still managing to survive and prosper, you are proving yourself to be what you claim: one of the strongest males around.</p><p>That’s why for human males, whose potency is mostly associated with their socioeconomic status, one of the most successful ways of attracting females <strong>is</strong> <strong>to show them that you own some very expensive stuff.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*mxxWUAS-Nop7FwLzLMJXhA.jpeg" /></figure><p>By showing up in public with a shiny new Rolls Royce, females will be convinced, beyond any doubt, that you are a part of the so-called “high-fitness” club.</p><p>As a high-socioeconomic-status male, you are able to own this extravagant luxury item, and signal to everyone that you are a potential mate from the highest tier.</p><p>Furthermore, the higher your fitness, the lower the price that you pay. A wealthy man that recklessly spends a fortune on a fancy car does not put himself at great risk, just like a healthy peacock that carries a heavy tail. But for the weaker ones, spending the same amount of resources will cause a greater impact, which will put them in a great danger, and so they are less likely to do so.</p><p>That’s why this kind of behavior is not considered to be a mere claim to high-potency, but rather a proof. <strong>It’s considered to be true</strong> <strong>because otherwise it would be a very expensive and dangerous lie, </strong>one that none can withstand.</p><h3>Good Name For Kings</h3><p>But Proof-of-Work is not limited to horny males. It’s also often implemented by megalomaniac Kings, in their quest for eternal glory.</p><p><em>“A good name for Kings is achieved by means of lofty buildings”</em> said the 16th- century Mughal historian Muhammad Arif Qandhari.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*1sS4tF7oCOjCRlQCq7KamQ.jpeg" /><figcaption>Taj Mahal. The Mughals greatest claim-to-fame</figcaption></figure><p>And indeed, different cultures come and go, but the ones we remember, the ones that we know of and cherish, are the ones who left behind substantial evidence — proof — of their might. And there ain’t no better proof than some very fancy buildings, ones that can cause you to stand in awe hundreds and thousands of years later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ul_JZ7n-eE2cWbWOQ8MedQ.jpeg" /></figure><p>That’s why for many rulers, wishing to demonstrate their tremendous wealth and power, one of the most favorable enterprises was the commission of various monuments, which are in particular designed to embody and confirm their wealth and strength.</p><p>These monuments, among the greatest heritage of our civilization, serve as proof — a Proof-of-Work — for all future generations. They stand tall and testify: Someone great built that. Someone who could spare the expense. Someone that was so bold, mighty and powerful. Behold that man, Behold his people. For thou art nothing but sheer dust to their feet.</p><h3>Combatting Junk Mail</h3><p>In the early days of the Internet, a new use-case for Proof-of-Work was starting to unfold: <strong>Cyber Security</strong>.</p><p>In 1993, two computer science researchers, <a href="https://en.wikipedia.org/wiki/Cynthia_Dwork">Cynthia Dwork</a> and <a href="http://www.wisdom.weizmann.ac.il/~naor/">Moni Naor</a>, first <a href="http://www.wisdom.weizmann.ac.il/~naor/PAPERS/pvp.ps">presented</a> the idea that a proof of some kind of computational effort can be used<strong> </strong>to<strong> control access to a shared resource</strong>.</p><p>That shared resource was the Internet and its new exciting application: email. By delivering on the promise of being easy to use and cheap, it inherited the intrinsic problem of these characteristics: abuse. The most common form was commercial spamming, where a user would send millions of emails in order to make a profit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/991/1*GSuc8tdp8lNdTOSL8jOfFA.png" /></figure><p>Abuse of a public resource usually calls for two types of traditional solutions: legislation and usage fees. But in the case of the Internet, these would be counter-productive to the whole enterprise. The goal then was to restrain the ability to send email in a way that would deter spammers, but would not interfere with other users.</p><p>The suggestion was to introduce a new type of payment — <strong>a payment in burnt CPU cycles</strong>.</p><p>The idea was that the mail system would require each sender to solve a computational problem, which has a price tag — <a href="https://en.wikipedia.org/wiki/CPU_time">CPU time </a>— so that this micro-cost and its imposed latency would make junk-mail infeasible, but would hardly be noticed under normal usage, and so would effectively throttle the abuse of unmetered Internet resources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*B6qfZyyB-nCQtTl8EmvRYw.jpeg" /></figure><p>These computational problems, called Price Functions, presented the idea of moderately hard functions with adjustable difficulty (a selectable amount of work to compute), that have no known evaluation shortcuts and are easy to verify by any third-party.</p><p>In 1997, <a href="https://en.wikipedia.org/wiki/Adam_Back">Adam Beck</a> <a href="http://hashcash.org/papers/announce.txt">suggested</a> an implementation for the so-called Price Functions (also known as CPU Pricing Functions, CPU Cost Functions, Client Puzzles or Computational Puzzle), by using partial hash collision puzzles that could be made arbitrarily expensive to compute.</p><p>A further technical explanation to this idea can be found here: <a href="https://medium.com/@moshababo/an-appendix-partial-hash-collisions-cf1dd54785df">An Appendix: Partial Hash Collisions</a>.</p><h4>Hashcash: a Non-Interactive, Publicly Auditable, Trapdoor-Free Cost Function With Unbounded Probabilistic</h4><p>A few important characteristics of partial hash collisions made Hashcash an ideal candidate for a digital Proof-of-Work system:</p><p><strong>Non-Interactive: </strong>The challenge or the difficulty level does not need to be controlled or sent over. Anyone can pick his own challenge and present his solution.</p><p><strong>Publicly Auditable: </strong>The solution can be easily verified by anyone, without any additional information needed.</p><p><strong>Trapdoor-Free: </strong>The only way to find a solution to the challenge is by brute force: try random values until one of them succeeds. Information that can make this computation less expensive does not exist. Any found solution is not reusable, because it is applied to a specific context.</p><p><strong>Unbounded Probabilistic: </strong>The effort for finding a solution to a challenge is predictable, based on probability. Although in theory it can take forever to compute, the chances of it taking longer or shorter then expected tends to 0.</p><p>This makes Hashcash very similar to the coin-tossing torture scheme that was presented at the beginning of this article, wherein the set of rounds are equivalent to brute forcing the solution by trying different random values (each represents one complete coin-toss round), and wherein the consecutive heads requirement is the difficulty level of the hash collision length.</p><p>Hashcash was designed to have practical usage, mainly to limit email spams and <a href="https://en.wikipedia.org/wiki/Denial-of-service_attack">DoS attacks</a>, but in practice was hardly used because it didn’t solve these real-world problems efficiently for <a href="https://en.wikipedia.org/wiki/Hashcash#Advantages_and_disadvantages">various reasons</a>.</p><p>Its current main usage, and its biggest claim-to-fame was when Satoshi Nakamoto picked it up in order to implement a <a href="https://en.wikipedia.org/wiki/Trusted_timestamping#Decentralized_timestamping_on_the_blockchain">Distributed Timestamp Server</a>, the first and foremost component of his new peer-to-peer electronic cash system.</p><h3>Crypto-Anarchism</h3><p>In 2007, under the pseudonym Satoshi Nakamoto, a 21st-century Prometheus was stirring a new piece of software that would emancipate mankind from the occupation of the Federal Reserve Bank. In 2008, he sent an email to<a href="https://en.wikipedia.org/wiki/Cypherpunk#Origin_of_the_term,_and_the_Cypherpunks_mailing_list"> the Cypherpunks mailing list</a> announcing his <a href="https://bitcoin.org/bitcoin.pdf">white paper</a> for a new electronic cash system which is fully peer-to-peer. In 2009, <a href="http://www.zorinaq.com/pub/bitcoin-0.1.0.rar">Bitcoin v0.1 source code</a> was released.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*RqSSXptr4Hnrdvu3yOWeHw.jpeg" /><figcaption>Prometheus. stole fire from the Gods and gave it to mankind. Was punished later</figcaption></figure><p>The reception was skeptical. Since the 1990s, Cypherpunks were playing with the idea of creating a community which is defined purely by voluntary cooperation of its participants, and cannot be taxed or regulated by a threat of force. A decentralized, efficient medium of exchange was needed for the cornerstone of this utopia, but it was not clear, even in theory, how it could work.</p><p>While <a href="https://en.wikipedia.org/wiki/Public-key_cryptography">public-key cryptography</a> was known to guarantee secure ownership and transfer of an digital asset, allowing any two parties to directly transact with each other, it couldn’t solve one major problem:<strong> double-spending.</strong></p><p>Most digital cash systems solved this by delegating control to a central authority which has a global view of all currency circulation, and so could easily serve as a clearinghouse to settle all transactions. This solution was unacceptable under the cypherpunks oath of New World Order, where <strong>central authorities shouldn’t merely be destroyed, but should ultimately be rendered obsolete.</strong></p><p>Based on <a href="https://en.wikipedia.org/wiki/Nick_Szabo">Nick Szabo</a>’s Theory of Collectibles, attempts were made to try to mimic the qualities of non-fiat currencies, such as <a href="https://en.wikipedia.org/wiki/Shell_money#Oceania_and_Australia">shell money,</a> gold and silver, into a digital cash system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HYtEzucP1V42GRQXH9oWSA.jpeg" /><figcaption>Bridal jewelry dolphin teeth shell money, Solomon Islands (Photo by Wade Fairley)</figcaption></figure><p>Precious metals and other Collectibles are not dependent on central government mints and their anti-counterfeiting measures in order to function as a transferable and durable store of value. Instead, the high cost of their creation, an initial complete waste of effort, secures their limited supply and gives them their monetary value that can be used as a medium of exchange. <strong>In other words, these currencies are secured by a natural Proof-of-Work mechanism</strong>.</p><p>But securing the circulation supply of a digital currency by the means of a Proof-of-Work system, similar to Hashcash, was not enough. A solution for the double-spend problem, which does not exist with tangible currencies, was still missing.</p><h4>Distributed Consensus</h4><p>In order to enable the payee of an digital asset to verify that its owner, or its previous owners, did not double-spend it, he must be aware of all previous transactions. This means that all the different participants in the network need to agree on one single history of transactions and its chronological order, without introducing a trusted central authority.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*DhE5ICqFYfC97TYRFrzObw.jpeg" /><figcaption>Peer-to-peer network</figcaption></figure><p>Each transaction must be publicly announced, but not all participants in the network are directly connected to each other, so it must go through a few intermediaries in order to propagate the entire network. Participants have no identities, and thus cannot be trusted. In addition, the network is unreliable, and cannot provide a notion of global time or chronological order.</p><p>Achieving a consensus under these kind of conditions had no solution, and in fact was <a href="https://groups.csail.mit.edu/tds/papers/Lynch/jacm85.pdf">proven</a> to be impossible. <strong>But then Satoshi came, and said that he had a solution.</strong> And the solution was: Proof-of-Work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*2x7LH45kcUG3gvkkeKmuQQ.gif" /></figure><p><strong>Yes, the same Proof-of-Work that controls the issuance of new coins into circulation can be used to secure the network against double-spending.</strong></p><p>This is how it works:</p><p>A digital currency system must handle a few different procedures: issuance of new coins, making them into something that people valued, and continuously updating the list of transactions.</p><p><strong>Satoshi’s great discovery, the one that will put him in the history books as one of the greatest catalyzers of turning a marginal counter-culture into a global phenomenon, was simply to combine them all into a single process.</strong></p><p>New coins are created within every new block, which contains a bundle of new transactions to be added to the ledger. The block also contains a solution for a difficult-to-solve computational problem — a proof-of-work— which resembles the difficulty of mining gold, and gives the newly created coins their initial monetary value.</p><p>The solution for the computational problem is so difficult, that it is expected for the entire network, while working on it <strong>together</strong>, to take about 10 minutes to find it.</p><p>Each block is timestamped, and each timestamp includes the timestamp of the previous block, forming an ongoing chain of blocks, the blockchain, which is a computational proof of the chronological order of the blocks. In addition, the blockchain has one special quality: <strong>It’s a chain of a new digital asset, and it’s also a chain of the list of transactions.</strong></p><p><strong>Here’s the punch line: </strong>By combining these two chains together, the list-of-transactions chain inherits the Proof-of-Work from the newly-created-coins chain, and thus, by becoming a chain which represents a quantitive Proof-of-Work, it can represent levels of collaborative effort and thus levels of consensus.</p><p>It means that although at any given time <a href="https://medium.com/@moshababo/forks-in-the-blockchain-discrepancies-between-competing-chains-93a75f96decb">multiple competing chains might be circulating in the network</a>,<strong> </strong>the longest chain has a special quality: It could only have been created by the majority of the parties. By containing the greatest Proof-of-Work, it represents the accumulation of the collaborative effort of the majority of the network (the largest CPU pool).</p><p><strong>This makes up the solution for achieving a global-scale Distributed Consensus, and thus solves the double-spend problem. </strong>The longest chain is the anchor by which all the participants of the network can accordingly synchronize. It is the safest and most reliable source of truth, being the most expensive one to create. It is, by definition, the Consensus Chain.</p><h4>The End of the Matter</h4><p>Satoshi Nakamoto was the first to introduce a Distributed Consensus Algorithm that managed to support a global-scale, fully-decentralized system, which operates under the conditions of an unreliable network and complete anonymity.</p><p>He managed to do so in the following context:</p><ol><li>The system is a currency system and thus can offer financial incentives and compensation, new coins and transaction fees, for the Proof-of-Work efforts that are used to secure the network.</li><li>Immutable Consensus can acceptably be reached over long-time scales, up to 1 hour, under a Probabilistic Guarantee.</li></ol><h3>Conclusion</h3><p>Next time you hear someone complain that Proof-of-Work is an expensive and wasteful mechanism, you can tell him: Sir, it’s not a bug. It’s a feature. One of the most useful features ever to exist.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HS0wpfERJPIHWwnDRoMLTA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f780aff301f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An Appendix: Partial Hash Collisions]]></title>
            <link>https://medium.com/@moshababo/an-appendix-partial-hash-collisions-cf1dd54785df?source=rss-630140a9547e------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf1dd54785df</guid>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[proof-of-work]]></category>
            <category><![CDATA[bitcoin-mining]]></category>
            <category><![CDATA[cryptography]]></category>
            <dc:creator><![CDATA[Moshe Shababo]]></dc:creator>
            <pubDate>Sat, 20 Jan 2018 20:13:51 GMT</pubDate>
            <atom:updated>2018-01-20T20:19:56.093Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This is an appendix to the article — </em><a href="https://medium.com/@moshababo/proof-of-work-female-seduction-good-name-for-kings-combatting-junk-mail-and-crypto-anarchism-3f780aff301f"><strong>Proof-of-Work: Female Seduction, Good Name for Kings, Combatting Junk Mail, and Crypto-Anarchism</strong></a></p><h4>Cryptography 101</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*_Ev-1EYxlG4i8VOoJd5riQ.png" /></figure><p>A hash function is a function that takes any input and produces a fixed-size output, with an efficient computing procedure.</p><p>A cryptographic hash function is a hash function that has the following properties, which make it suitable for use in cryptography:</p><ul><li><strong>Collision Free</strong>: Nobody can find two inputs which produce the same output.</li><li><strong>Hiding</strong>: Given the output, nobody can find the input.</li><li><strong>Puzzle Friendly</strong>: If someone wants to find an input that produces a specific output, there isn’t any better way to find it except by trying many random inputs.</li></ul><h3>Partial Hash Collisions Workshop</h3><p>Adam Back’s suggestion was to use a cryptographic hash function, SHA1, in order to impose a costly computation puzzle on a chosen text. Consider that you are sending an email, so it’s header contains some information which is relevant only for him. For example: it’s timestamp and the recipient email address.</p><pre>|180108195109:<a href="/service/mailto:cypherpunks@toad.com">cypherpunks@toad.com</a>|</pre><p>This header, like any other string, has a fixed-size deterministic SHA1 output, which can be easily calculated by anyone, at any time. We can get it by running the following line in a Mac/Linux terminal:</p><pre>echo -n &quot;|180108195109:cypherpunks@toad.com|&quot; | shasum -a 1</pre><pre>Output: ddd7b8a88ce02a4c42df3ac2d8f1b47304cb4191</pre><p>When we are imposed with a challenge of sending a header whose SHA1 output starts with a zero, we must change the header string in order to produce a different output, because for the current header we got an output which starts with “d”. Any small change that we make to the header will result in an entirely different SHA1 output.</p><p>Because we don’t want to change the header properties (the timestamp and the recipient address), we can instead append some random characters to it, which have no meaning in the header’s scheme.</p><p>The SHA1 output string is represented in hexadecimal digits, which is a 16-base number system (0–9 + a-f), so the chances of getting a specific digit is 1 in 16, and so it will require 16 attempts on average.</p><p>In order to avoid doing it manually, we can write a simple JS snippet that will effectively iterate over an incremented number, a nonce, append it to the header, and check if by doing so its SHA1 output starts with a zero.</p><pre><strong>const </strong>sha1 = require(&#39;sha1&#39;);</pre><pre><strong>const </strong>header = &#39;|180108195109:cypherpunks@toad.com|&#39;;<br><strong>let </strong>nonce = 0;</pre><pre><strong>while</strong>(<strong>true</strong>) {<br>  nonce++;<br>  <strong>const </strong>hash = sha1(header + nonce);<br>  <strong>if</strong>(hash.startsWith(&#39;0&#39;)) {<br>    console.log(nonce);<br>    break;<br>  }<br>}</pre><p>Executing this script tells us that if we append the nonce “13” to the header, we will get our desired result. It also tells us that it took 13 attempts to find that nonce. We can now easily verify it by running:</p><pre>echo -n &quot;|180108195109:cypherpunks@toad.com|13&quot; | shasum -a 1</pre><pre>Output: 0e9e24596acad45e6eb0c04e4851e016a397d465</pre><p>For each consecutive zero in the required hash collision, the chances of getting a successful SHA1 output drop in a rate of 1 out of 16. That’s because each hexadecimal digit represents an aggregation of 4 binary digits, and for each consecutive binary digit the chances drops to a rate of 1 out of 2.</p><p>If we are imposed to send a header with 5 leading zeros SHA1 output (or any other specific sequence of 5 numbers), we can expect that finding the right nonce will take around 1,048,576 attempts. To find it, we can change the script accordingly, so it will look for a hash which starts with “00000” instead of just “0”.</p><p>If we execute it , we get the nonce “2465530”, which can be easily verified:</p><pre>echo -n &quot;|180108195109:cypherpunks@toad.com|2465530&quot; | shasum -a 1</pre><pre>Output: 000004eb48d8947bc63d0abc2604cea779cdad7a</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf1dd54785df" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Forks in the Blockchain: Discrepancies Between Competing Chains]]></title>
            <link>https://medium.com/@moshababo/forks-in-the-blockchain-discrepancies-between-competing-chains-93a75f96decb?source=rss-630140a9547e------2</link>
            <guid isPermaLink="false">https://medium.com/p/93a75f96decb</guid>
            <category><![CDATA[hard-fork]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[decentralization]]></category>
            <category><![CDATA[consensus]]></category>
            <dc:creator><![CDATA[Moshe Shababo]]></dc:creator>
            <pubDate>Fri, 29 Dec 2017 08:15:39 GMT</pubDate>
            <atom:updated>2017-12-30T11:36:53.146Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*10eUX1GKEWispAQu9mDiuA.png" /></figure><blockquote>“Satoshi Nakomoto’s main invention is the decentralized mechanism for <strong>emergent consensus</strong>. Emergent, because consensus is not achieved explicitly — there is no election or fixed moment when consensus occurs. Instead, consensus is an emergent artifact of the asynchronous interaction of thousands of independent nodes, all following simple rules.”</blockquote><blockquote><em>~ Andreas Antonopoulos, Mastering Bitcoin</em></blockquote><p>When you cannot, or simply<strong> </strong>choose not to<strong> </strong>trust any form of central authority, you are positioned in a new paradigm of trust where one cannot simply ask an oracle — a centralized service — about the current state of the system. Instead, the consensus becomes merely an abstract notion of what will <strong>eventually</strong> become accepted by the network.</p><p>The blockchain is a ledger data structure which is replicated across an unreliable network, and contains the records of all transactions. It is being constantly updated in a distributed manner, by different nodes, with new accounting data. Each update (a new block) needs some time in order to propagate, so at a given point the blockchain cannot be fully consistent across the entire network. The consensus protocol can only guarantee the emergence of a consensus over long time scales.</p><p>For this reason, a blockchain transaction can be confirmed only by the magnitude of a probability, and can never be 100% fully confirmed. At any given time, there may be multiple valid chains (versions of the blockchain) competing in the network, so different nodes might have different perspectives on the history of transactions. This condition, called a fork, can happen on a daily basis. It may be triggered by one of the following reasons:</p><ol><li>Race Conditions</li><li>Incompatible Change in the Consensus Rules (Hard Fork)</li><li>51% Attack</li></ol><p>An Open Blockchain Network has the same fundamental characteristics of the Internet: decentralized, open, border-less, permission-less.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*owOTg4t3x0fOAD15HL6eFA.png" /><figcaption>Concentration of bitcoin nodes around the world. Some of them are miners (bitinfocharts.com)</figcaption></figure><p>Miners are special types of nodes in the network which are competing with each other in order to update the ledger, by creating the next valid block in the chain. They are doing so by attempting to solve a difficult hash puzzle.</p><p>When one of them manages to find a solution to the hash puzzle, it constructs the new block’s header, and propagates it to the network. Nodes gradually receive the block, validate it, and add it to their local copy of the blockchain. For mining nodes, receiving a new block means that they have lost the race, and so they immediately begin to compete for the next block, by attempting to extend the one they received.</p><p>Now imagine two different miners, on the opposite sides of the globe, working on the hash puzzle. <strong>Miner A</strong> succeeds at some point, and starts propagating his new valid block to the network. In the meanwhile, <strong>Miner B</strong> also succeeds, and is doing the same, with his own new valid block.</p><p>This results in a Split Network — some of it which has accepted and propagated Miner A’s block (because they heard about it first), and some which accepted and propagated Miner B’s block. This scenario creates two equally valid chains, which will now compete with each other.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/1*s7ey1rrUeXsqXcPqwbR0Ww.jpeg" /><figcaption>Competing chains</figcaption></figure><p>Two different sides of the network now hold two different chains, and attempt to extend them further. At some point, some miner will solve the hash puzzle, and will propagate his next new valid block. He may be arbitrarily on either side of the network — so either he will extend Miner A’s block, or Miner B’s.</p><p>Let’s assume he’s on Miner B’s side.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/1*-FPTcp-YbbR2xVml2o0-og.jpeg" /><figcaption>Competing chains</figcaption></figure><p>When Miner B’s side receives the new block, they continue as usual — extending their existing chain, and start working on the hash puzzle for the next block. But when Miner A’s side receive that block, they realize that they were working on the wrong chain, because <strong>they just heard about a longer chain</strong>.</p><blockquote>“The ‘main chain’ at any time is whichever valid chain of blocks has the most cumulative Proof-of-Work associated with it. Under most circumstances this is also the chain with the most blocks in it” <em>~ Mastering Bitcoin</em></blockquote><p>Bitcoin’s Consensus Protocol offers a very simple mechanism on how to resolve discrepancies between competing chains, and achieve a network-wide consensus: nodes will always converge on the longest valid chain, which represents the greatest cumulative work, for it is self-evident that it is the one which required the greatest hash power, and so it is, by definition, the consensus chain (in a world in which consensus is being voted for by hash power).</p><p>Miners that encounter a longer chain will immediately converge with it. If not, they put themselves at risk of not being in the consensus, and working on a minority chain, which will probably result in them losing all chances to gain any compensation for their expensive mining efforts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/1*m1U2h5LBzeb6Y6ZW-fnvGA.jpeg" /></figure><p>The Consensus Protocol solves Race Conditions scenarios by offering an Eventual Convergence Model that takes about 10 minutes (the average time for the creation of a new block). This form of <strong>Accidental Fork</strong><em> </em>in the blockchain might happen daily, and is primarily triggered by latency of any kind — whether it’s on the network (communication between nodes), or in the nodes themselves (the block validation processing time).</p><p>Scenarios in which an Accidental Fork will be extended further, into two or even three consecutive blocks are rare. In order for the fork to grow longer, Race Conditions need to happen consecutively, in a way that neither of the sides overtake the other one by becoming the longest chain. The chances of this happening get exponentially smaller as the chain grows longer.</p><p>From this comes the notion of Transaction Confirmations, which represent the number of blocks that have been created after, and including, the block which contains the transaction. The higher it is, the more likely that the transaction will remain on the consensus chain. Six confirmations, which take about one hour on average, are considered to be the highest means of security that is reasonable to use, in a low-trust, high-risk transaction.</p><p>If this is so, how come, on March 11, 2013, starting at block 225430, <a href="https://bitcoinmagazine.com/articles/bitcoin-network-shaken-by-blockchain-fork-1363144448/">the bitcoin network experienced a <strong>24-block</strong> fork?</a></p><p>It obviously didn’t happen from a Race Condition, which can hardly create a 3-block fork. In that famous incident, it happened for a different reason: a software update, a change in the implementation details, which turned out to be non-compatible due to a bug, and thus caused an unintentional Hard Fork.</p><p>In a Hard Fork, the notion of “fork” does not represent merely a fork in the chain, but rather a complete network partitioning. Nodes which are operating under a different set of consensus rules will reject each other’s transactions, and eventually will disconnect from each other. This will lead to two chains that <strong>will not consolidate</strong>: the network will not converge, and the two different chains will continue to evolve independently, representing a different ledger.</p><p>But in the March 11, 2013 case, there was no real intention to change the consensus and split the network. What happened is that the 0.8 release of the most popular Bitcoin Node implementation, <em>Bitcoind</em>, introduced a different database for storing the blocks, switching from BerkeleyDB to LevelDB, as part of a performance optimization effort. Some of the miners upgraded to version 0.8 (LevelDB), and started to produce blocks which caused miners using version 0.7 (BerkeleyDB) to fail, and thus to reject it. Eventually, two parallel chains were created, one by the 0.7 Miners and one by the 0.8 Miners.</p><p>The community got into a big panic, but managed to agree that they should settle on the 0.7 chain, since the 0.8 was the incompatible one. 0.8 Miners started a rollback process, but the 0.8 chain was <strong>13 blocks ahead</strong> of the 0.7 chain. Due to the decentralized structure of the network, they all had to do it voluntarily, by switching their hash power to the other chain’s favor. And so, after a few hours, the 0.7 chain managed to surpass the 0.8 chain, by becoming the longest chain.</p><p>The damage: unrewarded 24 blocks worth of hash power, and a few double-spend attacks (although mostly were done as POC, so merchants were eventually compensated).</p><h3>Conclusion</h3><p>Chain Forks are a natural phenomenon which arise from the decentralized nature of the network, and might happen due to Race Conditions or 51% Attacks (which is out of the scope of this article). The Consensus Protocol is designed to manage this by offering an Eventual Convergence Mechanism, which guarantees that only one consensus chain will prevail.</p><p>Hard Forks, on the contrary, occur when different parts of the network are operating on a different set of rules, and so the Consensus Protocol cannot offer any sort of convergence model — it is up to human beings, those who operate software on the network, to reach a mutual agreement between them, in a traditional, old-fashioned way (by screaming at each other on IRC and other forums, engaging in a twitter war, etc.), or else the network will be partitioned for good.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93a75f96decb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>