Tuesday, October 01, 2024

sn-wallet.dat (Part 1)

For Alex More, self-proclaimed retro-computing aficionado, the Goodwill at Evans & Newhall wasn't just a thrift store, it was a treasure trove of bits and bytes, knicks and knacks. Located at the heart of Silicon Valley, in the bustling Chinatown neighborhood of San Francisco, this was where the forgotten junk of the old school computer nerds ended up. Alex loved nothing more than spending his evenings perusing through the wires and boards of old forgotten peripherals.

That one Friday evening in late August was no different. Alex sent off one last code review and then, knowing that it won't be looked at until Monday morning at the soonest, logged off his computer and packed his bag. He unlocked his vintage Schwinn bike (the one with the "I'm Anti-VAX, PDP-11 was better" sticker which got him many an angry glare), and started on his daily commute back from the Mission District. It took him 20 minutes of weaving through the standstill SFO traffic to reach Goodwill, leaving him with an hour of browsing time before the store closed.

Pickings were slim today. More and more people were realizing the worth of some of the old junk they found in their parents' attics; eBay was full of sales of old electronics at outrageous prices. Alex found a box of old wires, an IOMEGA zip drive and assorted junk, with a "$5 AS IS" sticker. That'll do for today, Alex thought, as he picked up the hefty box and made his way to the cash register.

The ride home was shorter, about 10 minutes. "Home" was a small, dilapidated studio on the first floor of a mid-century Victorian, with a 24 hour laundromat and a smoke shop below. Alex didn't really mind the noise and the bustle; in fact the low hum of the dryers running all night was somehow soothing and relaxing.

Eating a quick microwave dinner, Alex sat down to investigate the catch of the day. Most of it was useless, even for Alex. Toward the bottom of the box, Alex saw a USB thumb drive, proudly claiming that it held a whopping ... 256 MB. Okay, let's see what's inside, Alex thought.

Alex knew enough not to plug in random USB devices into his computer; It was very unlikely, but it could be a "USB Killer" which could fry his motherboard. Fortunately for such occasions, Alex had a USB voltage checker, which quickly told that him the device wasn't going to pull in massive current.

Alex booted up Tails, the in-memory Linux distro. Alex didn't really care if the USB drive had a virus - whatever the virus would do would have no permanent effect after he rebooted. Plugging in the USB drive, he saw that it held about 56 MB of data.


He opened the `photos` folder, and found a few pictures of an older man - Japanese or Korean by the looks of it. Alex wasn't surprised, there were plenty of old school Asian Americans who had worked at Sun, DEC and Netware in the good old days. There was no name or any unique identifying characteristics in any of the photos, so Alex quickly lost interest.



The `data` folder only had one file - `sn-wallet.dat`. `.dat` was a very generic extension, so he used the `file` tool to see the actual format.


Hmm, bitcoin. Alex wasn't big into crypto - he viewed it mostly as a pyramid scheme with no inherent value. So apparently this was a bitcoin wallet file which held a private key for making transactions. The last modified time for the file was supposedly April 2012, but didn't mean much; it could just have been a misconfigured system clock. Curious to probe its contents, Alex looked online for a tool to open the file.


Alex spent the next few minutes reading up on bitcoin. He wasn't sure if this was a real wallet or a test file. Even if this was real, this file might have been a backup - there may not be any spendable coins left it in. Well, there was only one way to find out. Alex looked around for any local merchants who took BTC; During the crypto boom, every mom and pop shop was dabbling in crypto, but that was way before its value sky rocketed. 

After much searching, Alex finally found a local pizza shop which still took BTC, and followed the instructions to place an order. With tip and delivery charges, a large Veggie Supreme was 0.000017 BTC (around $27).  It took some time, but finally the order was confirmed. Well, Alex thought, I guess the wallet had at least that much. 


Alex was curious to see if the recent transaction changed the wallet in any way, so he ran the command again.


Wait, Alex thought - the 'BAL' column had decreased by ... 0.000017. So the BAL column had to be the balance, the number of coins in this wallet. Alex's heart started racing as he digested the ramifications; This wallet contained 594245 bitcoins, each bitcoin was $63,907.75, for a market value of ...

$ 37,976,863,869.97.

Alex couldn't believe what he saw. This wallet contained almost 38 billion dollars worth of bitcoins! And he had paid $5 for it! This made no sense - why would someone carelessly leave such a ridiculously valuable thing at Goodwill.

On a hunch, Alex Googled the public key of the wallet, which returned thousands of hits! Alex opened one of the articles.

Satoshi Nakamoto! Even crypto-skeptic Alex knew about the legendary Nakamoto, the mysterious inventor of Bitcoin. After inventing the blockchain and nurturing the fledgling currency, Nakamoto had suddenly dropped off the face of the Earth in 2012. Even after decades, no one knew the real identity of Nakamoto and why he had not spent any of his vast fortune of bitcoins. There were multiple conspiracy theories about his real identity or even the existence of this enigmatic person.

Alex opened the photos again. Was the elderly Japanese man Nakamoto? What happened to him? How did this box end up at Goodwill? Alex speculated that Nakamoto must have died in 2012, maybe in an accident or sudden illness. Whoever was in charge of his estate wasn't privy to the fact that Nakamoto was sitting on a fortune, and must have dumped his old junk off at Goodwill. There was no way of knowing.

Alex looked at the USB key and smiled. That innocuous little thing had made him one of the richest men in the world!

First things first, Alex thought, I need to make lots of copies of this file. Alex copied the file into a password-protected archive with a ridiculously long password. He then uploaded the file to multiple file stores (Google Drive, OneDrive), and to multiple cloud stores in multiple regions (AWS, Azure, GCP).  He even printed the encrypted file out in base64 on a piece of paper, and then placed multiple copies of it in his safe and other places. The only way the file could now be lost would be an asteroid hitting the earth.

Alex froze as he realized something - all bitcoin transactions are open to the public! And he had just made a transaction using the most famous bitcoin wallet of all time! Alex's hands shivered as he opened the r/bitcoin subreddit.

94 comments in 2 minutes, the sub was going berserk! The conspiracy theories were out in full force, Alex couldn't keep up with all the new information coming in. The fact that an original Nakamoto wallet with almost 600k bitcoins was active again was causing speculations to go into overdrive.

For the first time, Alex was afraid. The password in his head was the key to 38 billion dollars, and people have killed and tortured others for far less. Alex was under no illusion that he would last more than a minute under any kind of torture.

The ring of the doorbell startled Alex out of his reverie. Alex panicked ... how could they have found him so quickly? The doorbell continued to impatiently ring as Alex decided what to do next. He nervously looked through the peephole and breathed a sigh of relief.  It was the pizza guy! He opened  the door and thanked the delivery guy, and then as an afterthought, gave him a $20 bill as tip. Why not, Alex thought with a smile, I can afford it.

Little did Alex know how the next few days would turn into his worst nightmare ...

(To Be Continued).

No comments: