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

Add support for currencies other than NIM in payment links #49

Open
rraallvv opened this issue May 9, 2021 · 3 comments
Open

Add support for currencies other than NIM in payment links #49

rraallvv opened this issue May 9, 2021 · 3 comments

Comments

@rraallvv
Copy link

rraallvv commented May 9, 2021

This could come in handy for website owners with no knowledge of HTML and Javascript that want to add a payment or donation button in a currency other than NIM.

There is a discussion thread on the forum addressing this issue.

@sisou
Copy link
Member

sisou commented May 24, 2021

We now plan to add support to the Wallet to enter an amount in a fiat currency while creating a request link, but the link will still be denominated in crypto. The request links follow the BIP-21 specification which does not allow specifying a different currency than the protocol determines (https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki). We want the links be able to be read by any other BTC and NIM wallets (such as TrustWallet), which means we need to adhere to the standard.

@rraallvv
Copy link
Author

We now plan to add support to the Wallet to enter an amount in a fiat currency while creating a request link

Thanks for the the info @sisou. That would be awesome.

What follows is just me thinking out loud... after reading the specification, particularly in the section forward compatibility, where it says:

Any other variables which are not implemented, but which are not prefixed with a req-, can be safely ignored.

It occurred to me that perhaps some optional parameters would do the trick, for instance nimiq-currency and nimiq-amount for specifying the parameters that were used when creating the payment link. Those parameters would be safely ignored by any wallet other than the official wallet, and the value in NIM specified in the parameter amount would be used instead.

Although with such implementation, most people might end up receiving a different amount that the specified when creating the link, and they wouldn't know for sure what the payment was for or the exchange rate that was used, assuming it was the actual rate and not someone trying to use a fake one.

@sisou
Copy link
Member

sisou commented May 25, 2021

You are right, we can use custom variables.
It likely makes no sense for request links created in the Wallet. But for the use case that started this discussion, the donation button, it does make sense. Since the donation button links to the Wallet, we can use custom variables and interpret them, while all other wallets that use this link would simply not pre-fill the amount (because we would leave the amount variable out and use a custom one, e.g. fiat-amount instead). That could work.

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

2 participants