What If: The Last Days of Bitcoin

by Kyle Downey, CEO & Co-founder - 26 Nov 2022

Bitcoin had survived and thrived over the years despite many threats: multiple market crashes; the crackdowns and eventual ban in China; the collapse of the Texas electrical grid in the summer of 2023 and subsequent outcry against the miners based there; concerns about its impact on the climate. Within the community it had become a joke how many times the death of Bitcoin had been predicted, only for it to rise again, leading perhaps to a degree of complacency. But in the end, for all its decentralization and censorship-resistance, despite the manifold genius of the crypto-anarchist collective known only as Satoshi Nakamoto, it all fell apart because Ping Jiang and Qi Shen could not buy an apartment in Shanghai and get married. In a strange demonstration of how human relationships can be the ultimate centralizing concern, they took down a trillion dollar market.

In 2014, Ping Jiang and Qi Shen enrolled at China’s prestigious Tsinghua University after scoring top marks in the nationwide gaokao exam. Qi, who was pursuing a degree in computer science, had been coding in C and C++ since high school while growing up in Harbin, and had started contributing to Bitcoin Core and other open source projects. He liked to joke that his name, “Qi,” shared the same character as qiguai, or strange. As he went by the English name Al, he adopted weird_al_btc as his handle on GitHub in a nod to this. Though he was at best a mediocre computer science student, Qi was an unusually talented developer. He contributed optimizations to Bitcoin Core that astounded the other developers, in one case speeding up a key routine an order of magnitude; in another uncovering a bug that had lingered for several years undetected.

Of the two though, Ping was the true genius. Throughout her four years in Tsinghua’s electrical engineering program, it became apparent that she had a gift for hardware design. Professors who were incubating their own startups on the side tried to convince her to join them after graduation, and when she finally did graduate, she was top of her class and and her choice of firms to work for. So it came as some surprise that in the spring of 2018 word got around that she had accepted an offer at a small Bitcoin mining hardware startup located in the suburbs of Shanghai which no one had even heard of, Beetle Technologies. If anything, the only thing more surprising was that Ping had started dating Qi in the previous year, a not very successful CS student who seemed destined to not go very far in life. And as the job offers rolled in, the general consensus appeared to be right: Qi had gotten a low-level job as a programmer at the Agricultural Bank of China. But so it was, and the two moved together to a small flat on the outskirts of Shanghai, to the general disapproval of both their families, especially Ping’s.

Two years later, still unmarried, Ping and Qi were sitting across from one another at their dingy kitchen table. Ping’s father had made very clear that under no circumstances could they get married unless they — and by this he meant Qi — could buy a flat in Shanghai. Though she had been doing exceptionally well at Beetle Technologies, Ping was very unhappy. Toying with the remains of her dinner, she looked up at Qi, and made a suggestion which made him laugh. She shook her head, and grabbed her notepad. Faster and faster, she began to draw. Qi stood up, and looked over her shoulder, commenting a few times, but mostly letting Ping sketch her idea. At one edge of the notepad was a box: Beetleminer 3000, the project she was working on. At the other was a Bitcoin node and a wallet. She illustrated a series of messages, a pattern. What if Bitcoin Core, when entering a transaction, could hide a hint, a hint that would open a door hidden deep inside the Beetleminer 3000 circuits? And what if, in response, the mined block would have a flaw, a very subtle one, which Bitcoin Core would accept and validate? Could they get the blockchain to accept a transaction that it would not otherwise allow?

Completing the last few lines and notes, Ping looked up again at Qi, who was a bit wide-eyed.

It might work.

In the following months both Ping and Qi began the slow & dangerous process of folding their two-part backdoor into Bitcoin Core and the Beetleminer 3000’s design. Interspersed with his pull requests for other, more routine changes, Ping began to shape the code: a line here, a subtle change there. Each submission was tense. Would it be approved? Would anyone notice? But with the trust he had built over the years contributing to Bitcoin Core, each change got merged into the codebase. Anyway, without understanding the hardware change which was needed to complete the picture, it would have been hard to piece together what exactly Qi had done. As for Ping, she submitted a blizzard of design changes improving the Beetleminer 3000, constantly improving its efficiency and driving down its electricity usage. Five months later, she prepared and submitted the final piece, the fatal flaw that would open the door. Alarmed, she saw an email arrived shortly thereafter from her boss, Mr. Xia, asking her to come to his office. She walked in, and quietly sat down.

Xia, a 53 year-old engineer, had worked for Beetle’s founders for years down in Shenzhen, and was responsible for final design reviews of the Beetleminer 3000. He had Ping’s final design up on his monitor, and he had a problem: he didn’t understand a key piece of the logic. He had seen the early test results. The Beetleminer 3000 was extraordinarily efficient, using 27% less power for the same computation as its closest competitor, and every single change from this young woman before him only drove it down further. He took a sip of his green tea from the tall canister on his desk and considered her. He knew he should ask her to explain this logic to him, but then he would have to admit to her, this junior employee, this shy young woman from Anhui, the daughter of a farmer for heaven’s sake, actually knew more than him. He harrumphed. “Well done, Ping. I’ve recommended you for a raise.” A bit startled, she thanked him, and scurried out. He approved the final design, and went outside for a smoke.

In February of 2022, the Beetleminer 3000 began to roll off the assembly line. The order book was massive; Bitcoin miners in Texas, Kazakhstan, Mongolia, everywhere, had seen the performance numbers and were clamoring to install it. As the orders came in and the boxes rolled out the door to be packed into shipping containers and around the world, more and more of the Bitcoin hashrate was supported by the humble Beetleminer 3000, humming away in row after row of racks. It was the most succcessful miner launch in the history of the network, and while it was not universally installed, they quickly achieved 43% market share despite the company’s relatively short track record in the industry. The profits flowed in and the founders were delighted with Mr. Xia, his team and their work. Meanwhile, at their flat in Shanghai, Ping and Qi watched the progress quietly, following various channels to see if there were any signs of concern, watching GitHub to see if any of the key changes were reversed. The next upgrade to Bitcoin Core went out, activating Qi’s part of the mechanism, and again they waited.

Finally, in late summer 2022, Qi completed the last of his scripts, a Rube Goldberg contraption of tumblers, mixers, privacy coins, cross-exchange transfers and more that would securely move bitcoin onto an exchange, sell it, and transfer the resulting funds as stablecoins to another wallet. They carefully picked a small, inactive account of no consequence, one whose key had been lost for years most likely, and entered a transaction to move a bitcoin through the whole system. That first transaction flew out with the trigger pattern encoded in it and an invalid key. It shouldn’t work. It was, from a network perspective, completely illegal. But as the transaction flowed through and the careful dance between Bitcoin Core and the Beetleminer 3000 that mined the block played out, it nevertheless went through, and $79,321.29 worth of stablecoins landed in Qi’s wallet. They continued to watch in the coming days, and were rewarded with complete silence. Nobody owned this wallet anymore; no one had detected the subterfuge; and no exchange had closed their accounts. Slowly at first, then more and more over time, Qi began to target more such dead wallets, building up his position in stablecoins: hundreds of thousands, then millions of dollars. And more. Of course not every transaction worked: some, mined by a pool that didn’t use the Beetleminer 3000, were simply dropped. But enough went through that their offshore fortune grew.

Eventually their fortune was such and the risks sufficiently high given the crackdown in China that Ping and Qi decided the only safe thing to do was to leave the country. They resigned from their jobs, made the sort of discreet inquiries and obtained assistance that only millions and millions of dollars can buy, and eventually relocated to Singapore under new identities, buying the apartment of their dreams in the Singapore Marina Sands. And they finally got married, much to the confusion of Ping’s father, who, to be honest, though this Qi fellow was never going to amount to much. Increasingly worried that their good luck could not last forever, they resolved never to use the backdoor again, and settled into a quiet life in Singapore in 2023. And if that’s all they had done, that might well be the end of this story: a tale of silent grand theft, but ultimately one with perhaps no clearly identifiable victims, given the funds had come from dead accounts, and had all been very carefully scrubbed along the way.

