getAlby / lndhub.go

Accounting wrapper for the Lightning Network. It provides separate accounts for end-users. (LndHub compatible API written in Go)
GNU General Public License v3.0
86 stars 23 forks source link

Add config to charge a transaction fee #358

Open bumi opened 1 year ago

bumi commented 1 year ago

Currently only the lightning fees are charged. As an operator I want to be able to charge a fee per transaction. This could be a fixed fee or a percentage.

This should be the place where the fee transaction entry is created. Currently we set the invoice fee there. https://github.com/getAlby/lndhub.go/blob/main/lib/service/invoices.go#L313

the invoice fee is set here: https://github.com/getAlby/lndhub.go/blob/main/lib/service/invoices.go#L239

this could be one function similar to CalcFeeLimit. It's on the Service thus it can be used to set the invoice Fee.

ToDo: check how it is for keysend payments

MoritzKa commented 1 year ago

From a business perspective I want to charge different fees

bumi commented 1 year ago

Assigning all the people just as a ping to think about how this option should be implemented.

MoritzKa commented 1 year ago

Fee proposal:

Fees can dependent on

Implementation

  1. Step: check payment volume
  2. Step: make fees configurable based on payment volume
kiwiidb commented 1 year ago

On a technical level I advocate for a subscription-based model for power users like BTCPayserver, and charge no transaction-based fees. If we go through with the first step of https://github.com/getAlby/alby-deployment/issues/170, then we have a single place to manage users (the rails app). Then we can set transaction limits for these users there, and have a system to manage subscriptions. Based on the subscription payment we can then allow for different transaction volumes easily in LNDhub. We can then have different monthly tiers. And we can add other benefits for paying users (more nostr / lnurl features, access to more apps, etc).

If we have to calculate transaction-based fees in LNDhub then I see these downsides: