Sunday, April 14, 2019

Chaining the Blockchain to human memory

Human beings currently have no way to detect a counterfeit blockchain without a trusted source.  We connect our bitcoin software to peers and we get "blocks" of transactions that are cryptographically protected and require multiple gigawatts of power to create and protect.  We trust the source because the amount of work required for a 51% attack, we hope, is too much for any one organization to do.

I don't think we have much protection from "Sybil attacks" which is where our bitcoin software connects to a "bunch of random peers" that aren't random at all, but rather run by a single nefarious organization that will feed us a counterfeit blockchain in which they have control of some bitcoin to trick us into giving them some value in return for what will look like real bitcoin, but when we connect to the real world, those transactions will be invalid. I aim to provide relief from that problem.

If you think your bitcoin software is experiencing a "Sybil attack," you could check Ken Shirriff's blog post about stuff that should be in the blockchain that you downloaded.  The problem is that the attacker might have added all those "hidden surprises" just in case you, their victim, might check.  What they probably did not do (because it's the equivalent of doing all the work to make the blockchain about 4600 times) is ensure that their fake chain has exactly three block hashes for 12/13/13 that contain two occurrences of a double-e, and that one of the three has the smallest blockhash for that day (

000000000000000003da16c9e2b1b09dd1e366183017688ee53d01ef6aee9722

). One of the other two happens to be in a chain of transactions (chained together by the ONE output (out of several) in each transaction that was spent) which put an image of Nelson Mandela into the blockchain (read Ken's post to learn more).

My interest, however, is in relieving you of the necessity to find any blog post.  I'm going to help you memorize aspects of the real blockchain so you can verify them without trusting anyone but your own memory.

My plan is that each day, I will look through the previous day's blocks as reported by blockchain.com, and run the Golly program I wrote using the merkle root on the block with the smallest block hash, and report the block height and post the image on which the program stabilizes.  For example, the smallest block hash for 4/12/19 was for block 571383,  which hash started with 0000000000000000000071, and if you use the merkle root from that block in my program, you get this image:
... in which the object in the lower left corner is called a "glider" because it will just keep moving (in this case, down and to the right).
If you do the work of visiting the block to get the merkle root, installing Golly and adding my script to it, and running that script against the merkle root, you'll see that it creates the image above.  Now you can choose a memorable image from the following list and try that one.  Once you've done it a few times, you'll know how, and if you remember what the end result looks like and the block height or the date, you'll have a very high bar for any Sybil attacker to pass using Bitcoin Core:
  1. Click Help | Debug Window
  2. Click the "Console" tab.
  3. Into the command entry box at the bottom, type "getblockhash " and then the blockheight I report below and hit enter.
  4. Copy the answer (a long hex string).
  5. Enter the command "getblock " and then paste that "hash" and hit enter.
  6. Scroll up to the top of the output and copy the "merkle root."
  7. Run Golly, run my script, and paste the merkle root in the input box.
  8. Verify that it produces the result you remember.
Troubleshooting:
Let's say you can't find this post, but you remember the date and the image.  You need to get the block height.  So do this:
  1. Visit https://www.blockchain.com/explorer (Click "Data" from the front page).
  2. Scroll down to where blocks are reported and select "View More".
  3. Click the "Previous" link at the top.  This changes your browser URL to the format you need to look at blocks mined on other dates.
  4. Find the Unix Timestamp for the date you chose, and tack three digits on the end (blockchain.com uses milliseconds since epoch) and replace the number at the end of the URL from the previous step with this new number and hit enter.
  5. Search on the page for a long string of zeroes.  I use Firefox's search feature (CTRL-F), so as I type zeroes, it jumps to each successive hit.  At some point, I add one more zero and there are no hits.  Now I can use the next-hit and previous-hit buttons (after removing that extra zero) to figure out which one is the smallest.
  6. You'll see (perhaps even recognize) the block height you forgot there on the left, so you can just copy it and use that in the process above.
What if none of these images speak to me?  Then use a significant date.  You can run the procedure above right now using your birthday and, assuming you have an accurate blockchain, make the image and set it as your screen saver. Make a new one each year.  The series would be your birthdays, rendered in Life using the most-work (smallest hash) merkle roots from Bitcoin's blockchain.


4/14/19, block 571579, 0000000000000000000027
The left-most thing is a glider.
4/15/19 has not yet ended, so you'll have to wait.