<p>I will try to explain my comment in an answer. There is no clear way to host a lite ln client only to revive payment and show it, without hosting an ln node on the server, with the bitcoin core backend. Maybe with <code>lnd</code> you can do some things (or rust-lightning), but I'm not an expert of both implementation.</p>
<p>However, I worked on this problem in the last months, because I was searching for some things to make my c-lightning node a little bit more lite. With c-lightning, there is the opportunity to run custom code inside it, and I override the bitcoin backend with a custom plugin called <a href="https://github.com/clightning4j/btcli4j" rel="nofollow noreferrer">btcli4j</a> that is able to run c-lightning with the pruning mode, and also with rest API compatible with <a href="https://github.com/Blockstream/esplora" rel="nofollow noreferrer">esplora API</a> by default it uses Blockstream API.</p>
<p>There are a couple of tools that I developed to run c-lightning in a lite way for business and all the code is under the repository <a href="https://github.com/clightning4j" rel="nofollow noreferrer">clightning4j</a>.</p>
<p>There is also a <a href="https://github.com/clightning4j/clightning4j-node" rel="nofollow noreferrer">docker image</a> that packs all together (include also a rest API documented with open API)</p>
<p>I think it is a really lite way solution because it can be run in raspberry with a default config (without 1TB of space). Off curse, the tools are under dev, but there is a <a href="https://github.com/clightning4j/JRPClightning/discussions" rel="nofollow noreferrer">open discussion</a> where you can make a feature request.</p>
<p>A demo available <a href="https://bruce.bublina.eu.org/" rel="nofollow noreferrer">here</a></p>
<p>Running over <a href="https://i.sstatic.net/k0HuZ.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/k0HuZ.png" alt="enter image description here" /></a></p>

CC BY-SA 4.0
2021-09-10T15:05:20.510Z
2021-09-10T15:05:20.510Z
vincenzopalazzo
<p>The approach I've ended up taking for this project is to expose my Umbrel's <a href="https://api.lightning.community/#lnd-rest-api-reference" rel="nofollow noreferrer">LND gRPC REST API</a>.</p>
<p>My home network doesn't accept incoming requests, and I don't want that for my entire Umbrel anyway, so I'm using <a href="https://ngrok.com/" rel="nofollow noreferrer">ngrok</a> to proxy requests to LND. LND only accepts TLS connections, so <code>bind_tls</code> has to be true, and <code>proto</code> should be set to <code>tls</code>. Ngrok has its own tls setup, so it doesn't bother to check the validity of LND's self-signed cert, and so doesn't need the path to the certfile.</p>
<p>I'm also using a restrictive macaroon for authentication — this is essential for security, since if the admin macaroon were leaked you'd be up a creek. In my case, all I had to do was generate and check invoices; <code>./umbrel/bin/lncli bakemacaroon uri:/lnrpc.Lightning/AddInvoice uri:/lnrpc.Lightning/LookupInvoice</code> was sufficient for that.</p>
<p>To make requests against my lightning node, all I have to do is something along the lines of <code>curl -X POST https://my-app.ngrok.io/v1/invoices -H &quot;Grpc-Metadata-macaroon: my-macaroon&quot; -d '{&quot;amount&quot;:1000,&quot;memo&quot;:&quot;my-memo&quot;}'</code>. This translates nicely to a python requests invocation from my application server.</p>

CC BY-SA 4.0
2021-09-13T23:52:19.287Z
2021-09-13T23:52:19.287Z
jstaab
<p>I'm trying to build a small website that takes payments using a lightning invoice. I want to do this without running a full node (or pruned node if possible) on my server to keep costs down. I'd be happy with any of three types of solutions:</p>
<ol>
<li>Install a custodial lightning wallet on my server with a CLI or REST API to generate and check the status of a lightning invoice. <a href="https://github.com/spesmilo/electrum/" rel="noreferrer">Electrum</a> could work, but I didn't see invoice generation in the docs.</li>
<li>I already run a full node on Umbrel, but I'm not sure how to securely expose <a href="https://api.lightning.community/#lnd-rest-api-reference" rel="noreferrer">lnd's http api</a> to the internet.</li>
<li>Use someone else's full bitcoin node to back lnd on my server, or use a custodial lightning wallet with an api.</li>
</ol>
<p>I'm open to suggestions, I'm very new to the space and learning lots all the time.</p>
<p>Ongoing research:</p>
<ul>
<li><a href="https://github.com/ElementsProject/lightning-charge" rel="noreferrer">lightning-charge</a> uses <a href="https://github.com/ElementsProject/lightning" rel="noreferrer">c-lightning</a>, which requires a full node.</li>
<li><a href="https://github.com/FeatherLightApp/FeatherLight-API" rel="noreferrer">FeatherLight</a> looks like it would do what I want as a standalone service, but again, I'd have to host a full node.</li>
<li><a href="https://yojoe.github.io/lightninghub-api/#addinvoice" rel="noreferrer">LightningHub API</a> Seems like it could work if I set up a BlueWallet.</li>
<li><a href="https://github.com/BlueWallet/LndHub" rel="noreferrer">LND Hub</a> provides multiple users access to a single lnd instance.</li>
</ul>

CC BY-SA 4.0
2021-09-09T23:00:44.287Z
I can suggest also the following tools https://github.com/clightning4j where you can run c-lightning on a machine of 30 $ for a month. This is a demo https://bruce.bublina.eu.org/. The idea is to use the rest API with Nginx on docker so you can hide the API from the public, and talk with your website. A microservices architecture. P.S: it can support BOLT 12
vincenzopalazzo
<lightning-network><invoices>
Creating a lightning invoice without running a full node
jstaab
# Creating a lightning invoice without running a full node

(Asked by: username_0 on 2021-09-09)

I'm trying to build a small website that takes payments using a lightning invoice. I want to do this without running a full node (or pruned node if possible) on my server to keep costs down. I'd be happy with any of three types of solutions:

1. Install a custodial lightning wallet on my server with a CLI or REST API to generate and check the status of a lightning invoice. [Electrum](https://github.com/spesmilo/electrum/) could work, but I didn't see invoice generation in the docs.
2. I already run a full node on Umbrel, but I'm not sure how to securely expose [lnd's http api](https://api.lightning.community/#lnd-rest-api-reference) to the internet.
3. Use someone else's full bitcoin node to back lnd on my server, or use a custodial lightning wallet with an api.

I'm open to suggestions, I'm very new to the space and learning lots all the time.

Ongoing research:

* [lightning-charge](https://github.com/ElementsProject/lightning-charge) uses [c-lightning](https://github.com/ElementsProject/lightning), which requires a full node.
* [FeatherLight](https://github.com/FeatherLightApp/FeatherLight-API) looks like it would do what I want as a standalone service, but again, I'd have to host a full node.
* [LightningHub API](https://yojoe.github.io/lightninghub-api/#addinvoice) Seems like it could work if I set up a BlueWallet.
* [LND Hub](https://github.com/BlueWallet/LndHub) provides multiple users access to a single lnd instance.

**Tags:** lightning-network, invoices

> **Comments:**
> **username_1**: I can suggest also the following tools https://github.com/clightning4j where you can run c-lightning on a machine of 30 $ for a month. This is a demo https://bruce.bublina.eu.org/. The idea is to use the rest API with Nginx on docker so you can hide the API from the public, and talk with your website. A microservices architecture. P.S: it can support BOLT 12  

---

## 2 answers

### Answer by username_0 on 2021-09-13. Score: 4 | Accepted answer

The approach I've ended up taking for this project is to expose my Umbrel's [LND gRPC REST API](https://api.lightning.community/#lnd-rest-api-reference).

My home network doesn't accept incoming requests, and I don't want that for my entire Umbrel anyway, so I'm using [ngrok](https://ngrok.com/) to proxy requests to LND. LND only accepts TLS connections, so `bind_tls` has to be true, and `proto` should be set to `tls`. Ngrok has its own tls setup, so it doesn't bother to check the validity of LND's self-signed cert, and so doesn't need the path to the certfile.

I'm also using a restrictive macaroon for authentication — this is essential for security, since if the admin macaroon were leaked you'd be up a creek. In my case, all I had to do was generate and check invoices; `./umbrel/bin/lncli bakemacaroon uri:/lnrpc.Lightning/AddInvoice uri:/lnrpc.Lightning/LookupInvoice` was sufficient for that.

To make requests against my lightning node, all I have to do is something along the lines of `curl -X POST https://my-app.ngrok.io/v1/invoices -H "Grpc-Metadata-macaroon: my-macaroon" -d '{"amount":1000,"memo":"my-memo"}'`. This translates nicely to a python requests invocation from my application server.


---

### Answer by username_1 on 2021-09-10. Score: 2

I will try to explain my comment in an answer. There is no clear way to host a lite ln client only to revive payment and show it, without hosting an ln node on the server, with the bitcoin core backend. Maybe with `lnd` you can do some things (or rust-lightning), but I'm not an expert of both implementation.

However, I worked on this problem in the last months, because I was searching for some things to make my c-lightning node a little bit more lite. With c-lightning, there is the opportunity to run custom code inside it, and I override the bitcoin backend with a custom plugin called [btcli4j](https://github.com/clightning4j/btcli4j) that is able to run c-lightning with the pruning mode, and also with rest API compatible with [esplora API](https://github.com/Blockstream/esplora) by default it uses Blockstream API.

There are a couple of tools that I developed to run c-lightning in a lite way for business and all the code is under the repository [clightning4j](https://github.com/clightning4j).

There is also a [docker image](https://github.com/clightning4j/clightning4j-node) that packs all together (include also a rest API documented with open API)

I think it is a really lite way solution because it can be run in raspberry with a default config (without 1TB of space). Off curse, the tools are under dev, but there is a [open discussion](https://github.com/clightning4j/JRPClightning/discussions) where you can make a feature request.

A demo available [here](https://bruce.bublina.eu.org/)

Running over [![enter image description here](https://i.sstatic.net/k0HuZ.png)](https://i.sstatic.net/k0HuZ.png)


---

