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

Support multiple destinations in make_uri and parse_uri #7731

Open
woodser opened this issue May 20, 2021 · 20 comments
Open

Support multiple destinations in make_uri and parse_uri #7731

woodser opened this issue May 20, 2021 · 20 comments

Comments

@woodser
Copy link
Contributor

woodser commented May 20, 2021

monero-wallet-rpc supports make_uri and parse_uri which can be used to create a request for payment which the sender can parse to pay.

These calls currently only support a single destination address and amount.

This issue requests supporting multiple destination addresses and amounts to accommodate multi-output requests which can be used in a variety of applications or to prepare wallets with available outputs.

An encoding scheme is needed to support multiple addresses and amounts. The format should be small in order to accommodate limited capacity of QR codes.

@erciccione
Copy link
Contributor

There is a $500 bounty on this issue. See haveno-dex/haveno#83 for details.

@benevanoff
Copy link
Collaborator

I’ll take a stab :p

@woodser
Copy link
Contributor Author

woodser commented May 25, 2021

Example encoding scheme supported on IRC (originally proposed by @benevanoff):

monero:46BeWrHpwXmHDpDEUmZBWZfoQpdc6HaERCNmx1pEYL2rAcuwufPN9rXHHtyUA4QVy66qeFQkn6sfK8aHYjA3jk3o1Bv16em,46BeWrHpwXmHDpDEUmZBWZfoQpdc6HaERCNmx1pEYL2rAcuwufPN9rXHHtyUA4QVy66qeFQkn6sfK8aHYjA3jk3o1Bv16em?amount=239.39014,123.55423&description=donation,example (note description text needs escaped).

For backward compatibility, make_uri should produce the old format if using a single destination and address and this new format for multiple destinations and addresses.

@trasherdk
Copy link
Contributor

Positional parameters, description field optional.

monero:<addr1>,piconero,base64(desc):<addr2>,piconero,base64(desc)

@benevanoff
Copy link
Collaborator

I like @trasherdk 's suggestion better

@selsta
Copy link
Collaborator

selsta commented May 26, 2021

@trasherdk's solution will use more characters overall because you will have e.g. "?amount=" multiple times.

@trasherdk
Copy link
Contributor

I would not use ?, amount, description and =.

Using : as delimiter for separate transactions. monero:<transaction1>:<transaction2>
where a transaction is <addr1>,piconero,base64(desc) making description optional.

@selsta
Copy link
Collaborator

selsta commented May 26, 2021

@trasherdk Ok I understand now. Your proposed format is nicer than what we currently have, though it wouldn't be backwards compatible as far as I can see.

19:24 <moneromooo> In any case, it'd be nice if it was backward compatible.
19:24 <moneromooo> ie, passing one address/amount with the new rules yields an URI that old rules parse correctly.

I guess it can be discussed if having backwards compatibility is more important than a cleaner format.

@benevanoff
Copy link
Collaborator

I’m personally in favor of just biting the bullet and changing it. The payment ID field should already be deprecated iirc so I’d think that can go and having a recipient tag as well as a transaction description tag seems rather redundant since they’re both just free forms.

@benevanoff
Copy link
Collaborator

Actually now that I think about it more, it’d probably be a headache for 3rd part wallets so maybe not the best idea

@trasherdk
Copy link
Contributor

I would think it would be easier (less code) to parse my version ❓

@woodser
Copy link
Contributor Author

woodser commented May 26, 2021

Long payment IDs should still be supported afaik.

The old call should be backward compatible for a single address/amount, but it could produce the new format for multiple addresses/amounts, or we could create new RPC calls like 'create_payment_request' and 'parse_payment_request'.

@selsta
Copy link
Collaborator

selsta commented May 26, 2021

Long payment IDs should still be supported afaik.

Integrated addresses are fine. No need for external payment id field.

@hyc
Copy link
Collaborator

hyc commented May 26, 2021

Using : as delimiter for separate transactions. monero:<transaction1>:<transaction2>
where a transaction is <addr1>,piconero,base64(desc) making description optional.

URI syntax only allows for '?' and ';' as delimiters within a single URI. Please let's not invent
solutions that would break all existing URI-processing software.

@elibroftw
Copy link

The tricky part is that the bade of the Uri is an address. This makes processing additional addresses that much more annoying. The problem with the solution I'm about to propose is that wallets will have to append a query to the base address list. Which is 2 lines of code.

monero:addr1?
addr=addr2&amt=val1&addr=addr3&amt=val2

Any competent Uri parser should be able to retrieves values as a list from a Uri.

@selsta
Copy link
Collaborator

selsta commented Jan 26, 2022

@elibroftw there is a PR for it already #7737

@elibroftw
Copy link

@elibroftw there is a PR for it already #7737

Yeah I realized. Too late for me 😅

@erciccione
Copy link
Contributor

#7737 has been abandoned. Anyone willing to recover it can claim part of the bounty: haveno-dex/haveno#83

@woodser
Copy link
Contributor Author

woodser commented Dec 2, 2022

@darkdrag00n It's no longer needed in Haveno, but multiple destinations in Monero payment URIs is still a valid use case that would be good to support long term. We would still honor the bounty.*

*Reduced the bounty to $350.

@NorrinRadd
Copy link

I will take this @woodser

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

9 participants