Loading proofofbrain-blog...

V4VApp Update and a Muun Loop story

Thank you

This is my first update since my latest @v4vapp proposal was funded so thank you all who have voted and continue to add votes.

A steadily growing number of Hive users are making use of the bridge and it is working smoothly for the very great part. I'm happy with the performance and the level of service I'm giving.

Muun and channel balance

This bit is more of interest for the Lightning community. Muun is a wallet I have a love hate relationship. It's given me some real headaches, but fixing those has made my overall system better.

Muun is a self custody Bitcoin wallet with Lightning abilities. At first I didn't see the point but there is one huge bonus to this. You can receive Bitcoin transactions into your Muun wallet (you hold the keys, it is your crypto) and then send that out as Lightning.

Because Muun is a very popular wallet for my Hive users, I've sent more than 200 transactions to Muun wallets. So I have opened a 1M sat channel to the node magnetron which is the node all transactions to Muun wallets seem to go through. That node is quite an expensive routing node charging 2500 ppm. This is Muun's business so that fee is meant to cover the on-chain costs Muun pays when moving BTC back and forwards to the Lightning network.

My issue is that after opening a channel, I steadily send all the sats to the Muun side and then I can't re-balance the channel. One option is to close the channel and open a new one (which incurs BTC main chain fees).

So it occurred to me that I could move some BTC onto my Lightning node AND rebalance my channel with magnetron at the same time.

I made a 2m sat BTC transaction to my Muun wallet (1 sat/vb) and then paid two invoices to my own node for 333k sats. Unfortunately the vagaries of Lightning routing means my balance with magnetron has now shifted only 0.33m sats back to my side. For reasons known only to Zeus, the second of the two transfers found a different way to my node.

muun sats.png

One transfer cost me 292 sats and the other 172 sats. I paid 645 sats for the on-chain BTC transaction to send to Muun. That's a total of 1109 sats.

I'm only pointing this out to show that whilst Lightning is billed as a low fee network, it's not as low fee as free on Hive and keeping it running behind the scenes as an actual business is quite a lot of work.

In fact, since April, my system has paid 10,321 sats in fees on 19,205,222 sats which is a fee rate of 0.05%. To Muun wallets I've sent 5,628,292 and paid 8,586 which is a fee rate of 0.15%, three times the average.

This is real world usage of Lightning and this kind of information is very hard to find.

Migration to @privex

Behind the scenes I've made a couple of major changes.

  1. I wrote some quite complex code to keep track of which Lightning nodes my transactions pass through. It was this code which allowed me to work out the fee percentages above. Going forward the intelligence I gain from this will help me manage the Lightning node much more efficiently. It will guide which channels I need to open and close and where I need to have sats.

  2. I moved the last part of my system out of my home. I had already moved the Lightning Node to Voltage, I was running an API server and the website on a @privex machine and now I've taken another @privex server to run the internal part which is the actual bridge between Hive and Lightning.

A big part of the second step was making sure my code runs nicely in Docker (it largely does) so I'm on track to being able to document and share it.

I'm now going to freeze things for a few weeks and make sure everything is running smoothly.

Re-design needed

One of the use cases that has come up is a desire to have Hive projects and Dapps ask for a set amount of Hive or HBD as sats and receive exactly that amount.

I've realised that I need to "move" the place where I do the Sats to Hive/HBD conversions: at present this happens inside the non-public part of my system. It's a private internal calculation.

I want to move the exchange rate calculation out to the API which I use for generating things like the public Lightning Addresses. When I do that I'll be able to give Hive projects a specific API call to generate an invoice for a certain amount of Sats.

Once I re-engineer for this I believe I will have a system that any Hive Dapp can use to let non-Hive users pay with what is becoming an easy to get hold of cryptocurrency (Sats on Lightning). It was this post by @patrickulrich about Creating An Anonymous Hive Account Using The Lightning Network that made me realise how important this change will be.

However, I'm not going to tackle it right away, it will be a few weeks before I'm able to get this done but I'm looking for input from any Hive dapps who think they can make use of this.


Support Proposal 222 on PeakD
Support Proposal 222 with Hivesigner
Support Proposal 222 on Ecency


Send Lightning to Me!

H2
H3
H4
3 columns
2 columns
1 column
12 Comments