<?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 Tallak Tveide on Medium]]></title>
        <description><![CDATA[Stories by Tallak Tveide on Medium]]></description>
        <link>https://medium.com/@tallakt?source=rss-b32599f68f02------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*GEMVbGUw5JQTESF1.jpeg</url>
            <title>Stories by Tallak Tveide on Medium</title>
            <link>https://medium.com/@tallakt?source=rss-b32599f68f02------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 17:51:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tallakt/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[My take on a simplest chess cheating device]]></title>
            <link>https://medium.com/@tallakt/my-take-on-a-simplest-chess-cheating-device-ad246608e8da?source=rss-b32599f68f02------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad246608e8da</guid>
            <category><![CDATA[cheating]]></category>
            <category><![CDATA[chess]]></category>
            <dc:creator><![CDATA[Tallak Tveide]]></dc:creator>
            <pubDate>Sun, 02 Oct 2022 20:37:31 GMT</pubDate>
            <atom:updated>2022-10-02T20:54:45.283Z</atom:updated>
            <content:encoded><![CDATA[<p>With all the chess cheating debate going on, I wanted to use my electronics, software and system design know-how to present a simple system for cheating in chess.</p><p>So, I am to make things as simple and foolproof as possible. I am assuming a cheater would want to do it alone. The less people involved, the less risk of being exposed. So I am opting for a system where the cheater would bring the device with him or her on the body, then record all moves, and get suggested moves.</p><p>In making things as simple as possible, we will assume that it is sufficient to record the moves of the opponent, then be presented with a move that the cheating player should always perform. In this way the cheater need not record details of his or her own moves.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4aRqYvomC0ZiAidsj22o5w.png" /><figcaption>System design</figcaption></figure><p>The system is assumes to be a simple three part design, a sensor, a computer and an actuator. The sensor receives commands from the chess player. Then the computer calculates and selects the next move, then uses the actuator to inform the cheating player about the decision. Keeping the interaction with the device at a minimum reduces the footprint of the device-cheater protocol and the possibility of getting out of sync.</p><p>A high level use case for the device would be</p><p><em>A. The system starts a new game<br>B. The cheater selects playing with black or white<br>If playing black skip to step D<br>C. The device informs the next step given by target square<br>D. The cheater informs the opponents move given by piece plus target square<br>Return to step C</em></p><p>The chess squares are designated by a letter and a number which may each be codified into three bits. The six different pieces may also be codified with three bits.</p><p>When at step C the device informs the cheater about the next move, It does so by actuating first a start bit then six data bits, each with a second interval. The start bit is ignored, and the remaining six bits encode the square. An example codification is sketched:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A8xlD01nN_cGx6B5-1MpOQ.png" /><figcaption>Simple codification of the suggested move</figcaption></figure><p>At step D, the cheater used the sensor to codify in a similar way the move done by the opponent. It is similar to the protocol described above, but also adding three bits for the chess piece, resulting in a total of ten bits, a start bit, six bits for the square and then three bits for the piece.</p><p>Having laid the high level foundation, the next step is adding a local computing platform. One might assume a Linux computer running Stockfish as a simple way to build such a system. The system need not run terribly efficiently, just fast enough to calculate a move within reasonable time. Also, Stockfish requires 4 Gb RAM to operate. Something like the SOC [System on a chip] running the PocketBeagle should suffice, given an additional 4 Gb RAM chip to work with. <a href="https://beagleboard.org/pocket">https://beagleboard.org/pocket</a></p><p>The chip would not run very fast, requiring a few minutes to arrive at a solution. Though a speedier chip may be considered.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*P8Sz2PhC_7IUqMHe.jpg" /><figcaption>PocketBeagle board</figcaption></figure><p>One could imagine a custom PCB containing the SOC from Octavo, RAM chip, battery power voltage conversion, the sensor and actuator interface could fit on a PCB [printed circuit board] not much bigger than twice the area of the dime.</p><p>This chip also required power to run the calculations. A quick search reveals the system may draw 500 mA at 5 V while running, so a 700 mAh 7.4 V Lipo may last for approximately 2 hours of use. Such a battery looks like this and measures 70 x 25 x 13 mm. This would make up most of the volume of the device.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*3olqzUt0AaAtb84N.jpg" /><figcaption>2 hours worth of batteries</figcaption></figure><p>So the only remaining issue is selecting an actuator and a sensor for the system. The most sensible places to hide such a device would be perhaps under the arm, in the groin wrapped to the inner thigh, in a shoe sole or also in the “end”. I think it does not make much sense to assume any hiding place is unthinkable for someone intent to cheat, and in particular if doing so could be without risk.</p><p>For actuators a vibrator such as used on telephones could be used, or also a device sending light electrical shocks.</p><p>For sensors, many options exist; strain gauges could measure foot pressure, tension on a strap or similar. Electrodes on the skin are used in prosthesis to measure the muscle activity beneath the skin. A pressure sensor could easily detect squeezing of the device. An accelerometer chip may be used to detect movement in space of a limb, or even taps of a finger.</p><p>As you have seen so far, the device would allow effective cheating, while having little metal parts that could be picked up by a metal detector, and sending and receiving no radio signals that could be detected or blocked, requiring no help from the audience or staff and not affected by delay of television broadcast.</p><p>I have not given much attention to how the cheater will deal with selecting anything but the best move every time. I will still say this; the system could be made to select some sub-optimal moves here and there if these moves are not significantly inferior in quality, and also considering the chess computers current standing between the players.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad246608e8da" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Security of covid-19 tracing apps]]></title>
            <link>https://medium.com/@tallakt/security-of-covid-19-tracing-apps-25fe9eb8259c?source=rss-b32599f68f02------2</link>
            <guid isPermaLink="false">https://medium.com/p/25fe9eb8259c</guid>
            <category><![CDATA[trackingapp]]></category>
            <category><![CDATA[covid19]]></category>
            <category><![CDATA[covid-19-tracker]]></category>
            <category><![CDATA[smittestopp]]></category>
            <dc:creator><![CDATA[Tallak Tveide]]></dc:creator>
            <pubDate>Wed, 22 Apr 2020 11:18:29 GMT</pubDate>
            <atom:updated>2020-04-22T11:23:13.540Z</atom:updated>
            <content:encoded><![CDATA[<h3>Security of covid-19 tracing apps (part 5)</h3><p>In <a href="https://medium.com/@tallakt/minimal-data-leakage-covid-19-tracing-part-3-bbe4e117a7a1">part 3</a> and <a href="https://medium.com/@tallakt/downgrading-the-central-authority-in-covid-19-tracing-part-4-91756fbff2b8">part 4</a> of this series I described a privacy centric covid-19 tracking app protocol. This time I will try to compare it “Part 3+4” with other existing protocols out there.</p><p>My aim is to set the bar high for privacy for such apps. If the privacy is proven in the protocol, more people will actually use the system, and the attack/misuse surface of such use is minimal.</p><p>I would like to start by categorizing such tracking systems into two categories; type 1 and type 2.</p><p>Imagine that Igor (the infected person) meets Bob. Bob needs to hand Igor some information X that he may use later to warn Bob about a possible infection.</p><p>For a type 1 system, Bob selects any key he likes. For Igor, the value of X is seemingly random. But Bob will know that it was Igor who received X, and no one else.</p><p>For a type 2 system, Bob can’t choose the value of X, rather it is handed to him by the system. A simple system could be forcing Bob to reuse the same id X over and over. If Bob receives a warning about a possible infection, he will not know which of the users he met that issues the warning, unless there was only one rendezvous.</p><p>I will prove that any type 1 system is leaking data, namely Bob will always know that Igor is infected by the virus once he receives a warning. There is no encryption that can change this fact — given any encryption scheme, Bob is free to create a new user profile at every rendezvous. By matching a warning with a profile, he will always know that the meeting with Igor was the only place he could have been infected.</p><p>With this proof, I would not recommend any system of type 1 to be implemented in a large scale.</p><p>Some systems of type 1, not providing best privacy are:</p><ul><li><a href="https://github.com/DP-3T/documents">DP-3T</a></li><li><a href="https://www.tracetogether.gov.sg/">TraceTogether / BlueTrace</a></li><li><a href="https://www.coalitionnetwork.org/">Coalition Network</a></li><li><a href="https://docs.ito-app.org/#introduction">ITO App protocol</a></li><li><a href="https://www.covid-watch.org/">Covid Watch</a></li><li><a href="https://www.coepi.org/">CoEpi</a></li><li><a href="https://covidtrace.com/">Covid Trace</a></li><li><a href="https://www.apple.com/covid19/contacttracing/">Apple and Google Privacy-Preserving Contact Tracing</a> (1)</li></ul><p>(1) Though the Apple/Google is of type 2 in most senses, it falls short by allowing a user to easily generate an identity simply by choosing a random number. I may not be aware of measures they have put in place to restrict a user to a single identity</p><p>For the type 2 system, you can actually achieve more privacy using encryption. As Bob is not free to chose X, he can’t create a system to track every rendezvous with an X. For instance, if Bob is forced to use tokens X1, X2, X3 and X4, a warning may be issued stating that either X1, X2, X3 or X4 has issued an infection warning, using encryption.</p><p>For any type 2 system, you need to ensure that every user in the system only has one identity. This mandates a central authority that, at the very least, publishes at least one public key for each user of the system. To make sure that each user has only one key, the central authority will need to know the real identity of all users.</p><p>Because the values X emitted in a type 2 system are predetermined, an attacker may be able to know what they are. By placing robots at strategic places, you could collect the movements of these X values in time, possibly linking them to a single person. Therefore, it is of great importance that the values X emitted by Bob are difficult to pinpoint to a single person in the system, but still provide some information so that Bob may be warned later.</p><p>Some systems of type 2 are:</p><ul><li>“Part 3+4&quot;, though not implemented yet</li></ul><p>Though Apple and Google’s system is of type 2, it still fall short of hiding Igor’s identity, as it seems to be easy to generate new identities by choosing a random number</p><p>I believe at this point that only type 1 or type 2 are the viable options for covid-19 tracking. And I would always prefer a good type 2 system as it does not allow anyone to learn the identity of an infected person. The central authority only needs to be trusted with one task — maintaining exactly one key for each user.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25fe9eb8259c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Downgrading the central authority in covid-19 tracing (part 4)]]></title>
            <link>https://medium.com/@tallakt/downgrading-the-central-authority-in-covid-19-tracing-part-4-91756fbff2b8?source=rss-b32599f68f02------2</link>
            <guid isPermaLink="false">https://medium.com/p/91756fbff2b8</guid>
            <category><![CDATA[smittestopp]]></category>
            <category><![CDATA[covid19]]></category>
            <category><![CDATA[trackingapp]]></category>
            <dc:creator><![CDATA[Tallak Tveide]]></dc:creator>
            <pubDate>Tue, 21 Apr 2020 20:28:12 GMT</pubDate>
            <atom:updated>2020-04-21T20:45:37.377Z</atom:updated>
            <content:encoded><![CDATA[<p>In <a href="https://medium.com/@tallakt/minimal-data-leakage-covid-19-tracing-part-3-bbe4e117a7a1">part 3 of this blog series</a> I sketched a system for tracing virus infections with minimal data leaked. The goal is still to let people warn each other about possible infection, but not give any clues to who has the infection or who is being warned. The end result was a system where:</p><ul><li>Igor being the infected person knew that Bob (possibly infected) was a member of a group G</li><li>Bob knew the date of possible infection. If Bob interacted with many people that day, it’s difficult to guess who is infected. If he only met Igor that day, he will, unfortunately, have learned that Igor is infected</li></ul><p>The central authority will also know that someone in group G may have been infected. By using the secretly known names and elimination, they may possibly guess who is infected (in particular if G is a small group, but the central authority may also fill G with dummy users, so that it effectively identifies a single person). In this way, if they track the group G that Igor is emitting, they are tracking him.</p><p>Furthermore, lets say each group represents a continent. Now if Igor travels from Asia (group A) to Europe (group E), every European he meets will identify him as the rare “Asian guy”, the only person with group A. Thus they will all know that every time they meet someone with group A, it’s probably Igor.</p><p><em>Note that guessing someone’s identity is not a fatal problem for infection tracking. Igor may know that he is warning Bob, but Igor still doesn’t know if Bob is infected (no one knows before Bob gets a test). And Bob will never know that Igor is the infected person warning him. Identifying someone may allow tracking though, if beacons are placed where Igor is moving about.</em></p><p>This suggests that you want to be grouped by location, and the location should be related to where you spend your time. If the group is sufficiently large, the location need not be very precise. But you definitively want to mingle with a few people sharing your group.</p><p>So in a revised scheme, each user registers in the central authority both with a public key and a City name, then the central authority groups individuals by Cities into sufficiently large groups (eg. combining smaller cities or splitting large ones). This solves the issue of being “the Asian guy” in Europe, just make sure to register for a group nearby where you stay, and keep it updated when you’re traveling.</p><p>Next we will solve the issue with the central authority being able to use elimination or dummy addresses to single out an individual. In part three I suggested using deterministic wallets to generate a new key every day. Today I scrap this idea and introduce a new scheme.</p><p>The public keys that are verified by the central authority will be called generation 0 keys. The central authority knows the identity of the public key’s owners. To create a generation 1 key, each user selects a new public key and group, then signs that with the generation 0 private key using a ring signature for the generation 0 group that was assigned by the central authority. A generation 2 key is likewise created based on a generation 1 key. It takes two periods to obtain a generation 2 key. Furthermore, generation 1 and 2 keys expire after a single period of 24 hours.</p><p>Every time a new generation key is created, the central authority will only know that a member of a group is now this particular a member of a second group. Lets assume the group size is 100, and the central authority has no additional data. After the second generation public key has been created, the central authority will only know any person is one out of 10.000 people.</p><p>Only generation 2 keys may be used as the public key when doing infection tracing.</p><p>If a user loses his private [generation 0] key, that user must re-verify with the central authority. As all generation 1 and 2 keys expire in a period, such keys are out of the system after a two period delay, even if the user secretly still has his private key. In this period, the user will not be able to generate a new generation 2 key, a process that takes two periods to perform.</p><p>With this change, the central authority no longer knows the identities of the people in a group or which group a certain person belongs to. Users may change their group at will. And still the invariant of one public key per user is taken care of.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91756fbff2b8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Minimal data leakage covid-19 tracing part 3]]></title>
            <link>https://medium.com/@tallakt/minimal-data-leakage-covid-19-tracing-part-3-bbe4e117a7a1?source=rss-b32599f68f02------2</link>
            <guid isPermaLink="false">https://medium.com/p/bbe4e117a7a1</guid>
            <category><![CDATA[smittestopp]]></category>
            <category><![CDATA[trackingapp]]></category>
            <category><![CDATA[tracking-software]]></category>
            <category><![CDATA[covid19]]></category>
            <dc:creator><![CDATA[Tallak Tveide]]></dc:creator>
            <pubDate>Mon, 20 Apr 2020 19:53:14 GMT</pubDate>
            <atom:updated>2020-04-22T11:21:28.914Z</atom:updated>
            <content:encoded><![CDATA[<p>I am trying to design a virus infection tracking system that does not leak any information. This third attempt uses linked ring signatures to hide the identity of the participants.</p><p><em>I compare the privacy of many tracing apps to this approach in </em><a href="https://medium.com/@tallakt/security-of-covid-19-tracing-apps-25fe9eb8259c"><em>part 5 of this series</em></a><em>.</em></p><p><em>This is the work of a happy amateur. You might see other serious work on this </em><a href="https://docsend.com/view/nis3dac"><em>elsewhere</em></a><em> or </em><a href="https://github.com/shankari/covid-19-tracing-projects"><em>even here</em></a><em>, though I believe there may be some important advances in here.</em></p><p>Imagine Igor meets Bob, and it turns out Igor is infected at a later point in time. The system being described has the following properties</p><ul><li>Igor has a way of warning Bob that he may have been infected at a certain date</li><li>Bob will not know who is issuing the warning except what he can deduce from the date (eg only one rendezvous on that date)</li><li>Bob will not know any information pinpointing Igor, other than his membership in a group</li><li>The public will know the date the rendezvous took place and which group Bob belongs to</li><li>Only Bob (other than Igor) knows about the infection warning</li><li>It is not possible to track a person as the emitted tokens change at every rendezvous</li><li>A central authority is required to keep track of each person’s public key and assigning them to a single group</li><li>Igor does not learn Bob’s public key or vice versa, only which group it belongs to</li></ul><p>The reason a central authority is needed is to make sure every user just has a single identity. If this was not the case, a new identity could be created for every rendezvous. The central authority will know only the public key assigned to each user. The central authority can’t use the public keys to figure out information about other transactions.</p><p>The system depends on linked ring signatures, as described in <a href="https://doi.org/10.1007/11424826_65">https://doi.org/10.1007/11424826_65</a>.</p><p>To make the system work, some infrastructure is required to be maintained by a central authority. Every real person may submit exactly one public key. Every new date, the key is progressed one generation in a deterministic fashion as described in <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki">Bitcoin BIP-32 Hierarchical Deterministic Wallets</a>. Because a new public key is used every day, Bob will know for a fact that Igor may have infected him on a specific date, because of the key that Bob would use on that day is the only one to decode the infection warning.</p><p>The system assigns each user to a group depending on their order of participation. Eg. users 1 through 10.000 are in group 1, 10.001 through 20.000 are group number two etc. The grouping should be stable, a single user should remain in the same group day after day. The list of public keys and groups is frozen at midnight every day for 24 hours.</p><p>The size of the groups should be as large as possible, though there might be some practical limits such as the processing time and memory required to calculate the ring signatures.</p><p>The public keys and their groups are stored in a publicly accessible registry, known to all.</p><p>When Igor meets Bob, Bob starts out by sending Igor a random value R. Using the ring signature for Igor’s group, Igor signs R and returns it along with Igor’s group G to Bob. If Igor has seen R previously, he may and should decline to sign it. We will call the signature σ1. σ1 proves that Igor is a member of a group G and thus a real person in the central registry.</p><p>Nothing more is done until later when Igor is verified to be infected by the virus. The doctor creates a message containing: (infection id, The first date of possible infection, the last date of possible infection, the group G, the doctor’s signature). The message is published at the central registry.</p><p><em>Less important note: The doctor may also sign with a ring signature to avoid revealing exactly which doctor who verified the infection.</em></p><p>When Bob sees that someone in his group may have been infected, he creates a brand new public key P1, and signs it with a linked ring signature once for each date in question. This data, (infection id, P1, σ2), is published to the central registry.</p><p>When Igor scans through the registry for anything related to his infection id, he finds Bob’s record. He can verify that σ1 and σ2 is indeed signed by the same member of group G. Thus he can encrypt a message (eg. “You are affected by infection id x”) with P1 so that only Bob is able to read it using his private key S1. Then he publishes the (infection id, ciphertext) to the public registry.</p><p>Finally, Bob picks up the ciphertext from the public registry, and using the key for the correct date, chosen by trial and error, he finds out that one of them unlocks the warning about a possible infection.</p><p>This ends the exchange of information.</p><p>In <a href="https://medium.com/@tallakt/downgrading-the-central-authority-in-covid-19-tracing-part-4-91756fbff2b8">part four</a>, we limit the amount of information that the central authority needs to keep secret.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bbe4e117a7a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Minimal leakage covid tracing app part 2]]></title>
            <link>https://medium.com/@tallakt/minimal-leakage-covid-tracing-app-part-2-c0c83746b2b9?source=rss-b32599f68f02------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0c83746b2b9</guid>
            <category><![CDATA[trackingapp]]></category>
            <category><![CDATA[covid19]]></category>
            <category><![CDATA[smittestopp]]></category>
            <dc:creator><![CDATA[Tallak Tveide]]></dc:creator>
            <pubDate>Mon, 20 Apr 2020 08:06:40 GMT</pubDate>
            <atom:updated>2020-04-20T19:55:06.974Z</atom:updated>
            <content:encoded><![CDATA[<p>This story has largely been superseded by a third revision of a protocol, <a href="https://medium.com/@tallakt/minimal-data-leakage-covid-19-tracing-part-3-bbe4e117a7a1">described in part three of this series</a>. If you are only reading one of the stories, I suggest rather reading that one.</p><p>In the first part, I described a design for a system to track covid-19 with minimal data leakage.</p><p>In this story, I will present another idea with even less data leakage, but with the added requirement that we have a central authority that manages storage of one public encryption key per person.</p><p><em>Note: I’m just an amateur doodling away. You may find better suggestions for designing this system. Though I find it hard to get right, and a very interesting problem.</em></p><p>First, lets start with the basic app where the user Bill and Bob meet (a rendezvous), and they exchange random tokens known to both. If Bill is ill, he makes public the token he got from Bob. Bob know that he need to test for infection of the virus.</p><p>The problem with this scheme is that the Bob may note down the names of the people who received each unique token. When Bill issues the warning, Bob knows for a fact that Bill is infected with the virus. Thus, some information has leaked.</p><p>My first blog post on this issue made some changes to this scheme by stating that Bill needs to reuse his token N times. In this way, Bob knows that there is a 1/N chance of Bill being infected which is better than certainty. The method also has loopholes related to Bill giving Bob N unique tokens at every rendezvous, so that he may still figure out that Bill is ill. In addition, when users have to reuse their tokens, you add the possibility of tracking that person’s movements, if you can meet Bill at several locations while he is sharing the same token.</p><p>I will present a new scheme where we have the following guarantees:</p><ul><li>Bob can’t know who infected him, except that it happened on a certain date</li><li>Anyone can track a person for one day, but no more, unless they can collude with the public key authority</li><li>No one can know that Bill is the one infected with the virus</li></ul><p>The scheme requires a public key authority. It verifies the owner of all public keys in the public record. The information who owns which key may be disposed, as long at the authority can guarantee that every person gets only one key. The key authority also enforces a rule; every day, each user may (should) change his or her public key, and the change must be signed with the previous private key. Only the key authority may knows which keys belong to which person. Allowing a user to supply a new key signed with the previous one removes the need to verify the user every new period.</p><p>If the public key authority should leak information about a users list of public keys, someone could use those keys to track the user beyond a 24 hour period. But nothing more.</p><p>Next we will look at <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki">Bitcoin BIP-32 Hierarchical Deterministic Wallets</a>. We will not use the whole structure, but only the fact that the following structure is feasible to implement</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/345/1*zRpChjaH-9-UcDldcisZyw.png" /></figure><p>The arrows represent transformations that are possible. Eg. the public key P0 may be calculated if you know the private key S0, P1 may be calculated if you know P0 or S1. These transitions are one-way.</p><p>The key P0 in the figure is stored in the public key record, with a new key for each day. One reason to change the key is to make tracking a user harder, the other is that when a user is warned about infection, he or she will know on which date the infection might have happened.</p><p>We will imagine a rendezvous where Bill meets Bob. Bill gives Bob the private key S1 and the public key P0. Bob uses S1 to find P1, P0 to find P1 and looks up P0 in the public key record. Bob thus knows that Bill is a real person, and that Bill is in the possession of S0. He can’t be a tracking bot producing random unique tokens.</p><p>Later, Bill is confirmed to be infected by the virus. He obtains a verification of this [TX0], signed by a doctor whose public key is available in a second public record.</p><p>Bill then signs the TX0 with the private key S1, only known to Bill and the people he met on that day. This produces TX1.</p><p>Next Bill encrypts TX1 with the public key P0 such that only the owner of S0 (which is only Bob) may read the transaction. This produces TX2.</p><p>Finally, Bill makes the transaction TX2 available on a third public record.</p><p>Bob may look at all such transactions. If he is successful in decrypting any of them, he will know:</p><ul><li>Someone he met is infected with the virus (by the doctors signature)</li><li>Since P0 is only used on a specific date, he will know which date the infection took place</li><li>Only he is in possession of the necessary P0 key to decrypt the message, thus he is the only one receiving this information</li><li>The message must have come from someone he or she met on that day, as the message is signed by the S1 key.</li></ul><p>Thus, I believe this might be the least leaky scheme I have seen so far.</p><p>Further improvements could be:</p><ul><li>A scheme to allow Bill to issue unique tokens to people he meets. The tokens must be verifiable to be owned by a user in the public key record, but not which one. This makes it impossible to track Bill by his public id. A method to implement this could be a ring signature.</li><li>Implementing a scheme where the public key authority could not track a user’s public key from day to day. This removes the possibility of someone colluding with the authority to enable tracking of citizens.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0c83746b2b9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Covid-19 tracing with minimal data leakage]]></title>
            <link>https://medium.com/@tallakt/covid-19-tracing-with-minimal-data-leakage-dd237fd34a7f?source=rss-b32599f68f02------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd237fd34a7f</guid>
            <dc:creator><![CDATA[Tallak Tveide]]></dc:creator>
            <pubDate>Wed, 15 Apr 2020 12:47:15 GMT</pubDate>
            <atom:updated>2020-04-20T08:08:07.958Z</atom:updated>
            <content:encoded><![CDATA[<p>I published a new story about an <a href="https://medium.com/@tallakt/minimal-leakage-covid-tracing-app-part-2-c0c83746b2b9">improved scheme for infection tracking here</a>.</p><p><em>Note: I am an amateur in this stuff, just doodling away. You might find people with better insight into this issue </em><a href="https://www.wired.com/story/covid-19-contact-tracing-apps-cryptography/"><em>elsewhere</em></a></p><p>I was thinking about the ultimate covid-19 infection tracing app, and how to preserve privacy. Some things I would like to have would be:</p><ul><li>No dependence on a trusted third party (government etc)</li><li>The identity of the infected person is not shared with anyone</li><li>The identity of the people who might have been infected is not shared</li><li>The location and time of possible infection is not shared</li><li>One is only warned about possible infection transfer if the one party is positively confirmed to have the virus, eg by a doctor</li></ul><p>This problem is about designing a protocol, not an app. While a trusted party could make sure an app did not leak information, we have no guarantee that the other people are using the same app, or an ‘evil’ app designed to capture data. So the protocol itself needs to be the barrier to ensure privacy.</p><p>Bill and Bob both use the infection tracking app. Every time they meet, they exchange tokens. The tokens are generated by each of them, but appears random to the other party. The tokens are stored on their phones after the exchange took place. The exchange of tokens is encrypted, so no third party may eavesdrop.</p><p>A while later, Bill gets infected with the virus.</p><p>At this point, Bill generates a transaction for each collected token (X) on his phone containing TX1 = “the hash value of X, and the date Y of infection”</p><p>A doctor may verify that Bill is indeed infected, and looking at TX1 he verifies that the date Y is within the past three weeks. Then, the doctor generates a new TX2 = “the hash of TX1”, signs it and publishes it to a public record. The doctor uses a key that is publicly known. The doctor does not know the value of X, only the date Y.</p><p>A third person downloading the list of public TX2’s will not know the values of any keys or any dates in which the infections took place.</p><p>Next, Bob download these public transactions (TX2s), to see whether he might have been infected. He will have to guess the date Y and iterate through all exchanged tokens X on his phone. He will be able to see whether any of the public transactions state that he might have been infected.</p><p>There is slight problem with this scheme still. Because Bob needs to use both X and Y to verify the interaction, he knows the exact time X was issued and thus may be able to figure out that Bill infected him at a certain time and location.</p><p>To illustrate the problem — lets assume Ted has some influence over the construction and software of a ticket vending machine for public transport. Ted adds a bluetooth beacon creating random rendezvous tokens with every confirmed ticket purchase. Because of the purchase, Ted knows the identity of his customer. When the customer is infected at a later time, he/she sends a warning to Ted’s vending machine that it might have been infected. In this way, Ted will know if any of the customers are infected by a virus.</p><p>This problem can’t be solved entirely in a peer-to-peer trustless system. But, let’s assume that users are required to reuse their tokens N times. Every time two people meet, the tokens X1-X2 are published to a public registry.</p><p>Now, when Bill wants to warn Bob using the token X1, Bill can check if X1 was used many times, and the number of degrees of separation between Bill’s own tokens and the tokens that Bob met with the X1 token. If Bob has met many of the X2 tokens directly, or has met them with few degrees of separation (and at dispersed dates and locations), he may assume that the token X1 is not a bot and then warn Bob. In this case, Bob does not know exactly which interaction with X1 that triggered the warning, and thus it is more difficult to deduce that Bob is infected.</p><p>Though not fool-proof this method allows Bill to somewhat qualify the realness of Bob’s identity. On the other hand, an external attacker may use the information of interactions that Bill is supplying to trace Bill’s whereabouts.</p><p>I will describe how Bob could try to pinpoint who is infected: Every time Bob meets a person, he generates a unique token and then generates (N-1) bogus rendezvous by generating fake tokens. If Bill should notify Bob about being infected, Bob will know that only the one real rendezvous could possibly generate a warning, and Bob thus knows that Bill is infected, and at which time and location this happened.</p><p>Being a peer to peer system with no trusted third parties, it is not easy to overcome this attack. Even so, there are possibillities.</p><p>If Bill looks up Bob’s token before making contact, he can see if the same token was used for other rendezvouses. If Bob took part in any of these himself, using a different token, Bob can be pretty sure that Bob was actually reusing the same token at two separate times and locations. Furthermore, if Bobs token met Alices token, and Bob also met Alice in person, he can be pretty sure that Bob is real also. You can extend this to any degree of separation. In practice, if N is chosen to be a minimum of 10, if more than 5 of these could be traced back to actual physical rendezvouses for Bill, Bill may assume that Bob is not a data collecting bot. And if Bob’s rendezvouses are real, Bob should have a hard time figuring out that Bill is infected.</p><p>Edit: It occurred to me that even reusing the token N times is not safe, because Bob may issue N tokens at every rendezvous, then use that information when being warned about possible infection N times to determine the exact rendezvous that caused the possible infection transfer.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd237fd34a7f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Nordnorgebanen]]></title>
            <link>https://medium.com/@tallakt/nordlandsbanen-8299e2eb3e9a?source=rss-b32599f68f02------2</link>
            <guid isPermaLink="false">https://medium.com/p/8299e2eb3e9a</guid>
            <category><![CDATA[gto]]></category>
            <category><![CDATA[nsb]]></category>
            <category><![CDATA[notdlandsbanen]]></category>
            <category><![CDATA[co2]]></category>
            <category><![CDATA[vies]]></category>
            <dc:creator><![CDATA[Tallak Tveide]]></dc:creator>
            <pubDate>Tue, 30 Jul 2019 21:08:39 GMT</pubDate>
            <atom:updated>2019-08-01T17:47:05.398Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Nordnorgebanen</strong></p><p>Det er stadige opprop om at tiden er kommet for å bygge Nordlandsbanen videre i Finnmark. Et av hovedargumentene er kutt i CO2 utslippene. En kjapp hoderegning er at hvis vi sparer de 100.000 tonn CO2 utslippene årlig med toget, vil driving av anlegget gå karbon nøytralt om ca 40 år. Tallene jeg bruker er:</p><ul><li>Utgift 113 milliarder</li><li>Sparte CO2 utslipp 100.000 tonn CO2 per år</li><li>35 tonn CO2 utslipp per million investert i veibygging</li></ul><p>Mitt estimat er høyst usikkert. Så det riktige tallet kan være 30 år, men jeg frykter med så mye tunneldriving og bruk av dynamitt er det riktige tallet kanskje mye større enn 40 år.</p><p>Folkens, vi har ikke tid til å bruke 40 år på å investere CO2 før vi går break even. Vi skal ned i karbonutslipp de neste årene.</p><p>Videre så er nok disse «sparte CO2 utslippene» et mål som stadig flytter seg. Før 2060 vil jeg tro det er bare elektriske biler på veiene, elektriske trailere, lavutslipps skipsfart, elektriske fly. Tar vi med dette kan det ta 80 eller til og med 100 år før dette prosjektet er karbon nøytralt.</p><p>Spørsmålet blir heller om vi har råd til å bygge denne banen ift karbonutslipp.</p><p>Jeg tror det er mer fornuftig å satse på disse løsningene for Nord Norge:</p><ul><li>Mer skipsfart av typen med lave eller ingen utslipp. Fisk må eksporteres foredlet frossen, ikke sendes fersk til Gardermoen og lesset på fly</li><li>Elektriske fly med flere stopp underveis</li><li>Redusere transportbehovet ved å ikke legge opp til turisme og annen ikke essensiell transport</li></ul><p>Det er en kjensgjerning at hvis man bedrer transportbehovet slik at man kan reise raskere fra A til B, så reiser man flere kilometer og forurenser like mye CO2 per kilometer som man gjorde tidligere. Altså totalutslippet øker. Samme gjelder som kjent for veiutbygginger. Derfor skal vi tenke oss veldig godt om før vi setter igang et slikt prosjekt.</p><p>Oppdatering: La til en lenke som viser at pr 2015 går de fleste togstrekningene på diesel. Man vurderer og løsninger som naturgass (ingen reduksjon i CO2 utslipp) og biodrivstoff (store arealbruk og indirekte miljøproblemer). Samtidig viser den at mye av trafikken på togbanene nordover støtter cruisebåt turisme som neppe er bærekraftig uansett.</p><p>Kilder:</p><ul><li><a href="https://www.regjeringen.no/no/aktuelt/utredning-fra-jernbaneverket-elektrifisering-av-rorosbanen-og-solorbanen-bor-vurderes-forst/id2466846/">Utredning fra Jernbaneverket: Elektrifisering av Rørosbanen og Solørbanen bør vurderes først</a></li><li><a href="https://www.vg.no/nyheter/meninger/i/naBnVB/100-000-grunner-til-aa-bygge-nord-norgebanen">100 000 grunner til å bygge Nord-Norgebanen</a></li><li><a href="https://zero.no/a-kutte-utslipp-fra-bygging-av-en-vei/">Å kutte utslipp fra bygging av en vei - ZERO</a></li><li><a href="https://www.jernbanedirektoratet.no/no/strategier-og-utredninger/utredninger/utredning-nordnorgebanen/">Utredning av Nord-Norgebanen ut på høring</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8299e2eb3e9a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mot en ny modell for bompenger]]></title>
            <link>https://medium.com/@tallakt/mot-en-ny-modell-for-bompenger-ee07ebaab371?source=rss-b32599f68f02------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee07ebaab371</guid>
            <category><![CDATA[grønne-sertifikater]]></category>
            <category><![CDATA[passeringer]]></category>
            <category><![CDATA[bompenger]]></category>
            <dc:creator><![CDATA[Tallak Tveide]]></dc:creator>
            <pubDate>Mon, 22 Jul 2019 18:24:44 GMT</pubDate>
            <atom:updated>2019-07-22T18:25:53.209Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Mot en ny modell for bompenger</strong></p><p>Problemet med bompenger et at de blander sammen to ting. Først ønsker man å begrense trafikken og fordelsbehandle de som kjører kollektivt. Så ønsker man å finansiere veiprosjekter.</p><p>Med dette forslaget får myndighetene et verktøy til å skille de to fra hverandre.</p><p>Inbyggerene får anledning til å melde seg inn seg i en bomring hver. Hvert kvartal utdelt et antall passeringer jevnt fordelt på alle medlemmene. Det er politikerene som velger hvor mange passeringer som skal deles ut, utfra trafikkhensyn.</p><p>For å kjøre gjennom bomringen må man ha en passering [PS] tilknyttet medlemsskapet sitt. Man bruker passeringer fra kontoen sin, men ubrukte PS blir slettet etter et halvt år.</p><p>Dersom man ikke trenger alle PS, kan man velge å selge disse. Enten kan man legge dem ut på et marked til fast pris, eller man kan finne en kjøper som har lagt ut et kjøpsønske til fast pris. Slik danner kjøp og salg av PS et marked mye lignende kjøp og salg av aksjer. Dette markedet vil styre prisen basert på etterspørselen etter de PS som blir delt ut hvert kvartal.</p><p>Dersom bompengeringen skal brukes til å finansiere nye veiprosjekter skal det koste penger å være medlem i bompengeringen. Disse pengene blir overført direkte til veimyndighetene. Når en slik skatt blir lagt til bomringen, vil markedet reagere med høyere priser per passering.</p><p>Dersom man passerer en bomring hvor man ikke er medlem, vil systemet forsøke å automatisk selge noen PS du allerede eier og kjøpe en PS i den fremmede bompengeringen. Siden vi her snakker om markeder vil det være mulig å gjøre dette automatisk så lenge det er likviditet i markedene (noe det vil være).</p><p>Enkelte medlemmer vil ikke ha intensjoner om å bruke alle PS de får utdelt. Dette kan være personer som kjører kollektivt eller ikke kjører mye bil. Disse personene vil kunne selge alle eller noen av sine PS og sitte igjen med overskudd etter perioden er slutt. Slik blir personer som skaper lite trafikk belønnet.</p><p>Hva vi sitter igjen med nå er et system hvor myndighetene bare forholder seg til</p><ul><li>Hvor mange passeringer per måned skal vi gjøre tilgjengelig?</li><li>Hvor mye skal det koste å være medlem av en bompengering?</li></ul><p>Etter det vil markedet bestemme prisen per passering. For de som kjører lite vil man sitte igjen med noen kroner, mens de som ønsker å kjøre, alltid vil kunne betale for den rettigheten, til markedspris.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee07ebaab371" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Amoveo’s Smart Contracts]]></title>
            <link>https://medium.com/@tallakt/amoveos-smart-contracts-30cff9e5459e?source=rss-b32599f68f02------2</link>
            <guid isPermaLink="false">https://medium.com/p/30cff9e5459e</guid>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[amoveo]]></category>
            <category><![CDATA[state-channels]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Tallak Tveide]]></dc:creator>
            <pubDate>Mon, 29 Oct 2018 08:34:24 GMT</pubDate>
            <atom:updated>2018-10-29T17:58:53.731Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/256/1*SahvtiXWYOI8HtP4EATatQ.png" /><figcaption>By Cryteria — Own work, CC BY 3.0, <a href="https://commons.wikimedia.org/w/index.php?curid=11651154">https://commons.wikimedia.org/w/index.php?curid=11651154</a></figcaption></figure><p>Amoveo is a new blockchain project featuring programmable state channels, on-chain oracles, financial derivatives and more. In this post I will look at the way smart contracts in channels are implemented, which is quite different. So start by forgetting everything you know about programming smart contracts for other blockchains.</p><p>This article attempts to describe Amoveo state channel smart constracts in broad terms. We will not discuss why you would want to use state channels. We will also not discuss the Amoveo smart contract language called Chalang, a functional language without the <strong>goto</strong> opcode in the VM, making it easier to analyze. As you will see later, Amoveo contracts, in their nature, are easy to reason about, because they have no state outside the code.</p><p>As the state channels in Amoveo are cryptoeconomically secure, it is worthwhile for both participants to cooperate. Both sign the transactions [TX] to put money into and later extract it from of the channel. Being cryptoeconomically secure means that both parties must put money in the channel that is only redeemable by cooperating. When the parties are cooperating, no code is stored on-chain. Instead both parties attest that the money in the channel is divided in a certain way upon closing the channel. This involves a <strong>channel_new</strong> TX, where participants insert money into the channel, and the <strong>channel_team_close</strong> TX that divides the channel balance among the participants. Both of these TX are signed by both participants. This is the simple scenario and probably will be the most common scenario, and no code ever goes on-chain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/1*fJYHNx854MTa9JTOfH2smA.png" /></figure><p>If the parties cannot agree upon a funds split, we are left with a scenario where the <strong>channel_new</strong> TX still exists, but we need a <strong>channel_solo_close</strong> TX to initiate a close by only one party. Following this TX, additional <strong>channel_slash</strong> TX may be added providing a newer code for the state channel. There will be a period where the channel funds are frozen to allow the other participant to react. The channel may be closed with a <strong>channel_timeout</strong> TX, after which funds are transferred from the channel into the two participant’s accounts. In this scenario, the <strong>channel_solo_close</strong> and <strong>channel_slash</strong> will contain the latest agreed upon code from the channel. All Amoveo servers may independently validate the outcome of the code as part of processing the blockchain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*Ofz_bN5zt7odT_YhLulkRg.png" /></figure><p>This is the mechanism of state channel interaction with the blockchain. Now lets look at how the code is actually executed and instanciated in the state channel, and how state is maintained in the channel.</p><p>Using pseudocode, I’ll make a simple contract to make a bet on the outcome of an on-chain oracle. Note that this grossly simplified code will not work, but is meant to illustrate how these contracts operate. The contract runs without any inputs and returns three values: the delay for a single sided closing, a nonce and the movement of funds from one participant to the other (the participants being the better and the server, no market is assumed here).</p><pre># contract for betting on an oracle result<br># returns {&lt;delay period&gt;, &lt;nonce&gt;, &lt;amount to transfer&gt;}</pre><pre>oracle = “jjFZnjADflb4FzocON+Kboh5T+UHHfiw”</pre><pre>case oracle_result(oracle) do<br> “unfinished” -&gt;<br>   nonce = 1<br>   return {1 year, nonce, 0}<br> “bad question” -&gt;<br>   nonce = 1<br>   return {0 days, nonce, 0}<br> “statement true” -&gt;<br>   nonce = 2<br>   return {0 days, nonce, 1.0 VEO}<br> “statement false” -&gt;<br>   nonce = 2<br>   return {0 days, nonce, -2.0 VEO}<br>end</pre><p>First, notice that there is only code in the channel, and no state (which I find funny as they are called state channels). For this particular contract, there are three items that separate this code from a generic code: the oracle id, the amount of VEO to transfer if the oracle is true, and an amount for false (the last two defining the odds of the bet). The generic code could look something like:</p><pre># contract for betting on an oracle result<br># returns {&lt;delay period&gt;, &lt;nonce&gt;, &lt;amount to transfer&gt;}</pre><pre>oracle = &lt;oracle-id&gt;</pre><pre>case oracle_result(oracle) do<br> “unfinished” -&gt;<br>   nonce = 1<br>   return {1 year, nonce, 0}<br> “bad question” -&gt;<br>   nonce = 2<br>   return {0 days, nonce, 0}<br> “statement true” -&gt;<br>   nonce = 2<br>   return {0 days, nonce, &lt;amount-if-true&gt; VEO}<br> “statement false” -&gt;<br>   nonce = 2<br>   return {0 days, nonce, -&lt;amount-if-false&gt; VEO}<br>end</pre><p>How do the two parties agree upon which code to sign? They both have to be able to come up with the exact same code, so that they may both sign the hash of the contract. This means that once the two parties agree upon &lt;oracle_id&gt;, &lt;amount-if-true&gt; and &lt;amount-if-false&gt;, they have to both have access to the generic contract and generate a specific contract to sign.</p><p>If one party is the Amoveo node hosting the bet, and the other is the user using the web wallet, the use case would play out like this:</p><ul><li>The user enters the oracle id and the two amounts in a form</li><li>The web wallet puts the values of the form into the generic code and signs it (providing a signature and a hash of the code)</li><li>The web wallet submits the values and the signed code to the server</li><li>The server uses the values and it’s own generic code and verifies that the hash matches</li><li>The server signs the code also, and returns the signature to the web wallet</li></ul><p>Because no party should trust the other to produce the correct code for the channel smart contract, both the server and the web wallet must contain the generic contract and a way to replace parameter values.</p><p>So if the state channel does not contain state, could it even be very useful?</p><p>I’d like to make another example code that could support micropayments. The objective here is to have a user put money in a channel to get access to a service, eg. playing a game. VEO is charged per second of use, but you would not like to put all those TX on the blockchain. It is possible by injecting the state (the amount of seconds played) into the contract like this:</p><pre># contract for micropayments<br># returns {&lt;delay period&gt;, &lt;nonce&gt;, &lt;amount to transfer&gt;}<br>nonce = 1<br>usage = 100<br>return {0 days, nonce, usage}</pre><p>The game server and the game client would generate a new code every few seconds, containing the new accumulated usage. Both the server and client would sign these as time went by. The game player controls and trusts his game client software. The game server could never take any money that was not signed for by the player. The concrete code inserted into the channel would look like:</p><pre># contract for micropayments, at t = 10:00:00<br># returns {&lt;delay period&gt;, &lt;nonce&gt;, &lt;amount to transfer&gt;}<br>nonce = 1<br>usage = 0<br>return {0 days, nonce, usage}</pre><pre># contract for micropayments, at t = 10:00:10<br># returns {&lt;delay period&gt;, &lt;nonce&gt;, &lt;amount to transfer&gt;}<br>nonce = 2<br>usage = 100<br>return {0 days, nonce, usage}</pre><pre># contract for micropayments, at t = 10:00:20<br># returns {&lt;delay period&gt;, &lt;nonce&gt;, &lt;amount to transfer&gt;}<br>nonce = 3<br>usage = 200<br>return {0 days, nonce, usage}</pre><p>And so on. Only the latest code needs to be stored, as only the code with the highest nonce will be used to close the channel. Once the gamer is done playing, the channel may be closed and the funds distributed, resulting in a total of two transactions on-chain, none of them containing any code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30cff9e5459e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Protecting GPU mining from 51% attacks]]></title>
            <link>https://medium.com/@tallakt/protecting-gpu-mining-from-51-attacks-fdd718af26c2?source=rss-b32599f68f02------2</link>
            <guid isPermaLink="false">https://medium.com/p/fdd718af26c2</guid>
            <category><![CDATA[proof-of-work]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[mining]]></category>
            <dc:creator><![CDATA[Tallak Tveide]]></dc:creator>
            <pubDate>Wed, 12 Sep 2018 18:52:03 GMT</pubDate>
            <atom:updated>2018-09-13T07:03:52.621Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/323/1*uz1ztokzzAkQ4YhVMQgYug.jpeg" /><figcaption>Take Down!</figcaption></figure><p>A new blockchain will require a way of determining consensus. Proof-of-work mining is one popular way of solving this. Block rewards are given to a miner that solves a puzzle of some sort, ant that miner is entitled to make a new block. This is also a way to distribute the coins of the blockchain, which is also of great importance. As the coins are distributed only in exchange of using resources, the coins are more likely to be valued by the receiver, compared to coins given away for free.</p><p>Mining will normally follow a path from CPU mining, to GPU (graphics card) mining and last to ASIC minig. This is in order of implementation difficulty. The first transition is usually quite quick, and happens because GPUs are more efficient power wise and have more performance relative to cost. The second step will take longer, as developing an ASIC miner is a very costly process, and the volume of mining must accomodate some return on investment for it. Furthermore, some puzzles are made to be ASIC resistant, so that they are either more difficult or expensive to build.</p><p>While GPU mining is nice, GPU mining is dangerous for everyone except a very big actor. GPU mining machines may be easily changed between one or another. Due to this, we’ll assume that mining is equally profitable for every coin. An owner of a big mining pool might be persuaded to let out his mining machines to an attacker for a mark-up. Lets just assume for the rest of this blog post that the mark-up could be zero to make things simpler.</p><p>The attacker rents the mining hardware, with a capacity slightly higher than the existing hashrate. For simplicity we’ll assume that he exactly matches the existing hashrate. Once the attacker starts mining, he will outmine any other blocks created. We assume that the attack is unnoticed for a while, and the price of the coin remains constant.</p><p>As the attacker now controls the blockchain, he may collect all the mining rewards. This will exactly match the collective mining revenues of the old miners. This will exactly pay the rental costs of the mining hardware. Thus we can assume:</p><blockquote>Mining with proof-of-work offers no real security, if suitable mining capacity may be procured at close to cost price</blockquote><p>There are many ways to attack a blockchain once you have mining majority. For a smaller coin, the profits are made mostly in three ways:</p><ol><li>Coins you can get temporary control over and then transfer to an outside buyer, in exchange for another asset (typically exchanges)</li><li>Any “short” position placed in a derivative market outside the blockchain</li><li>Gains made inside the blockchain by changing or omitting transactions</li></ol><p>For coins in the first category, these must be exchanged as soon as possible. Once the attack is detected, the coin will probably lose value quickly.</p><p>For the second source of profit, a derivative market must exist outside the blockchain itself. An example of this would be an exchange offering leveraged pairs such as ETH/EUR while attacking ETH, where the attacker would enter a “SELL” position before performing the attack. Otherwise someone else could profit by the demise of this blockchain.</p><p>The third option is a bit more difficult, as the blockchain will lose it intrisic value, such profits will also be decimated.</p><p>The combined value of 1, 2 and 3 are the revenue streams of such an attack. If we reason that performing a 51% attack is without any real cost, we could expect such an attack to happen at one point in time.</p><p>To end this blog post, I will suggest a preventive measure for blockchains that are using GPU mining and where procuring mining capacity is feasible. The blockchain is updated to add an additional rule to the mining reward system. Something like:</p><blockquote>A legacy miner has more blocks mined mined between one and two weeks ago, than in the last week. The SHA of a new block must satisfy the equation “SHA(block) % 4 = 0” for non-legacy miners.</blockquote><p>Such a rule will have two outcomes: first, to perform a 51% attack, you now need to have 51% running for one week before you can actually take control of the blockchain. This gives the community time to react to the attack. This will reduce the attacker’s revenue streams.</p><p>The second outcome is not that good though, once an attacker had control of the blockchain, he or she will only require a small amount of hashrate in order to retain control of the chain. This could paralyze the blockchain. Even so, mining on a “dead” blockchain would probably not be a good source of income in the long run, and a fork could nullify this advantage if necesary.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fdd718af26c2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>