francescomecca.eu/output/index-14.html

270 lines
35 KiB
HTML
Raw Normal View History

2018-11-10 18:19:00 +01:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Caught in the Net (old posts, page 14) | Caught in the Net</title>
2018-11-10 18:32:04 +01:00
<link rel="stylesheet" href="assets/blog/fonts/opensans.css">
<link href="assets/blog/css/normalize.css" rel="stylesheet" type="text/css">
<link href="assets/blog/css/cayman.css" rel="stylesheet" type="text/css">
2018-11-10 18:19:00 +01:00
<meta name="theme-color" content="#5670d4">
<meta name="generator" content="Nikola (getnikola.com)">
<link rel="alternate" type="application/rss+xml" title="RSS" hreflang="en" href="rss.xml">
<link rel="canonical" href="francescomecca.eu/index-14.html">
<link rel="prev" href="index-15.html" type="text/html">
<link rel="next" href="index-13.html" type="text/html">
</head>
<body>
<div id="container">
<section class="page-header"><h1 class="project-name">
Caught in the Net
</h1>
<h2 class="project-tagline">La rete ti cattura ma libera il pensiero</h2>
<a class="btn" href=".">Home</a>
<a class="btn" href="pages/about/">About me</a>
<a class="btn" href="pages/contattami/">Contact me</a>
<a class="btn" href="archiveall.html">Archive</a>
<a class="btn" href="rss.xml">RSS</a>
<a class="btn" href="http://francescomecca.eu/git/pesceWanda">Personal Git</a>
<a class="btn" href="https://github.com/FraMecca">Github</a>
2023-08-30 18:10:14 +02:00
<a class="btn" href="https://lezzo.org/git/public/Curriculum_vitae/raw/master/latex.dir/francesco_mecca_cv_eng.pdf">Curriculum</a>
2018-11-10 18:19:00 +01:00
</section><section class="main-content"><div class="posts">
<article class="post"><header><h1 class="post-title"><a href="blog/2016/5/15/genetic-alg/" class="u-url">Interpolation using a genetic algorithm</a></h1>
</header><div>
<span class="post-date">15 May 2016</span>
</div>
<br><div class="e-content entry-content">
<p>This weekend I was in Milan to get a visa and I had the opportunity to work with a friend, Michele, on genetic algorithms.
It was the first time I dig up in such field and it was very exciting.
In this post I want to explain some bits of our work.</p>
<h3>A brief introduction to GA</h3>
<p>A genetic algorithm is a search/optimization algorithm that uses an heuristic approach to reduce the search space and evolve gradually to a solution.</p>
<h5>Population</h5>
<p>It is an algorithm that has its root in the theory of natural selectioni by Charles Darwin.
The main components of a GA are:</p>
<ul>
<li>the population, that concentrate all the available solutions at a given time;</li>
<li>the fitness function, that gives an approximation of the quality of the solution codified by a given member of the population.</li>
</ul>
<p>In a GA the first thing to do is to generate a population.</p>
<p>A population is a group of objects with given attributes, usually a string, and they contains in some form the solution (usually inside a string); the first population is randomly generated and contains a big number of solutions, but not every solution (this is not a bruteforce approach).</p>
<p>After this step the fitness functions evaluates the quality of every solution that a given member carries: the evaluation should be considered from a bottom up point of view.</p>
<h5>Reproduction</h5>
<p>Now, as in Darwin's theory of evolution, the member of the population are going to "reproduce": two members are going to be coupled to generate a new member of the second generation and every child member will contain a solution that is the product of the original genes of their parent members.</p>
<p>This time the reproduction of the population into a second one is not entirely random. The fitness function gives us an approximation of the quality of every gene that a member carries and by the rule of the "survival by the fittest" the probability that a member is going to reproduce with another one is proportional to the quality of its genes.</p>
<p>When we have a second generation of members we can recur on our GA and generate a third generation. From this point we can recur until we converge to a solution that is common to every member, or at least that is suited to our needs.</p>
<h5>Mutation</h5>
<p>Actually, in some cases, a mutation function can be added, so that, like in real world, some times the genes are "scrambled" indipendently from the fitness function.</p>
<p>There is more to a GA, for example we could talk about possible ways of storing the genes inside a member or when to use mutation, anyway I want to stop here and continue with an analysis of my problem.</p>
<h3>Interpolating a function using a GA</h3>
<p>Me and Michele decided to spend some time developing a little python script to explore GA capabilities and we decided to interpolate some points on a cartesian plane.</p>
<p>Our program, that is available <a href="http://francescomecca.eu:3000/pesceWanda/interpol_genetica">here</a> uses a class to define the various members of the population and a string for the genes, a class as well for the points on the plane.</p>
<p>The fitness function is not as precise as it should be because this is only a proof of concept:</p>
<p>.. code:: python</p>
2023-08-30 18:10:14 +02:00
<pre class="code literal-block"><span class="n">mutationProbability</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">0.1</span><span class="w"></span>
2021-12-02 16:47:14 +01:00
<span class="n">rangeLimit</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">5</span><span class="w"></span>
<span class="n">def</span><span class="w"> </span><span class="n">fitness</span><span class="p">(</span><span class="n">item</span><span class="p">,</span><span class="w"> </span><span class="n">pointList</span><span class="p">,</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="err">:</span><span class="w"></span>
<span class="w"> </span><span class="k">value</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="w"></span>
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">p</span><span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="nl">pointList</span><span class="p">:</span><span class="w"></span>
<span class="w"> </span><span class="n">y</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="w"></span>
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="k">range</span><span class="p">(</span><span class="n">n</span><span class="p">)</span><span class="err">:</span><span class="w"></span>
<span class="w"> </span><span class="n">y</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="n">item</span><span class="p">.</span><span class="n">gene</span><span class="o">[</span><span class="n">i</span><span class="o">]</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">pow</span><span class="p">(</span><span class="n">p</span><span class="p">.</span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="n">i</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">result</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="p">(</span><span class="nf">abs</span><span class="w"> </span><span class="p">(</span><span class="n">p</span><span class="p">.</span><span class="n">y</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">y</span><span class="p">)</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="n">rangeLimit</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="k">result</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="mi">0</span><span class="err">:</span><span class="w"></span>
<span class="w"> </span><span class="k">result</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="w"></span>
<span class="w"> </span><span class="k">value</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="k">result</span><span class="w"></span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="k">value</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="n">n</span><span class="w"></span>
2018-11-10 18:19:00 +01:00
</pre>
<p>item is just a member of the population, poinList is the list of points and n is the number of points (n - 1 is the grade of the function).</p>
2023-08-30 18:10:14 +02:00
<pre class="code literal-block"><span class="k">for</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="k">range</span><span class="p">(</span><span class="n">n</span><span class="p">)</span><span class="err">:</span><span class="w"></span>
2021-12-02 16:47:14 +01:00
<span class="w"> </span><span class="n">y</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="n">item</span><span class="p">.</span><span class="n">gene</span><span class="o">[</span><span class="n">i</span><span class="o">]</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">pow</span><span class="p">(</span><span class="n">p</span><span class="p">.</span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="n">i</span><span class="p">)</span><span class="w"></span>
2018-11-10 18:19:00 +01:00
</pre>
<p>this piece of code gives us the value of the function encoded in the genes in the points of pointList;</p>
2023-08-30 18:10:14 +02:00
<pre class="code literal-block"><span class="nb">result</span> <span class="o">=</span> <span class="mi">1</span> <span class="o">-</span> <span class="ss">(</span><span class="nv">abs</span> <span class="ss">(</span><span class="nv">p</span>.<span class="nv">y</span> <span class="o">-</span> <span class="nv">y</span><span class="ss">)</span> <span class="o">/</span> <span class="nv">rangeLimit</span><span class="ss">)</span>
2021-12-02 16:47:14 +01:00
<span class="k">if</span> <span class="nb">result</span> <span class="o">&lt;</span> <span class="mi">0</span>:
<span class="nb">result</span> <span class="o">=</span> <span class="mi">0</span>
2018-11-10 18:19:00 +01:00
</pre>
<p>while here the script stores 1 - the previous result because if the GA has yield a good result there should be distance = 0 from the function evaluated and the points; If this is the case, the fitness function should attribute the highest possible reproduction probability for that member.
At the end the fitness function returns the total value over the number of points evaluated.</p>
<p>As you can see this fitness function is by no means an optimal one. The reproduction probability is higher for functions that crosses some points and are really distant from others rather than for functions that are closer to every point but crosses none.
Anyway for simple cases the GA yields good results, as an example for points (0 0), (1 4), (2 9) one of the member with the highest reproduction probability has this function in its genes:</p>
2023-08-30 18:10:14 +02:00
<pre class="code literal-block">-0.0487839869993989 * x^0 + 4.600339125358671 * x^1 + -0.2780958075230644 * x^2
2018-11-10 18:19:00 +01:00
</pre>
<p>that crosses this points: (0 -0.0488), (1 4.2735), (2 8.0395) given 80 iterations, initial population of 600 members and a two digit approximation.</p>
<p>For a more precise computation a higher population size and a really high number of iterations should be used.</p>
</div>
</article><br><hr>
<br><article class="post"><header><h1 class="post-title"><a href="blog/2016/5/3/satoshisignature/" class="u-url">Why Wright's proof is a fake</a></h1>
</header><div>
<span class="post-date">03 May 2016</span>
</div>
<br><div class="e-content entry-content">
<p>I explained in my previous <a href="http://francescomecca.eu/pescewanda/2016/04/17/wright-nakamoto/">post</a> (in italian) that the signature that Wright provided as a public proof is in fact invalid.
I want to explain briefly how you could check this claim.
The key in Wright's <a href="http://www.drcraigwright.net/jean-paul-sartre-signing-significance/">post</a> is this:</p>
2023-08-30 18:10:14 +02:00
<pre class="code literal-block"><span class="nb">-------------------------</span><span class="c"> Signature File </span><span class="nb">-------------------------</span><span class="c"></span>
2021-12-02 16:47:14 +01:00
<span class="c">MEUCIQDBKn1Uly8m0UyzETObUSL4wYdBfd4ejvtoQfVcNCIK4AIgZmMsXNQWHvo6KDd2Tu6euEl1</span>
<span class="c">3VTC3ihl6XUlhcU</span><span class="nb">+</span><span class="c">fM4=</span>
<span class="nb">-------------------------</span><span class="c"> End Signature </span><span class="nb">--------------------------</span><span class="c"></span>
2018-11-10 18:19:00 +01:00
</pre>
<p>Now we can use some bash utilities:</p>
<ul>
<li>base64, that translates encoded ASCII text;</li>
<li>hexdump, that displays hexadecimal contents from the input;</li>
<li>cut, used to remove the binary part of the input;</li>
<li>tr, used to delete spaces and carriage return from the input;</li>
</ul>
2023-08-30 18:10:14 +02:00
<pre class="code literal-block">base64 -d &lt;&lt;&lt;'MEUCIQDBKn1Uly8m0UyzETObUSL4wYdBfd4ejvtoQfVcNCIK4AIgZmMsXNQWHvo6KDd2Tu6euEl13VTC3ihl6XUlhcU+fM4=' | hexdump -C| cut -b 11-60| tr -d ' \n'
2018-11-10 18:19:00 +01:00
3045022100c12a7d54972f26d14cb311339b5122f8c187417dde1e8efb6841f55c34220ae0022066632c5cd4161efa3a2837764eee9eb84975dd54c2de2865e9752585c53e7cce
</pre>
<p>Let's analyze the command one by one:</p>
<ul>
<li>
<code>base64 -d</code> decodes the redirected string, the output is some gibberish characters so I won't display them here;</li>
<li>
<code>hexdump -C</code> is used with a pipe to convert to hexadecimal:</li>
</ul>
2023-08-30 18:10:14 +02:00
<pre class="code literal-block"><span class="mf">00000000</span><span class="w"> </span><span class="mf">30</span><span class="w"> </span><span class="mf">45</span><span class="w"> </span><span class="mf">02</span><span class="w"> </span><span class="mf">21</span><span class="w"> </span><span class="mf">00</span><span class="w"> </span><span class="n">c1</span><span class="w"> </span><span class="mf">2</span><span class="n">a</span><span class="w"> </span><span class="mf">7</span><span class="n">d</span><span class="w"> </span><span class="mf">54</span><span class="w"> </span><span class="mf">97</span><span class="w"> </span><span class="mf">2</span><span class="n">f</span><span class="w"> </span><span class="mf">26</span><span class="w"> </span><span class="n">d1</span><span class="w"> </span><span class="mf">4</span><span class="n">c</span><span class="w"> </span><span class="n">b3</span><span class="w"> </span><span class="mf">11</span><span class="w"> </span><span class="err">|</span><span class="mf">0</span><span class="n">E</span><span class="mf">.</span><span class="err">!</span><span class="mf">..</span><span class="o">*</span><span class="err">}</span><span class="n">T</span><span class="mf">.</span><span class="o">/</span><span class="err">&amp;</span><span class="mf">.</span><span class="n">L</span><span class="mf">..</span><span class="err">|</span><span class="w"></span>
<span class="mf">00000010</span><span class="w"> </span><span class="mf">33</span><span class="w"> </span><span class="mf">9</span><span class="n">b</span><span class="w"> </span><span class="mf">51</span><span class="w"> </span><span class="mf">22</span><span class="w"> </span><span class="n">f8</span><span class="w"> </span><span class="n">c1</span><span class="w"> </span><span class="mf">87</span><span class="w"> </span><span class="mf">41</span><span class="w"> </span><span class="mf">7</span><span class="n">d</span><span class="w"> </span><span class="n">de</span><span class="w"> </span><span class="mf">1</span><span class="n">e</span><span class="w"> </span><span class="mf">8</span><span class="n">e</span><span class="w"> </span><span class="n">fb</span><span class="w"> </span><span class="mf">68</span><span class="w"> </span><span class="mf">41</span><span class="w"> </span><span class="n">f5</span><span class="w"> </span><span class="err">|</span><span class="mf">3.</span><span class="n">Q</span><span class="s">"...A}....hA.|</span><span class="w"></span>
<span class="mf">00000020</span><span class="w"> </span><span class="mf">5</span><span class="n">c</span><span class="w"> </span><span class="mf">34</span><span class="w"> </span><span class="mf">22</span><span class="w"> </span><span class="mf">0</span><span class="n">a</span><span class="w"> </span><span class="n">e0</span><span class="w"> </span><span class="mf">02</span><span class="w"> </span><span class="mf">20</span><span class="w"> </span><span class="mf">66</span><span class="w"> </span><span class="mf">63</span><span class="w"> </span><span class="mf">2</span><span class="n">c</span><span class="w"> </span><span class="mf">5</span><span class="n">c</span><span class="w"> </span><span class="n">d4</span><span class="w"> </span><span class="mf">16</span><span class="w"> </span><span class="mf">1</span><span class="n">e</span><span class="w"> </span><span class="n">fa</span><span class="w"> </span><span class="mf">3</span><span class="n">a</span><span class="w"> </span><span class="err">|\</span><span class="mf">4</span><span class="s">"... fc,\....:|</span><span class="w"></span>
<span class="mf">00000030</span><span class="w"> </span><span class="mf">28</span><span class="w"> </span><span class="mf">37</span><span class="w"> </span><span class="mf">76</span><span class="w"> </span><span class="mf">4</span><span class="n">e</span><span class="w"> </span><span class="n">ee</span><span class="w"> </span><span class="mf">9</span><span class="n">e</span><span class="w"> </span><span class="n">b8</span><span class="w"> </span><span class="mf">49</span><span class="w"> </span><span class="mf">75</span><span class="w"> </span><span class="n">dd</span><span class="w"> </span><span class="mf">54</span><span class="w"> </span><span class="n">c2</span><span class="w"> </span><span class="n">de</span><span class="w"> </span><span class="mf">28</span><span class="w"> </span><span class="mf">65</span><span class="w"> </span><span class="n">e9</span><span class="w"> </span><span class="err">|</span><span class="p">(</span><span class="mf">7</span><span class="n">vN</span><span class="mf">...</span><span class="n">Iu</span><span class="mf">.</span><span class="n">T</span><span class="mf">..</span><span class="p">(</span><span class="n">e</span><span class="mf">.</span><span class="err">|</span><span class="w"></span>
<span class="mf">00000040</span><span class="w"> </span><span class="mf">75</span><span class="w"> </span><span class="mf">25</span><span class="w"> </span><span class="mf">85</span><span class="w"> </span><span class="n">c5</span><span class="w"> </span><span class="mf">3</span><span class="n">e</span><span class="w"> </span><span class="mf">7</span><span class="n">c</span><span class="w"> </span><span class="n">ce</span><span class="w"> </span><span class="err">|</span><span class="n">u%</span><span class="mf">..</span><span class="o">&gt;</span><span class="err">|</span><span class="mf">.</span><span class="err">|</span><span class="w"></span>
2018-11-10 18:19:00 +01:00
</pre>
<ul>
<li>cut -b 11-60 displays only the characters from column 11 to 60:</li>
</ul>
2023-08-30 18:10:14 +02:00
<pre class="code literal-block"><span class="mf">30</span><span class="w"> </span><span class="mf">45</span><span class="w"> </span><span class="mf">02</span><span class="w"> </span><span class="mf">21</span><span class="w"> </span><span class="mf">00</span><span class="w"> </span><span class="n">c1</span><span class="w"> </span><span class="mf">2</span><span class="n">a</span><span class="w"> </span><span class="mf">7</span><span class="n">d</span><span class="w"> </span><span class="mf">54</span><span class="w"> </span><span class="mf">97</span><span class="w"> </span><span class="mf">2</span><span class="n">f</span><span class="w"> </span><span class="mf">26</span><span class="w"> </span><span class="n">d1</span><span class="w"> </span><span class="mf">4</span><span class="n">c</span><span class="w"> </span><span class="n">b3</span><span class="w"> </span><span class="mf">11</span><span class="w"> </span>
<span class="mf">33</span><span class="w"> </span><span class="mf">9</span><span class="n">b</span><span class="w"> </span><span class="mf">51</span><span class="w"> </span><span class="mf">22</span><span class="w"> </span><span class="n">f8</span><span class="w"> </span><span class="n">c1</span><span class="w"> </span><span class="mf">87</span><span class="w"> </span><span class="mf">41</span><span class="w"> </span><span class="mf">7</span><span class="n">d</span><span class="w"> </span><span class="n">de</span><span class="w"> </span><span class="mf">1</span><span class="n">e</span><span class="w"> </span><span class="mf">8</span><span class="n">e</span><span class="w"> </span><span class="n">fb</span><span class="w"> </span><span class="mf">68</span><span class="w"> </span><span class="mf">41</span><span class="w"> </span><span class="n">f5</span><span class="w"> </span>
<span class="mf">5</span><span class="n">c</span><span class="w"> </span><span class="mf">34</span><span class="w"> </span><span class="mf">22</span><span class="w"> </span><span class="mf">0</span><span class="n">a</span><span class="w"> </span><span class="n">e0</span><span class="w"> </span><span class="mf">02</span><span class="w"> </span><span class="mf">20</span><span class="w"> </span><span class="mf">66</span><span class="w"> </span><span class="mf">63</span><span class="w"> </span><span class="mf">2</span><span class="n">c</span><span class="w"> </span><span class="mf">5</span><span class="n">c</span><span class="w"> </span><span class="n">d4</span><span class="w"> </span><span class="mf">16</span><span class="w"> </span><span class="mf">1</span><span class="n">e</span><span class="w"> </span><span class="n">fa</span><span class="w"> </span><span class="mf">3</span><span class="n">a</span><span class="w"> </span>
<span class="mf">28</span><span class="w"> </span><span class="mf">37</span><span class="w"> </span><span class="mf">76</span><span class="w"> </span><span class="mf">4</span><span class="n">e</span><span class="w"> </span><span class="n">ee</span><span class="w"> </span><span class="mf">9</span><span class="n">e</span><span class="w"> </span><span class="n">b8</span><span class="w"> </span><span class="mf">49</span><span class="w"> </span><span class="mf">75</span><span class="w"> </span><span class="n">dd</span><span class="w"> </span><span class="mf">54</span><span class="w"> </span><span class="n">c2</span><span class="w"> </span><span class="n">de</span><span class="w"> </span><span class="mf">28</span><span class="w"> </span><span class="mf">65</span><span class="w"> </span><span class="n">e9</span><span class="w"> </span>
<span class="mf">75</span><span class="w"> </span><span class="mf">25</span><span class="w"> </span><span class="mf">85</span><span class="w"> </span><span class="n">c5</span><span class="w"> </span><span class="mf">3</span><span class="n">e</span><span class="w"> </span><span class="mf">7</span><span class="n">c</span><span class="w"> </span><span class="n">ce</span><span class="w"> </span>
2018-11-10 18:19:00 +01:00
</pre>
<ul>
<li>
<code>tr -d ' \n'</code> is used to delete spaces and carriage returns from the output so that is shown in one line and it gives us the final result:</li>
</ul>
2023-08-30 18:10:14 +02:00
<pre class="code literal-block"><span class="mf">3045022100</span><span class="n">c12a7d54972f26d14cb311339b5122f8c187417dde1e8efb6841f55c34220ae0022066632c5cd4161efa3a2837764eee9eb84975dd54c2de2865e9752585c53e7cce</span><span class="w"></span>
2018-11-10 18:19:00 +01:00
</pre>
<p>If you noticed, there is also another cleartext string at the beginning of Wright's post:</p>
2023-08-30 18:10:14 +02:00
<pre class="code literal-block">$ base64 -d <span class="o">&lt;&lt;&lt;</span><span class="s1">'IFdyaWdodCwgaXQgaXMgbm90IHRoZSBzYW1lIGFzIGlmIEkgc2lnbiBDcmFpZyBXcmlnaHQsIFNhdG9zaGkuCgo='</span>
2018-11-10 18:19:00 +01:00
Wright, it is not the same as <span class="k">if</span> I sign Craig Wright, Satoshi.
</pre>
<p>Now let's head to blockchain.info.
Blockchain.info has a little <a href="https://blockchain.info/decode-tx">utility</a> to get hexadecimal informations out of a transaction on the blockchain, so let's use it to get the related info about this transaction:</p>
<p><a href="https://blockchain.info/tx/828ef3b079f9c23829c56fe86e85b4a69d9e06e5b54ea597eef5fb3ffef509fe">tx/828ef3b079f9c23829c56fe86e85b4a69d9e06e5b54ea597eef5fb3ffef509fe</a>
<a href="https://blockchain.info/tx/828ef3b079f9c23829c56fe86e85b4a69d9e06e5b54ea597eef5fb3ffef509fe?format=hex">tx/828ef3b079f9... in hexadecimal</a></p>
<p>As you can see the entire output of the first bash command, that is</p>
2023-08-30 18:10:14 +02:00
<pre class="code literal-block"><span class="mf">3045022100</span><span class="n">c12a7d54972f26d14cb311339b5122f8c187417dde1e8efb6841f55c34220ae0022066632c5cd4161efa3a2837764eee9eb84975dd54c2de2865e9752585c53e7cce</span><span class="w"></span>
2018-11-10 18:19:00 +01:00
</pre>
<p>is contained in:</p>
2023-08-30 18:10:14 +02:00
<pre class="code literal-block">"script":"483045022100c12a7d54972f26d14cb311339b5122f8c187417dde1e8efb6841f55c34220ae0022066632c5cd4161efa3a2837764eee9eb84975dd54c2de2865e9752585c53e7cce01"
2018-11-10 18:19:00 +01:00
</pre>
<p>except for the 48 at the beginning and the 01 at the end.</p>
<p>That is a signature hash:
this <a href="https://en.bitcoin.it/wiki/List_of_address_prefixes">page</a> explains that the 48 is just a decimal prefix given to uncompressed transactions, and the 01 at the end is just a SIGHASH_ALL <a href="https://bitcoin.org/en/glossary/signature-hash">code</a> that flags the end of the signature.</p>
<h3>So, is it a fake?</h3>
<p>Yes, indeed.
At the end, I ask, why would you choose anything else than the easiest and most conclusive way to prove something?</p>
<p><img alt='Wright "signs" the blockchain' src="wp-content/uploads/2016/satosh.jpg"></p>
</div>
</article><br><hr>
<br><article class="post"><header><h1 class="post-title"><a href="blog/2016/4/17/wright-nakamoto/" class="u-url">#JeSuisSatoshiNakamoto</a></h1>
</header><div>
<span class="post-date">17 April 2016</span>
</div>
<br><div class="e-content entry-content">
<p>Ieri mattina appena sveglio mi sono imbattuto in questo <a href="http://gavinandresen.ninja/satoshi">post</a> di Gavin Andresen, uno dei più importanti membri della Bitcoin Foundation.
In quelle righe Gavin attribuisce l'identità di Satoshi Nakamoto, il padre dei Bitcoin, a Craig Wright, un imprenditore australiano.
Sono stato subito scosso dall'articolo, dove si spiega:</p>
<blockquote>
<p>Part of that time was spent on a careful cryptographic verification of messages signed with keys that only Satoshi should possess.</p>
</blockquote>
<p>Continuo la mia navigazione imbattendomi nei seguenti titoli di alcune testate italiane:</p>
<ul>
<li>Repubblica: <a href="http://www.repubblica.it/tecnologia/2016/05/02/news/l_imprenditore_australiano_craig_wright_sono_io_il_creatore_del_bitcoin_-138896449/?ref=HREC1-12%22">"Bitcoin: il creatore sono io", l'imprenditore australiano Craig Wright esce allo scoperto</a>
</li>
<li>La Stampa: <a href="http://www.lastampa.it/2016/05/02/economia/imprenditore-australiano-fa-coming-out-sono-linventore-del-bitcoin-l6G9XXHlFGXOavjRv4snQL/pagina.html">Imprenditore australiano fa coming out: sono linventore del Bitcoin</a>
</li>
<li>Il corriere della sera: <a href="http://www.corriere.it/economia/16_maggio_02/bitcoin-la-bbc-padre-l-australiano-craig-wright-ba2124ec-1043-11e6-aba7-a1898801ab6b.shtml">per la «Bbc» il padre è laustraliano Craig Wright</a>
</li>
<li>Il sole 24 ore: <a href="http://www.ilsole24ore.com/art/finanza-e-mercati/2016-05-02/scoperto-l-inventore-bitcoin-e-imprenditore-australiano-111525.shtml?uuid=ACMVhYJD">Scoperto linventore del Bitcoin: è un imprenditore australiano</a>
</li>
<li>Il Post: <a href="http://www.ilpost.it/2016/05/02/craig-wright-bitcoin/"> questuomo linventore dei Bitcoin?</a>
</li>
</ul>
<p>Gli articoli da clickbait e la completa mancanza di spiegazioni tecniche hanno fatto squillare immediatamente il mio campanello antibufala.
Voglio approfondire la questione in questo post.</p>
<h3>Prova numero 1: il post ufficiale di Wright</h3>
<p>Craig Wright in data 2 maggio ha pubblicato sul suo sito personale questo <a href="http://www.drcraigwright.net/jean-paul-sartre-signing-significance/">articolo</a> dove spiega che utilizzando 10 chiavi private associate agli indirizzi utilizzati da Satoshi ha firmato dei messaggi inviati da alcuni giornalisti e mostra gli script utilizzati per la firma sotto forma di screenshots.
Prima di tutto, ad un'analisi più attenta si vede che lo script di Wright ha un <a href="http://imgur.com/IPDPXZm">typo</a> e quindi non è eseguibile.
Il motivo per cui ho dubitato maggiormente però è il fatto che nonostante Wright abbia speso molto tempo nel suo blog post ha evitato di darci una prova riproducibile del fatto che la chiave privata di uno dei genesis block sia in suo possesso.
Quindi il post di Wright non basta a verificare che egli sia in effetti Nakamoto.</p>
<h3>Prova numero 2: Jon Matonis e Gavin Andresen</h3>
<p>Il primo post che ho letto e che inizialmente mi aveva convinto della sincerità di Wright è stato il quello di Andersen. A poche ore da quella lettura ho appreso grazie ad un <a href="https://twitter.com/petertoddbtc/status/727078284345917441">tweet</a> che è stato revocato a Gavin l'accesso ai commit relativi allo sviluppo di Bitcoin in quanto si sospetta che sia stato hackerato.
Così il post di Gavin ha perso ogni valore nel tentativo di chiarire la vicenda.
Invece ho ancora molti dubbi relativamente al post di <a href="http://themonetaryfuture.blogspot.sg/2016/05/how-i-met-satoshi.html">Matonis</a> (uno dei fondatori della Bitcoin Foundation) dove afferma che a Marzo Wright si è rivelato a lui firmando in sua presenza un messaggio con le chiavi crittografiche del blocco #1 e del blocco #9.
Queste sarebbero le prove decisive per dimostrare l'autenticità delle affermazioni di Wright, ma non ne abbiamo prove pubbliche e riproducibili. Anzi, dal post si deduce che Wright abbia utilizzato il suo laptop personale piuttosto che un computer sicuramente non manomesso in precedenza.</p>
<h3>Prova numero 3: Gavin su Reddit</h3>
<p>Alcuni redditor in risposta al post di Gavin hanno chiesto a lui stesso maggiori dettagli. Questa è stata la <a href="https://www.reddit.com/r/btc/comments/4hfyyo/gavin_can_you_please_detail_all_parts_of_the/d2plygg">risposta</a> di Gavin:</p>
<blockquote>
<p>Craig signed a message that I chose ("Gavin's favorite number is eleven. CSW" if I recall correctly) using the private key from block number 1.
That signature was copied on to a clean usb stick I brought with me to London, and then validated on a brand-new laptop with a freshly downloaded copy of electrum.
I was not allowed to keep the message or laptop (fear it would leak before Official Announcement).
I don't have an explanation for the funky OpenSSL procedure in his blog post.</p>
</blockquote>
<p>Dall'articolo di <a href="https://www.wired.com/2016/05/craig-wright-privately-proved-hes-bitcoins-creator/">Wired</a>:</p>
<blockquote>
<p>Andresen says an administrative assistant working with Wright left to buy a computer from a nearby store, and returned with what Andresen describes as a Windows laptop in a “factory-sealed” box.</p>
</blockquote>
<p>Naturalmente queste non sono prove sufficenti poichè non abbiamo la certezza che il portatile sia stato manomesso in anticipo.</p>
<h3>Prova numero 4: gli articoli di BBC ed Economist</h3>
<p>Wright ha avuto un colloquio privato con la <a href="http://www.bbc.com/news/technology-36168863">BBC</a> e un giornalista dell'Economist ed ha fornito delle prove che loro ritengono sufficenti a verificare le sue affermazioni.
Vorrei poter andare più in profondità con le affermazioni delle due testate, ma esse stesse non forniscono alcuna dimostrazione concreta delle procedure che Wright ha eseguito.
Si legge:</p>
<blockquote>
<p>At the meeting with the BBC, Mr Wright digitally signed messages using cryptographic keys created during the early days of Bitcoin's development. The keys are inextricably linked to blocks of bitcoins known to have been created or "mined" by Satoshi Nakamoto.</p>
</blockquote>
<p>In mancanza di una spiegazione più approfondita e prettamente tecnica non vedo perchè dovrei prendere queste parole per certe.</p>
<h3>Prova numero 5: Gran Finale</h3>
<p>L'unica prova concreta che tutta la community ha a disposizione è la firma che Wright ha utilizzato per autenticarsi firmando il discorso in cui Sartre spiega perchè rinuncia al premio Nobel.
Questa firma: <code>MEUCIQDBKn1Uly8m0UyzETObUSL4wYdBfd4ejvtoQfVcNCIK4AIgZmMsXNQWHvo6KDd2Tu6euEl13VTC3ihl6XUlhcU+fM4=</code> non è altro che la versione esadecimale della <a href="https://blockchain.info/tx/828ef3b079f9c23829c56fe86e85b4a69d9e06e5b54ea597eef5fb3ffef509fe">transazione</a> che Satoshi ha fatto nel 2009.
Quella stringa (in base64) non è affatto una firma, bensì è un messaggio in chiaro: "Wright, it is not the same as if I sign Craig Wright, Satoshi.\n\n".</p>
<hr>
2023-08-30 18:10:14 +02:00
<!--![Wright firma il genesis block](http://francescomecca.eu/wp-content/uploads/satosh.jpg)--><h2>wikiHow: how to claim you're Satoshi</h2>
2018-11-10 18:19:00 +01:00
<p>Charlie Lee, il creatore dei Litecoin su medium ci ha dato una <a href="https://decentralize.today/satoshilite-1e2dad89a017#.xljsji88r">dimostrazione</a> semplice e concisa di come il vero Satoshi si sarebbe dovuto autenticare.
Non abbiamo bisogno di colloqui privati, laptop nuovi di fabbrica e screenshot di script. Nei primi blocchi, i genesis blocks, rimangono registatrate un numero sufficiente di chiavi pubbliche appartenenti al creatore della blockchain.
Chiunque dichiari di essere Satoshi deve poter firmare un messaggio utilizzando una di quelle chiavi. Questo è quello che il creatore dei Litecoin mostra in 4 righe.
Ogni altra prova è discutibile e non necessaria.</p>
<h3>EDIT 22:12</h3>
<p>Su Twitter il profilo ufficiale di Electrum <a href="https://mobile.twitter.com/ElectrumWallet/status/727366861592076288">scrive</a>:</p>
<blockquote>
<p>Note: There was no download of a signature file of electrum (.asc file) from a UK IP on Apr 7th.</p>
</blockquote>
<p>Questo significa che il 7 Aprile, quando Wright ha mostrato a Gavin le sue chiavi utilizzando Electrum, nessuna delle due parti si è preoccupata di verificare che il client fosse autentico. Questo invalida ulteriormente tutte le affermazioni di Gavin.</p>
</div>
</article><br><hr>
<br>
</div>
<div class="pagination">
<a href="index-15.html" rel="prev"></a>
<a class="pagination-item newer" href="index-15.html">Newer
</a><a class="pagination-item older" href="index-13.html">Older</a>
</div>
2023-08-30 18:10:14 +02:00
2018-11-10 18:19:00 +01:00
<footer class="site-footer" id="footer"><span> CC BY-SA 4.0 International.<br></span>
2018-11-10 18:19:11 +01:00
<span class="site-footer-credits"><a href="https://getnikola.com">Nikola</a>, <a href="https://github.com/jasonlong/cayman-theme">Cayman theme</a>.</span>
2018-11-10 18:19:00 +01:00
</footer></section>
</div>
</body>
</html>