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

Daedalus payment URLs #883

Open
vsubhuman opened this issue Apr 23, 2018 · 12 comments
Open

Daedalus payment URLs #883

vsubhuman opened this issue Apr 23, 2018 · 12 comments
Assignees

Comments

@vsubhuman
Copy link

vsubhuman commented Apr 23, 2018

Description

It would be really nice to have a feature that would allow to create a "payment URL", like:

ada://send?to=DdzFFz...v7xb&amount=100&fees_included=true

And when someone opens this url in their browser - Daedalus (if installed) opens and shows a special dialog, like "Do you really want to send 100 ADA to this address: DdzFFz...v7xb?" and if user clicks Yes then Daed asks him to select a wallet he wants to send coins from. This dialog could also allow to change the transaction amount.

Motivation

This feature would allow people to create easy-to-use payment links, or for example - donation links, like "Donate 5 ADA | Donate 10 ADA" under some content, so users don't have to copy-paste addresses manually.

It maybe very useful for some application and could be a nice solution until ecosystem gets SPVs and full-browser integrations, etc. Once those are present - these links could also lead to other clients, like, if I have lite-client or SPV version of Daedalus installed - it is opened from link. If I have a browser-extension installed (possible in the feature) - then browser dialog is opened from link and allows to send coins thru this browser-client.

Implementation

Sadly I don't know much details for now, but as I understand - browsers are able to associate some types of links (by protocol, a assume) to certain applications (thru OS, probably), so when mailto is opened - email-client is launched, and when a telegram-link is opened - desktop telegram client pops-up and processes the link.

I will post comments here, if I get more info about possible implementation details later.

@SebastienGllmt
Copy link
Contributor

You need to also specify a unit instead of just an amount. Under your proposal you cannot send 0.5 ADA. It would be better to do something like &amount=100&unit=ADA vs &amount=100&unit=lovelace.
You can make ADA the default if no unit is specified though.

@vsubhuman
Copy link
Author

You need to also specify a unit instead of just an amount.

Oh yeah, totally forgot about this. Tho, the unit thing is debatable. I love the idea to not having to remember about lovelaces when specifying the amount (as I did in the example), and very many people would just automatically put amount in ADA. BUT at the same time they would then try to put numbers, like amount=3.5 or amount=0.1, without specifying unit=lovelace. And we're all know how parsing those are not the best thing for money.

So always using lovelaces might be the only stable option. People would just have to learn and accept that fact. And always using lovelaces would also force all tutorials and examples to show that fact, like "To send 1 ADA put this: ada://send?amount=1000000"


The only other sustainable option I see for now is to use two separate parameters, like coins and satoshis (or something like this). So then example with tree fiddy would look like:

ada://send?to=....&coins=3&satoshis=500000

But that looks reeeeeealy weird.

@vsubhuman
Copy link
Author

In the future these URLs could also specify the coin to be used, like:

ada://send?to=...&amount=1000000&coin=ADA

Redundant, since ADA is the default coin. Or:

ada://send?to=...&amount=100000000&coin=BTC

To send 1 BTC-20 (Cardano BTC token). Notice how there are two additional zeros in amount.

Or if IOHK develop a stable currency and call it Nash, then:

ada://send?to=...&amount=10000000&coin=NASH

To send 10 NASH :)

@SebastienGllmt
Copy link
Contributor

It's not desirable to specify the coin at the end. Rather it should go at the beginning:
ADA://
BTC://
etc.

You need to do this to be compatible with all the existing BTC links and whatnot.

@vsubhuman
Copy link
Author

vsubhuman commented Apr 25, 2018

It's not desirable to specify the coin at the end. Rather it should go at the beginning

But the idea here is that ada:// at the beginning is the protocol to interact specifically with the Cardano platform (wallet, client, plugin, etc.), and the rest are just parameters. So ada://send?coint=BTC and btc://send should probably actually be executed by different wallets on my computer, for example, since one means - "send BTC-equivalent on Cardano chain to another Cardano wallet address", and other means just "Send normal BTC to another BTC address".


Additional idea is that the send is just one of the possible methods, and in the future there could be links for staking pools, for example. Something like: ada://stake?pool_address=... so when user clicks the link - Daedalus opens specific pool page and proposes to delegate some percentage of your coins to it.

Initially I though of these links just as additional "platform API", that different clients would be able to support. To make it more obvious it may be better to change protocol name to "cardano", so initial example would look like:

cardano://send?to=DdzFFz...v7xb&amount=100&fees_included=true

With change like this, specifying coins as parameter seems more appropriate:

cardano://send?to=DdzFFz...v7xb&amount=100&fees_included=true&coin=BTC-20

And the pool example:

cardano://stake?pool_address=DdzFFz...v7xb

@SebastienGllmt
Copy link
Contributor

+1 for links to taking pools also

@vsubhuman
Copy link
Author

New idea is that Daedalus or other wallets could (and prolly should at some point) provide the function of a local address-book, where a user can keep a list of addresses with names assigned to them. In this case these "payment URLs" could also provide an operation like:

cardano://add?address=DdzFFz...&name=wikipedia.org

Which would open a Cardano wallet and add new address into the address-book, with the name assigned.

Function like this (or many similar function) could mitigate the problem that many users want to see "human-readable" addresses, which is not equal to "short hashes", but actually something like an understandable known domain name, e.g. - wikipedia.org. But actually having something like a service of registering names on-chain, or having a DNS-based solution for this would introduce a new class of problems and attacks on the platform. Meanwhile, having a URL-standard like this would nicely leave all the other complications to be resolved by name-owners and users.

In general:

  1. Domain names already exist, and already owned by people who cares for their integrity
  2. People are generally already trained in how to navigate thru the internet of domain names. There are plenty searching services, etc.
  3. Any domain holder (or app-creator, for that matter) could post a link with a name and an address, and any user could easily use this link to add address to a local storage.
  4. Link security is left to be resolved by the owner (hackers could replace links on a website), but hacking of a single website would not compromise the whole address system.
  5. 3rd party address verification services could easily emerge, where people, for example, have a Daedalus plugin that checks all newly added addresses against multiple external storages of this data (for popular addresses and websites, of course).

A solution like this looks to me very much nicer than an addition of any external "monolith" address-resolving system, which immediately becomes vulnerable for attacks like DNS-hijack (when potentially all name-address pairs can be compromised for some time), name similarity attacks (like giveaway scams on twitter), etc.

@archfan
Copy link

archfan commented Jun 2, 2019

Any progress on this?

@SebastienGllmt
Copy link
Contributor

@archfan We're currently implementing this for Yoroi
Spec: https://github.com/Emurgo/yoroi-frontend/blob/develop/docs/specs/code/URI_SCHEME.md
Implementation: Emurgo/yoroi-frontend#511
I don't think it will be part of our next release (Yoroi 1.7) but maybe (1.8) and we still need to implement it for mobile also

Daedalus team is free to implement this feature whenever they want :)

@archfan
Copy link

archfan commented Jun 6, 2019

Your team is the best! Thank you so much.

@jonathancross
Copy link

Happy to see the linked proposal follows BIP-21 :-)

@SebastienGllmt
Copy link
Contributor

This just shipped with Yoroi 1.8 on both Chrome and Firefox

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

No branches or pull requests

6 participants