Skip to content

Latest commit

 

History

History
99 lines (59 loc) · 6.07 KB

File metadata and controls

99 lines (59 loc) · 6.07 KB

v1.33.0 - Release Notes

New features

Experimental: Value 4 Value Support with LND

This release delivers experimental support for the value for value monetization model with streaming Bitcoints/Satoshis.

In this monetization model, listeners can stream money to podcasters as they listen to episodes, using KeySend payments over the Lightning Network. This model was proposed by Adam Curry and Dave Jones from https://podcastindex.org.

Pre-requisites

In order to use this feature you will need:

  • A running LND node with REST API enabled, reachable from the computer where podStation is running
  • Channels with outbound capacity and routes that can reach the podcasters's nodes
  • The HTTPS certificate from the LND node is installed in the computer where podStation is running

What is implemented?

If a podcast has added a podcast:value tag to its RSS feed (according to the podcast namespace specification), or has setup its value block in the website https://podcasterwallet.com/, podStation will process the value information for the podcast, and, once per minute, attempt to send the cumulated value for played episodes of such podcasts.

The value is split to the destinations described in the value block and cumulated in memory (not yet persisted), until podStation attempts to send it.

Note that due the routing fees, it is likely that several minutes will be necessary until value cumulates enough for a payment to be successful.

In the Options, the user can set the value in millisatoshis/hour (current default is 3.000.000 mSATs, circa 1 USD in today's conversion rate). The user can also set the limit routing fee in %, the default is 1%.

How to enable it?

In the Options, a user must configure the connection with the LND node, by setting the base URL for the node's REST API, and a macaroon (for authentication).

The macaroon can be generated on the node's command line with the command:

lncli bakemacaroon offchain:read offchain:write info:read

The permissions are used for:

  • sending payments
  • reading the channels balance (test button on the options)

The info:read permission is currently not used, but I foresee its use in the future for querying routes to the nodes to which we are sending payments.

Once these setup is performed, a user can use the Test LND connection to check if it is working.

How to know if it is really working?

Currently there is no UI where the user can inspect what is happening, the only way to get any feedback (aside from inspecting the transfers and logs of your LND node), is to inspect the logs of podStation's background page.

To do so, go to chrome://extensions/ and click on the details of podStation, look for Inspect views and click on the background.html view, then check the console. There, when playing value enabled podcasts, you should see either success or error messages for the payment.

Limitations

As previously mentioned, the values to be paid are only cumulated in memory, which means that if you do not listen to a large enough portion of a podcast, when podStation's background page is unloaded from memory, the cumulated value is lost.

As an example, with the default fee limit of 1%, and a routing fee of 1 SAT, only a cumulated value of 100 SATs would be successfully transferred.

With a 3000 SATs/hour rate (the default), considering splits, this is the time that would be needed to cumulate enough value for a successful payment:

  • 100% split - 2 minutes
  • 50% split - 4 minutes
  • 10% split - 20 minutes
  • 1% split - 200 minutes

As such, it is unlikely that small splits like 1% will ever be successfully transferred, unless a channel is open directly to that node.

Technical details

From an engineering perspective, the integration with LND node is rather simple, although it required a good dose of research.

podStation is simply calling the node's REST API for sending payments, and replicating the behavior of lncli when called with the option --keysend (surprisingly, one of the key parts of KeySend payments is implemented on the client, not the daemon).

Also, one of the "fun" parts was figuring out how to the necessary data encoding and hashing in Javascript without introducing heavy dependencies.

References:

Disclaimer

This solution is very experimental, I myself only tested in a local bitcoin regtest environment (I will eventually setup the real deal, but I wanted to put it out there as soon as possible).

Consider enabling the test mode first and inspecting the logs for the payments that would have been sent, and check if the values are ok, before you use it for real. If possible, connect it with a node that only has funds you can spare.

Closing words

There is a long bumpy road to have good support in podStation for the value 4 value monetization model with lightning. I had to convince myself that it was ok to release this functionality at the current state.

There is a lot to consider in many different fronts, like user experience, transparency and traceability, supporting other node types (like c-lightning and eclair), supporting third party services like https://docs.lnpay.co/.

The podcast app will become a mini accounting software, with a lot of complicated design decisions to be made (for instance, what to do with cumulated funds if a node is not reachable for a long long time?).

It will be very interesting to see how this evolves.

A special thanks go to the authors of NGUtech/bitcoin-stack which is a complete container based bitcoin + lightning regtest stack. It saved me a lot of setup time (and knowledge).