But several years later, on May 22, 2027, with Bitcoin trading for $167,203, a new all time high, Qi fell victim to a common downfall for young hackers: he wanted to show off a little bit. To his intense frustration, Bitcoin’s Bonnie and Clyde had executed the perfect crime, but nobody knew! Ping was asleep, and he was sitting in the next room, the Singapore merlion visible some distance away across the water from their penthouse apartment. He drummed his fingers on the keyboard, thinking, then opened up his old scripts and his Bitcoin wallet. Mindful of the day, he entered a transaction for 10,000 Bitcoin from a wallet known to have been controlled by Satoshi Nakamoto, and typed in what is now the second most famous Bitcoin transaction comment of all time: “Buying Mrs. Nakamoto a pizza.” He kicked off his tumbling and transfer scripts, and went to bed. In Uzbekistan, a newer-generation Beetleminer which had inherited Ping’s fatal flaw picked up the block, and mined it, opening the backdoor one last time.

Alarms went off in long-dormant programs set up by those obsessed with knowing the identity of Satoshi Nakamoto to monitor movement in known accounts containing billions and billions of dollars worth of Bitcoin. As amateur sleuths around the world started to dig into the blockchain in the hours that followed, they found evidence of transfers to known exchange accounts, which subsequently saw large trades executed, though they failed to unpick the maze Qi had crafted to hide his tracks, and could not figure out where the money had gone. But one thing was clear: the Hoard of Satoshi was on the move, and worse, someone was liquidating it. Fear, uncertainty and doubt filled the crypto market. People begin to sell; derivative positions got liquidated around the world as the price plummeted, driving further selling pressure. The massive stablecoin transfers were blocked and never reached Qi & Ping’s accounts, but this was never the point: the point was to show that it was possible, that they had done it, and now the world knew that it was possible too.

The following day Elon Musk tweeted out an image of a Dumpster fire with the Bitcoin logo layered on top. And it only got worse as the investigation into how it happened played out on Discord, developers frantically sifting through code and trying to understand the source of the problems. News reports were filled with speculation about how the seemingly impossible had happened, and panic spread further the longer it took to find the issue. Finally, a Belgian developer stumbled on a single GitHub pull request for Bitcoin Core which did not look right. The author: weird_al_btc. The developers began to pull on the long thread of Weird Al’s hundreds of code commits, trying to understand which were benign and which were part of the backdoor. And they realized with growing horror not only had this flaw gone undetected for a very long time, but Weird Al’s clever algorithms had been regularly copied to various forks and derivatives of Bitcoin Core, so nobody knew for sure whether this meant other, related cryptocurrencies were vulnerable too, or if the exploit only worked for Bitcoin. The broader digital asset market was devastated: whether you invested in Bitcoin or not, its fall was incredibly damaging, and this damage would in the end set the market back by years.

Weeks passed and the lack of progress in the investigation drove repeated downward legs in the Bitcoin price until it approached a critical point: the break-even price for Bitcoin miners. And then the final nail went in: Beetle Technologies finally uncovered the flaw in the Beetleminer that Ping had so carefully engineered. Mr. Xia was fired, but Ping was long gone, having used her newfound fortune to build her new identity in Singapore. Ping Xu, wife of Qi Xu, respected member of her community, philanthropist, mother and amateur gardener, was not obviously connected to Ping Jiang, the long-departed Beetle engineer, who for all the world seemed to have simply dropped off the face of the Earth four years ago. And that one final hard truth, that the miners of the world had widely deployed a long-dormant backdoor without even knowing it and somehow colluded with a Bitcoin Core developer to make it work, was what finally did in Bitcoin. Its reputation for unbreakable security and decentralization was in tatters, and its case as a digital gold, a store of value, was undone by the massive fall in price in the preceding weeks and panics over possible 51% attacks as unprofitable mining pools went offline faster than the difficulty could adjust. And so Bitcoin, the emperor of cryptocurrencies, the blockchain’s O.G., lost that most important element for any currency whose value is built on the belief that is is worth something because other people believe it’s worth something: faith.

Back in Singapore, Mr. and Mrs. Xu had been watching this all play out with a mix of fascination and horror, their fortune safe in a Singapore private bank in the form of vast amounts of highly centralized fiat currency and a diversified portfolio of stocks and bonds, thank you very much. Though she could not have predicted this chain of events, Ping had expressed very firmly some years ago that she had no interest in having anything more to do with cryptocurrency after their caper had come to an end, despite Qi’s continued interest in wild fifth-generation blockchain protocols and other such adventures. In fact she had not spoken to her husband for days once she discovered his final Bitcoin transaction and its consequences. But these moments pass, she forgave him, and their quiet life together went on.

Every year, on May 22, Qi buys Ping a pizza.

They were never caught.