Archiv štítku: Bitcoin

Building Lightning node

There was a need for a Lightning node and fortunately nearly at the same moment an older notebook found its way back to be. Quite old but still powerful enough to run all the needed software. I installed Linux Mint (just to have a nice graphical user interface I will never use), CTX containers and started installing all the needed Lightning node (further in the text just LN) applications into the container. Why into container? Just to be able to clean-up the notebook from all these components easily. 

Installing software

There are pre-built OS images with LN installed for Raspberry Pi. If you want to run LN on your Raspberry Pi you can have it in minutes. For other platforms, it’s necessary to install a bitcoin node application, lightning node application and probably same management tools to have a more comfortable way how to monitor and manage the node without going to the command line all the time.

To find the right component stack is quite easy – there are some proven apps and their alternatives.

I have chosen the proven ones:

  • Bitcoin core – bitcoind
  • LND
  • LNDConnect to be able to connect my mobile phone wallet easily

and some add-ons to have a web user interface for common tasks:

  • Ride The Lightning
  • ThunderHub
  • Lightning Terminal
  • Bitcoin Explorer RPC

Thanks to LNDConnect you can easily connect iOS (mobile) Lightning Wallets to your node, I use:

  • Zap
  • Zeus LN

It took me (bitcoind actually) two days to synchronise the block-chain and in then I added all the other components in quick succession. Not big issues, I just needed for read some „solved issues“ on GitHub from time to time.

Connecting my node to others

The funny part is which channels should be opened and how to maintain the node. I have seen a youtube video where the guys called Lightning node “Tamagotchi”. It needs your attention otherwise it dies.

I decided to open two channels at the beginning and add a new one every one or two days. It seems to be quite a good approach as it shows some continuous “grows” in number of channels and also capacity to others. To find the right “peers” for the channels is kind of magic. Fortunately there are online tools which can help you to evaluate 16000 other nodes to find some good candidates for future friends.

First routings

Routing Fees

And it came! The very first routings of 3rd party payments. Yes, for a few Satoshis but they are there! And the same routings as a nice graph:

Routing Graph

Now it’s time to find a final home for my node – I will migrate it to a Raspberry Pi computer I bought for it.

The Lightning journey begins

I like Bitcoin. I came across it for the first time many years ago while paying for a coffee in Paralelní Polis. Over time it became too expensive to pay for a coffee by Bitcoin itself. To solve it I installed Breez wallet to be able to pay small amounts using Lightning network and a bit later I made the first payment. Where else than in Paralelní Polis.

Last week a friend of Honzík came up with the ideas of selling home-made lemonade on a street to make some money and to have some fun. To give you a context, Honzík is my 7 years old son. We immediately started supporting the idea and proposed help with all the necessary arrangements like a stand, a product which will be sold, how to make some PR and I proposed to support the idea by allowing their customers to pay by BTC and LTC. But based on my own experience, I knew that BTC blockchain itself is not the way how to pay 10 CZK (~900 sats today). I needed a cheaper way how to pay 10 CZK using BTC.

My very first idea was to create a payment request in Breez wallet, print the related QR code on a sheet of paper and done. I started evaluating the idea and found some shortcomings:

  • Breez wants me to keep the application opened until the payment is finished.
  • It’s not a good idea to re-use the generated lightning invoice if you do not want to lose your money.

So I decided to have some fun as well and started installing my own “lemonade” Lightning node to be able to generate my own Lightning invoices. Today my node is live for the 3rd day and I am going to share my Lightning journey here.

And BTW the guys‘ lemonade stand was a great success even without the BTC payments. So imagine how it could have done if they had it!

BTC a Lighting

S Lightingem začínají dávat i drobné platby v Bitcoinech smysl. Alespoň jsem ten dojem v sobotu dostal při návštěvě v Paralelním Polisu, kde jsme si s Adámkem dali jablečný koláč a já ještě kakao.

Adámek v Paralelním Polisu

A protože jsem věděl, že v PP berou i platby v BTC přes Lighting a mám nějaké drobné převedené do peněženky, která tuhle (pro mne) novotu umí, tak jsem si to chtěl vyzkoušet.

A výsledek? Konečně stojí poplatek za transakci méně než ta káva/kakao/koláč. Je to dané tím, že se s každým účtem na pár drobných neběží do blockchainu, ale vzájemné zápočty plateb mezi uživateli Lightingu se do něj promítnou jednou za čas.

Fee 1 Satoshi. Levněji to nejde. Tedy jde. Zadara.

Dokonce stojí jen 1 Satoshi, tedy 10-8 BTC. Méně to ani být nemůže. No mohlo by to být už jen zadara. Menší zlomky se zatím v transakcích nepoužívají…