The Summer of Bitcoin experience

It’s incredible how time flies. Three months passed unbelievably quickly. But what seems like nothing, when counted in units of time, feels like incredibly much, when considered in terms of experience. I learned so much in this short period of time. The focus of my proposal for the Summer of Bitcoin 2022 was the Price of Anarchy in the Lightning Network. To investigate the effect of individually optimizing behavior on the status (or ‚welfare‘) of the overall network. To what extent does this anarchistic behavior lead to a deficient Lightning Network? To tackle this question I made use of the library of my mentor, René Pickhardt. He already published research (and regularly publishes on this topic, which gave a great starting point.

To analyze the effect on the network, it’s necessary to look at a sequence of payments. Originally the pickhardtpayments library implements multipart payments that get delivered along the path with the highest probability of not failing in one channel along the way. The library serves to demonstrate the higher success date, compared to the previous way of routing along the minimal fee path.

With this in mind, the library doesn’t need to implement a settlement process, because it can easily be observed, if a payment can be delivered through the lightning network graph (OracleNetwork). However, for my project this is necessary. Otherwise a payment would not have a lasting effect on the channels, and each payment would be executed on the same fresh Network. So my focus shifted to working with and improving the pickhardpayments library.

After almost three months, the library experienced significant API changes. I made some design decision, that abstract a Payment Class and also introduce each attempt for a partial payment as an Attempt, now its own class as well. The major work was now the settlement process. While HTLCs were already part of the model, the settlement in the Lightning Network representation needed to be added. But the most important and also most interesting part was to model the updated knowledge in the UncertaintyNetwork (the network model that holds all the assumptions about the edges in the graph).

While I did some Open Source work before with the Open Knowledge Lab in Frankfurt, it was never so extensive, as it was now, with summer of bitcoin. While I had quite a hard time in the beginning and was often frustrated by the joy of unnecessary rebasings, I really felt that I got better and better over time. My feeling is that by now I can help others to get involved in Open Source collaboration, which clearly I couldn’t do before. And I enjoy it quite a lot, actually. Also I ended up reworking René’s library and probably changed 80% of the code. Which I still cannot believe. When starting out, I couldn’t imagine to really get that deeply involved, in the sense that I can contribute so significantly. And that I would have the possibility to change so much of an existing project. The possibility, but also the trust.

I am so impressed by the trust that René put in me. He introduced me to the Summer of Bitcoin programme that I hadn’t heard of before. He described the opportunity to get insights about a lot of current and relevant research and software projects in the Bitcoin ecosphere, and hinted at the interesting people I’ll get to know and learn from. I’m equally impressed by the time and effort he put into me, to help me get this deep in this topic and to help me reach this point in my career. Not only had we almost daily calls to update and align each other, but he also introduced me to a lot of what’s going on in the lightning network space, things of the past and things in the present. He was there to answer any question that came up, about why the protocol is as it is, how it could be better, which trouble people regularly have, why things became how they are, and what possible ways there are forward, what’s on the horizon for the Lightning Network.

It’s also part of the story that René and I know each other from a previous life in the political arena. We met each other five years ago, developed rapport and knew the (low) level of bullshit talk that each of us was willing to bear ;) . But it was fun to experience each others capabilities and experience in IT, which lived behind the curtains until recently and was a nice surprise to discover, as we never really exchanged a word about this part of our lives.

Having René as my mentor was a main contribution for me to what I consider a success in the Summer of Bitcoin and my bitcoin and lightning experience in general. I am very grateful for the opportunity that I was given through the Summer of Bitcoin and this project in particular.

PS: Even though the three months of the program have passed, I will still be working on the research question of the Price of Anarchy in the Lightning Network, the library and future simulations. I decided to follow up with a Master Thesis on this topic, to extend and elaborate more, on how we can make the Lightning Network more reliable to make it the payment layer that contributes to the necessary adoption of bitcoin in our everyday lives.