Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: getAddress for (fallback?) on-chain transaction #16

Open
Overtorment opened this issue Jan 19, 2019 · 8 comments
Open

RFC: getAddress for (fallback?) on-chain transaction #16

Overtorment opened this issue Jan 19, 2019 · 8 comments

Comments

@Overtorment
Copy link

I propose to add something like this to Provider signature:

getAddress(comment: string): Promise<BitcoinAddress|String>;

For a case when Lapp needs an onchain address for whatever reason. Reason should be provided in comment which is displayed to user.
Common use cases: change; refund in case of some kind of failure; lapp wants to payout too big amount; issue with user-provided invoice (via makeInvoice) - no route/no capacity

Prodiver shall display comment to user and user should choose his regular onchain btc wallet to receive such transaction.

@wbobeirne
Copy link
Member

Since on-chain address for refunds / large payments is a part of the BOLT-11 spec, is there any reason we wouldn't just rely on that?

@Overtorment
Copy link
Author

Use-case: ZigZag exchanges lighnting coins on on-chain coins, thus, asks for onchain address, it doesnt need whole bolt invoice. Otherwise, workaround would be: makeInvoice generates bolt11 string, but ln invoice is absent/not valid/simply ignored, and only fallback address is extracted. Feels hacky.

@Overtorment
Copy link
Author

Oh, also provider might not know that fallback is really required in some case, while getAddress would specifically ask for address.

@juscamarena
Copy link

If we want to include bitcoin payments in webLN goodness I see merit in adding this call. Also agree with @Overtorment with ZigZag style exchange being able to autofill on chain address as good example.

@wbobeirne
Copy link
Member

Sorry for the delay, this makes plenty of sense to me, even more-so now with Loop. A question to the audience though:

  1. Does the address need to come back with any additional metadata about it other than the address itself? Maybe its type?
  2. Should the application be able to specify an address type, e.g. they don't support bech32? A large part of me wants to say 'no' to this because it may be difficult for some providers to adhere to address type constraints, but I want to make sure all use cases are covered.

@juscamarena
Copy link

Most services check the address and know what type it is anyway, so I don't think so.

Would be nice to have the service be able to say a they do support bech32 and prefer that, but not be a hard requirement.

@Overtorment
Copy link
Author

Overtorment commented Mar 30, 2019

  1. No
  2. No

I doubt any dinosaur application will support webLN and NOT support bech32

@juscamarena
Copy link

True, eclair seems to be one of the weird ones not offering native bech32 receive support, but it's a mobile wallet, strict bech32 would be preferred, can always add an optional type in the future, but probably not needed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants