<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 02/06/2014 11:03 AM, i go bananas
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAO=D1chAuqfpv946sJk0crt1zqFj6bPkBgTW433ViZNkSMFaEA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">&gt;<span
            style="font-family:HelveticaNeue,'Helvetica
            Neue',Helvetica,Arial,'Lucida
            Grande',sans-serif;font-size:16px">In what way?</span></div>
        <div class="gmail_extra">
          <span style="font-family:HelveticaNeue,'Helvetica
            Neue',Helvetica,Arial,'Lucida
            Grande',sans-serif;font-size:16px"><br>
          </span></div>
        <div class="gmail_extra"><span
            style="font-family:HelveticaNeue,'Helvetica
            Neue',Helvetica,Arial,'Lucida
            Grande',sans-serif;font-size:16px">that's what i want to
            know! &nbsp;</span></div>
      </div>
    </blockquote>
    <br>
    I don't know the specifics, but I think both cryptography and
    finance are areas where the feature of "everything is a float"
    actually gets in the way.&nbsp; In either case you cannot afford to lose
    precision.<br>
    <br>
    But you can prototype some of the features of a cryptocurrency in
    Pd.&nbsp; For example, Bitcoin uses the hashcash algorithm to verify each
    block of the transaction database.&nbsp; (If I understand it correctly
    it's like brute-forcing SHA256 keys, although they never completely
    succeed.)&nbsp; The miners basically start a counter, do a mathematical
    function on the value plus the previous value from the last entry in
    the transaction database, and finally check if the output has a
    certain number of leading zeros.<br>
    <br>
    If you ignore for the moment the counter and the mathematical
    function, you can see how the process works.&nbsp; Attached is a patch
    that just keeps spitting out pseudo-random numbers between 0 and 1
    until all of the [random] objects happen to output zeros.&nbsp; It's
    essentially like a slot machine that keeps playing until you win.&nbsp;
    Now notice that when you hook up another [random] to the chain you
    double the average time it takes to find a "winner".&nbsp; Add enough
    [random] objects to the chain and you will quickly hit a point where
    you can't compute a "winner" at all (even if you change the patch to
    compute answers as fast as possible).<br>
    <br>
    Bitcoin's "block difficulty" uses the same principle.&nbsp; The software
    has a hardcoded rule that it should take 10 minutes to find a
    "winner".&nbsp; But instead of using a bunch of binary values, it uses a
    single number and requires the "winner" to be below a certain value
    (which is equivalent to counting the leading zeros in the
    representation of the number).&nbsp; Over a certain number of days it
    measures the average time it takes the network to compute a
    "winner".&nbsp; If it's way less than 10 minutes on average then the
    software automatically does the equivalent of adding a [random] to
    the patch to make it twice as hard.&nbsp; If it takes too long then the
    software removes a [random].&nbsp; The actual algo is probably more
    sophisticated but that's what it boils down to.<br>
    <br>
    Now, let's say you hook up 50 [random] objects in that patch and
    happen to find a "winner".&nbsp; That'd be pretty spectacular, but how do
    you convince everyone that you are being truthful about your claim?&nbsp;
    This is where the hashing function and the counter come into play.&nbsp;
    Instead of the attached patch, imagine a [hash] abstraction that
    takes a counter value in the left inlet and the previous transaction
    hash in the right inlet.&nbsp; It will output a seemingly unrelated
    number in response to the input, but that number will be unique to
    the input you give it (or so close to unique that we can just call
    it unique).&nbsp; That's what a hashing function does.&nbsp; So you
    essentially do the same thing you did above, except you're looking
    for leading zeros in a single number rather than the collective
    output of a bunch of [random] objects.<br>
    <br>
    When you hit a "winner" you then broadcast your counter value and
    the new transactions to the rest of the network to add to the
    database.&nbsp; The rest of the network already has the previous entries
    in the transaction database, so they can take those with your
    counter value and verify that the resulting hash actually has the
    correct number of leading zeros.&nbsp; Then everyone starts working on
    the next "winner".&nbsp; And why do they do that instead of trying to lie
    and say they were the one that actually found the "winner"?&nbsp; Because
    the first new transaction in the database is the real winner giving
    50 bitcoins to themselves, and that transaction uses public key
    cryptography to ensure that it can't be forged or changed.<br>
    <br>
    One last thing-- the hashing function is designed so that it's
    extremely difficult (read: impossible) to start with a hash value
    that has the required number of leading zeros and work backwards to
    figure out the right counter value.&nbsp; Like a slot machine, you have
    to just keep trying until win.&nbsp; And just like a slot machine, if
    someone can figure out how get a winner without putting in the same
    work/money everybody else does, then the entire system breaks down.<br>
    <br>
    -Jonathan<br>
  </body>
</html>