getAlby / lightning-browser-extension

The Bitcoin Lightning Browser Extension that brings deep Lightning & Nostr integration to the web. Wallet interface to multiple lightning nodes and key signer for Nostr, Liquid and onchain use.
https://getalby.com/#extension
MIT License
537 stars 194 forks source link

Make lnurl-auth with Lnbits compatible the their implementation #631

Closed bumi closed 2 years ago

bumi commented 2 years ago

Currently we create a custom key used for lnurl-auth with lnbits. Since lnbits supports lnurl-auth we should make sure to be comptabile. This then results in the same accounts when the user logs in with Alby or with Lnbits.

code in lnbits: https://github.com/lnbits/lnbits-legend/blob/dbab18175935a65fa3a41a4869257953f5ec38cb/lnbits/core/models.py#L41

kirkawolff commented 2 years ago

No matter how hard I try, I can't figure out what lnbits is putting in for Wallet.id and how that's defined. I believe this compatibility would only be important for lnd, eclair and lnbits wallets, and not for lndhub wallets.

bumi commented 2 years ago

I think this can only be compatible if the user connect Alby to lnbits - lnbits connected to LND or something else is unrelated there. The wallet ID must be something lnbits specific. If you create a lnbits wallet (e.g. on https://legend.lnbits.com/) you see in "API Info" on the right a "Wallet ID" entry. isn't that what is used there?

kiwiidb commented 2 years ago

What should be the signing key then exactly?

bumi commented 2 years ago
image

Turns out I am wrong. the code I linked in this issue is only a place holder so far. They don't have full lnurl-auth support.

So I think we should use a similar schema as lndhub (lnbits://${this.config.adminkey}) to create the key used for signing.