If the Thunder Don't Get You...

Building a Lightning node for fun. And profit??

If the Thunder Don't Get You...

About six months ago I started exploring the weird, wonderful world of cryptocurrency. (Those of you familiar with cryptocurrency know that the rabbit hole goes very, very deep.) My motivation for learning more about it was due to some interest I had in distributed ledger technology – the blockchain algorithms underlying cryptocurrency – for some novel applications at my day job. As part of my experimentation, I picked up a few cheap crypto miners and set them to work.

Like many before me, the dabbling started to get a little more involved. I bought a Futurebit Apollo (review forthcoming soon!) and my "mining game" leveled up. Recently, I flashed one of the Raspberry Pi machines I picked up on Presidents Day with raspiblitz, a sort of newbie's introduction to running a full Bitcoin node with Lightning Network. I won't delve into descriptions of what full Bitcoin nodes are (that's what your search engine will do for you), but a brief discussion of the Lightning network is worthwhile.

When two parties want to exchange bitcoin with each other, their transaction is queued on the bitcoin blockchain, and miners race to confirm outstanding transactions by being the first to find the next block in the blockchain that satisfies some specific, difficult criteria. Because the number of outstanding transactions (demand) outstrips the number of transactions that can be put in a block (supply), transactors can incentivize the miners to mine their transaction ahead of others – offering them a bit of bitcoin to prioritize theirs. Even still, though, bitcoin blocks are mined every ten minutes, so transactions will necessarily take some time to complete.

The Lightning network is an overlay to another blockchain (not exclusive to Bitcoin's, although that is the predominant one at this point) that speeds up transactions by first putting some money into a sort of escrow: two parties agree to open a "channel," putting some stake up. This escrow transaction is committed to the main blockchain (slow), but subsequent transactions between these parties is fast. To settle and withdraw the funds from this escrow is another transaction to the main blockchain.

The gist of this whole thing is that these channels persist for long periods of time, and are assembled into a map of channels among all transactors. This network of Lightning participants can be navigated, finding a series of funded channels between a consumer and provider. And this is my curiosity: how to traverse this map efficiently.

While I'm neither an experienced cryptocurrency expert, nor a long-time network researcher (though I play one on TV), this blend of vocations is quite fascinating, and one that will keep me preoccupied for quite some time.

My investigation began with raspiblitz. Where it goes next? Anyone's guess.