Sidechains And Lightning, The New New Bitcoin

The great thing about Bitcoin, for a tech columnist like me, is that it’s simultaneously over-the-top cinematic and technically dense. Richard Branson recently hosted a “Blockchain Summit” at his private Caribbean island. There’s a Bitcoin Jet. At the same time, 2015 has seen the release of a whole slew of technically gnarly–and technically fascinating–proposals built atop the Bitcoin blockchain.

In case you’ve been living in a Faraday cage: a blockchain is a distributed peer-to-peer ledger system, (generally) safeguarded by cryptographic proof-of-work, initially devised by a mysterious entity called Satoshi Nakamoto … who released Bitcoin, the world’s first blockchain network/protocol/application/currency, in 2009.

To most people, Bitcoin itself is already deeply esoteric (and many still find it risible.) But to cryptocurrency aficionados, tired old garden-variety Bitcoin is so five minutes ago. Explaining today’s new cryptocurrency hotness to a general audience is an interesting challenge–I have an engineering degree from a top-tier school and I write software for a living, and I still find much of this material pretty impenetrable on first acquaintance–but here goes:

Sidechains Elements Alpha

The distributed Bitcoin mining network performs quadrillions of calculations every second that maintain the integrity of its blockchain. Other blockchains aren’t remotely as secure, but they innovate much faster. Sidechains, an innovation proposed and developed by the startup Blockstream, allow for the best of both worlds; the creation of new blockchains “pegged” to Bitcoin, so that value can be transferred between them, which can conceivably be automatically secured by Bitcoin miners via “merged mining.”

The sidechains vision of the future is of a vast globe-spanning decentralized network of many blockchains, an intertwined cable rather than a single strand, each with its own protocol, rules, and features — but all of them backed by Bitcoin, and protected by the Bitcoin mining network, as the US dollar was once backed by gold. Sidechains can also be used to prototype changes to the fundamental Bitcoin blockchain. One catch, though: this will require a small tweak to the existing Bitcoin protocol.

I’ve written about this before. As of this week, though, sidechains are no longer vaporware. On Monday, Blockstream released the first alpha version of their sidechains software.

Their “Sidechain Elements” are a collection of blockchain features that go well beyond Bitcoin’s blockchain, including (among others):

  • Confidential Transactions — At present, all Bitcoin transactions are completely public, albeit pseudonymous. Confidential Transactions, as the name implies, conceal the amount being transferred to all except the sender, the recipient, and others they designate. The resulting transaction size is significantly larger, but includes a sizable “memo” field that can be used to store transaction or other metadata, and is still smaller than eg Zerocoin.(Note that this isn’t as confidential as Zerocash, which conceals both the amount and the participants involved in any transaction, through the mighty near-magic of zk-Snarks. Mind you, Zerocash would require an esoteric invocation ritual to initiate its network. No, really. But that’s a subject for a separate post.)
  • Segregated Witnesses — The current Bitcoin transaction signature algorithm is complicated and flawed, leading to a problem known as transaction malleability. Segregated witnesses would eliminate that, improving the efficiency of much Bitcoin software considerably … and making much more significant innovations such as the Lightning Network (see below) possible.
  • New opcodes — Every Bitcoin transaction is actually a program written in a scripting language. These opcodes expand the possibilities of that language, making whole new forms of transactions possible, such as lotteries, payments to a randomly chosen set of recipients, etc.
  • Basic Asset Issuance — This allows sidechain clients to issue their own brand-new assets which, like Bitcoin itself, can be securely and fungibly transacted on the block chain: vouchers, coupons, stocks, bonds, etc. I am now officially taking bets on if and when the first bleeding-edge company IPOs via a “stockbase” transaction.

Blockstream has also released an “Alpha” sidechain with all of those features up and running except the last, coupled to the Bitcoin testnet. (Used for testing Bitcoin software without putting real value at risk.) In the absence of the Bitcoin protocol change that will cryptographically secure the programmatic transfer of value between Bitcoin and sidechains, they’re cooperating with several external organizations to perform and validate those transfers. If and when that protocol change happens, though, pegged sidechains will be as permissionless, and as decentralized, as Bitcoin itself.

The Lightning Network

But wait, there’s more! A whole different group has released an early draft of a radical new proposal called the Lightning Network, which would, in principle, move the vast majority of Bitcoin transactions off the blockchain, without sacrificing any verifiability or security.

I know, I know. As a faithful ear-to-the-ground early-adopter tech reader you’ve spent the last two years hearing everyone and their dog extol the virtues of blockchain technology, with which Bitcoin was supposed to be inextricably linked, and now suddenly people are talking about fully secure off-blockchain transactions?

Let me explain. The Lightning Network allows for the creation of “micropayment channels” across which multiple Bitcoin transactions can be securely performed without interacting with the blockchain, except for the initial transaction that initiates the channel. There is no counterparty risk: if any party ceases to cooperate, and/or does not respond within an agreed-on time limit, the channel can be closed and all its outstanding transactions kicked up to the blockchain to be settled there.

These in-channel payments would be instant, unlike current Bitcoin payments, which require an hour to be fully verified on the blockchain. What’s more, payments would be routable across multi-hop paths, like packets across the Internet — so instead of having to create a channel to every new counterparty, you could maintain a few channels to a small number of well-connected secure intermediaries and send/receive money through them.

In theory, this distributed micropayment network–the Lightning Network–could scale Bitcoin transactions up to “billions of transactions per day” across the planet, with minimal use of the blockchain and minimal fees (zero, for direct channels.)

However, the Lightning Network would, again, require a change to the existing Bitcoin protocol. (Though again it would be a “soft fork,” i.e. the existing blockchain would remain fully valid.) And/or — you guessed it — a Lightning sidechain. What’s more, one of the changes it requires, the elimination of transaction malleability, is handled by the Segregated Witness work in Sidechain Elements. (correction: all of of the changes required are incorporated into Elements Alpha — it’s Lightning-ready out of the box.)

Early days yet, for both; but still, these are interesting times indeed.