-
Notifications
You must be signed in to change notification settings - Fork 179
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
Add BIP21 bitcoin payment URI support to sendpayment.py #560
Conversation
Simple neat code. utACK. I played around with the regex in bip21.py to make sure it really does work. In terms of UX for bip21 in the GUI, note that the Electrum version in master branch only gives out bip21 URIs for paying into its own wallet. It must have some scheme for allowing the user to input both (address, amount) and URI. |
Added also checks and tests for non-empty address part. |
@kristapsk although I've added several comments, I don't think there is anything major, this code seems very clear. I guess you will add support for the |
Yes, this is meant to add only BIP21 support, BIP79-style PayJoin should be a separate commit. |
Yes thanks, I think you've addressed what was needed (especially the arguments logic). Nice thing about this is, it's not breaking anything that already exists, so utACK, and go ahead and merge. |
About potential GUI UX - both Electrum and Wasabi Wallet allows pasting BIP21 URI in address field, which is then automatically parsed and all related fields filled, e.g. amount, value in address field is automatically converted to address. |
Yes. Thank you. I will try to knock together a first draft of a script in the next couple of days (I hope); if you're around on IRC we can work on these things a bit together. The script will give us the material to make the Qt part. I had the same thought about the BIP21 aspect since I remember it from Electrum. |
I will try to implement generic BIP21 support in GUI first, then payjoin can be added on top of that afterwards. |
Oh yes of course, I see; good idea! |
An update on the status of this project:
|
a539345 Implement BIP21 in GUI (Kristaps Kaupe) Pull request description: Allows pasting BIP21 URI in address field for single sends. See #560 (comment). Also added stripping address field input of extra whitespace at beginning / end. <del>Change with `raise ValueError` in `decode_bip21_uri()` is needed because `amount_str` can be invalid and that raised `decimal.InvalidOperation` on `amount_to_sat()` call.</del><ins>(UPDATE - that one is already merged in with #568)</ins> Top commit has no ACKs. Tree-SHA512: 079ca866cc0cded1624531ad6397fcdeeb7ebed7c6eab778e8640561387a3c08e39be2dc137df785f3aae2ad1b4a56b636d1f304ef854da27cf651293d78266f
FWIW I disagree, with a large change like this it would I think be absolutely fine, even preferable, for the new function to be command line only, so only some (more tech savvy) users would initially try it out. I don't think adding to GUI is hard, but let's have it be in the minor release after. |
Ok, that's a valid argument. |
In future could and should be improved to add this also to Qt GUI, but didn't want to do that now, need to figure out proper UX there.
This is needed for #557.