Open PraiaBitcoin opened 2 years ago
up
try use lncli on LND machine :
lncli decodepayreq <invoice to be decoded>
lncli lookupinvoice <r_hash of decoded invoice>
lncli lookupinvoice <r_hash of decoded invoice> | grep state
and maybe make a script of above dance ...
try use lncli on LND machine :
lncli decodepayreq <invoice to be decoded>
lncli lookupinvoice <r_hash of decoded invoice>
lncli lookupinvoice <r_hash of decoded invoice> | grep state
- "state": "OPEN",
- "state": "SETTLED",
and maybe make a script of above dance ...
Thank you for your help, but your solution does not help to solve our problem. We need to create an invoice, but we only have a full (read/write) url for lndhub. Luckly we solved that with LNbits. LNbits has lndhub plugin so we can have a read only (invoice) url. It would be great if lndhub has support for that in its own protocol.
You could also try use the API call :
GET LndHub-URL/decodeinvoice
{ invoice: <invoice> }
that would return status of decoded invoice string
I think I understand what you're asking for and this is genius. Needs to happen. So maybe LNDhub could generate a password that only it knows (different for each node), and run any lightning wallet string through a hashing function using that password. The resulting hash could be used as an API key. When feeding this hash into a normal API call rather than the "account:password" authorization, LNDhub could decode which wallet and password to use, but because it was that format, know not to allow spending, only generating invoices to recieve money.
You could literally implement things like the strike tips that are on twitter with this API. WOULD BE MASSIVE. Or fork plebpay as well.
Is this sort of what you were thinking?
https://github.com/BlueWallet/LndHub/pull/291
This pull request has the functionality I think you would need for this feature. It has not been merged though.
For a quick MVP of above described functionality one could do the following --takes 10 minutes.
1) Copy folder of a already verified to run 'lndhub'
cp -r lndhub lndhub-invoice-only
2) Comment out 'line 207' in 'lndhub-invoice-only/controllers/api.js'
// router.post('/payinvoice', async function (req, res) {
3) Change 'line 51' in 'lndhub-invoice-only/index.js' where port is 3000 to port 6000
const bindPort = process.env.PORT || 6000;
4) Start the instance of 'lndhub-invoice-only', that can run 'side by side' with a regular 'lndhub' instance
5) Verify in Bluewallet
url:6000
in settings for new wallet6) Profit
The above enables Node operator of a 'lndhub-invoice-only' instance to let people create invoices where funds is controlled by the Node Operator, where eXtracurricular is make a script for create a admin account and a new endpoint in 'lndhub-invoice-only/controllers/api.js', that would show balances of all accounts in instance that has memo flagged X:
in line 104 of 'lndhub-invoice-only/controllers/api.js' add pre identifier X:
in invoice creation ...
Here at Bitcoin Beach Brazil, we are using LND Hub and Bluewallet.
Now, we are trying to generate some invoices with LNDHUB API.
All goes fine, but we are missing a great API feature, that is, a read-only API Key.
A API Key that only generates and checks the status of that invoice.
It would be a great feature. []'s Fernando