LndHub icon indicating copy to clipboard operation
LndHub copied to clipboard

BTCPay Server integration?

Open maltokyo opened this issue 4 years ago • 14 comments

I would like to use bluewallet with the lnd node in BTCPAY Server. Any plans for integration? Or at least is there a docker version and I will do myself ;) please let me know where to start?

maltokyo avatar Apr 19 '20 23:04 maltokyo

btcpayserver has an api, right? so easiest is probably to copy class https://github.com/BlueWallet/BlueWallet/blob/master/class/lightning-custodian-wallet.js and make it work with btcpayserver via API. it will look like another wallet card in bluewallet

Overtorment avatar Apr 28 '20 16:04 Overtorment

I think the question is:

"Is there a way to include this in the BTCPayServer stack?"

(BTCPayServer is a docker-compose based stack that includes LND, so OP is probably asking if you have an official docker container that can be configured to talk to the LND container via env variables etc.)

junderw avatar Jun 18 '20 03:06 junderw

the goal is probably:

  1. Setup BTCPayServer with ENABLE_LNDHUB=1
  2. Now you can point bluewallet to your BTCPayServer domain and magically it will work.

junderw avatar Jun 18 '20 03:06 junderw

iirc there was another project that is also docker-compose based and has a GUI where you can enable and disable services... it had BTCPayServer and LNDHUB (shown as a BlueWallet icon) on it...

imo, that solves this issue (if my memory is correct)

junderw avatar Jun 18 '20 03:06 junderw

Kukks gave a thumbs up, so maybe BTCPayServer team wants to include LNDHUB but don't want to maintain a docker container for the project... idk.

junderw avatar Jun 18 '20 03:06 junderw

Kukks gave a thumbs up, so maybe BTCPayServer team wants to include LNDHUB but don't want to maintain a docker container for the project... idk.

Yes, I'm looking at 2 types of integrations:

  • Integrate in our docker stack so that users can host lndhub alongisde their btcpay (ithink @maltokyo was looking at this)
  • Integrate Lndhub as if it was a lihtning node implementation and allow stores to use it to accept lightning payments. (is there a reference client somewhere? preferably in static typed language)

Kukks avatar Jul 13 '20 09:07 Kukks

reference implementation: https://github.com/BlueWallet/BlueWallet/blob/master/class/wallets/lightning-custodian-wallet.js

Overtorment avatar Jul 20 '20 15:07 Overtorment

@Overtorment @Kukks I have lndhub running in docker (here is the dockerfile: https://github.com/maltokyo/docker-lndhub ), but really struggling to get it connecting to the lnd node of BTCPay Server. I have it running on a working synched BTCPay Server, copied the admin.macaroon and tls.cert over to /lndhub directory, and trying to get the lnd config file correct so it will connect, but failing at this part with SSL Errors. Details and log here: https://github.com/BlueWallet/LndHub/issues/95

Any ideas what could cause those from anyone?

Also, @Overtorment - Is there a list of env variables I can use to setup the lndhub config file from env? This is a pre-requisite for BTCPay implementation, as users should never have to change a config file manually.

maltokyo avatar Aug 08 '20 15:08 maltokyo

yeah, the list of envs is:

  • CONFIG - stringified json of a config file ¯_(ツ)_/¯
  • MACAROON hex encoded admin.macaroon
  • TLSCERT hex encoded tls.cert
  • GROUNDCONTROL - a new one, its a push notification service - this is where notifications about paid invoices are posted. you can use https://groundcontrol-bluewallet.herokuapp.com

Overtorment avatar Aug 10 '20 18:08 Overtorment

Kukks gave a thumbs up, so maybe BTCPayServer team wants to include LNDHUB but don't want to maintain a docker container for the project... idk.

Yes, I'm looking at 2 types of integrations:

  • Integrate in our docker stack so that users can host lndhub alongisde their btcpay (ithink @maltokyo was looking at this)
  • Integrate Lndhub as if it was a lihtning node implementation and allow stores to use it to accept lightning payments. (is there a reference client somewhere? preferably in static typed language)

Hey @Kukks! How's it going?

I am planning to integrate lndhub through the tor onion exposed proxy from btcpay, in the same context as https://github.com/btcpayserver/btcpayserver-docker/issues/294#issuecomment-617984814

However, @Overtorment maybe some changes should be done to make this accomplishment work? since the URI contains a validator that requires http:// prefix - not sure if this will allow establishing the connection

whiteyhat avatar Feb 26 '21 18:02 whiteyhat

@Kukks Any news?

jaonoctus avatar May 03 '21 19:05 jaonoctus

I added my working version as a PR here, but nobody responded yet. It works fine for me!

https://github.com/btcpayserver/btcpayserver-docker/pull/472

maltokyo avatar May 03 '21 19:05 maltokyo

@maltokyo I'll test it!

jaonoctus avatar May 03 '21 20:05 jaonoctus

It's not tor enabled yet. And not integrated into the UI of BTCPay server. I'm not sure how to do all that. Rest works well. Let me know how it goes.

maltokyo avatar May 03 '21 20:05 maltokyo