minibits-cash / minibits_wallet

MIT License
74 stars 7 forks source link

Lightning: Support for payment comments, Tor mint support #83

Closed KraXen72 closed 4 months ago

KraXen72 commented 5 months ago

closes #48, closes #75

lightning: payment comment support

EDIT: this is out of date. comment is now edited during amount editing stage. invoice is only encoded once. The comment has to be encoded in the invoice for it to be sent.
Since the whole system is somewhat complicated, and i couldn't make sense of it, i made this small diagram.
Stuff in green is what i changed.
image

We have two options

KraXen72 commented 5 months ago

thanks for the pointing comments, i'll follow them. since this pr is marked as a draft, it's not done yet.

KraXen72 commented 5 months ago

@minibits-cash i've tested it and it worked, however, there are currently a few issues with it:

I was also thinking about maybe moving the comment input to the first stage, when the amount is inputted, but i'm not sure about it. -> not viable, amount input has all the focus and when user hits enter it takes them to the other screen. please let me know your opinion these problems. Thanks!

KraXen72 commented 5 months ago

you might want to load the large diffs as well - i avoided re-formatting as best i could, but maybe prettier's format selection command had a few side-effects and formatted more than i was currently working with...

KraXen72 commented 5 months ago

As a part of this pull request i will also include some small changes to the MintInfoScreen to fix bugs reported by a user on Telegram - namely showing support checkmark for nut15 - multi-path payments

KraXen72 commented 5 months ago

@minibits-cash i have updated the PR description and https://github.com/minibits-cash/minibits_wallet/pull/83#issuecomment-2184131272 comment, please see the changes i've made. I've tested it by sending sats to Wallet of Satoshi and it works.

EDIT: comment is not being sent to WoS, looking into it

KraXen72 commented 5 months ago

there is one more bug that sometimes happens: 'Not ready... exiting', when i enter the comment and hit confirm. it causees the comment and amount to reset, and when you input it again, it works. it doesen't happen all the time, so i can't reliably reproduce it yet to fix it.

it really mostly doesen't happen.

KraXen72 commented 5 months ago

please do not merge yet, i'm planning to add the Tor guide.

minibits-cash commented 5 months ago

there is one more bug that sometimes happens: 'Not ready... exiting', when i enter the comment and hit confirm. it causees the comment and amount to reset, and when you input it again, it works. it doesen't happen all the time, so i can't reliably reproduce it yet to fix it.

it really mostly doesen't happen.

Could not simulate so far.

minibits-cash commented 5 months ago

Recent changes - Fixed that lnurl comment did not make it to transaction detail of the payer. Quick fix that payment preimage was not logged into the audit trail. Made comment visible but consuming less space after invoice is generated.

Tested that comment is correctly passed to Wallet of Satoshi and Minibits wallet of the payee.

Still todo: test non-lnurl transfer types to avoid regressions.

KraXen72 commented 5 months ago

nice improvements! thanks!

KraXen72 commented 4 months ago

i tested an ecash payment from minibits to minibits (official mint) with and without a memo and both worked well without any issues.

minibits-cash commented 4 months ago

i tested an ecash payment from minibits to minibits (official mint) with and without a memo and both worked well without any issues.

I meant to test non-lnurl based transfers, donations, payment requests processed in TransferScreen, not ecash sends that we did not touch.

KraXen72 commented 4 months ago

I meant to test non-lnurl based transfers, donations, payment requests processed in TransferScreen, not ecash sends that we did not touch.

@minibits-cash how can i test these? thanks.

minibits-cash commented 4 months ago

I meant to test non-lnurl based transfers, donations, payment requests processed in TransferScreen, not ecash sends that we did not touch.

@minibits-cash how can i test these? thanks.

Basic flow:

  1. Create invoice via Receive/Topup or in any Lightning or ecash wallet
  2. Pay it from Minibits by scanning / pasting the invoice

Payment request (in Minibits this is lightning invoice shared with a contact over Nostr relay)

  1. Receive payment request from anothe Minibits wallet
  2. Pay it from Minibits

Donation:

  1. Book custom wallet address
  2. Pay generated invoice from the same Minibits wallet