CIP - Generalized Cardano URLs

Background

CIP13 currently defines a simple custom URI protocol (web+cardano//) that allows for (1) ADA payments and (2) signalling delegation preferences.
With more a more new functionalities coming into Cardano, there is a high chance that we see new use cases requiring new URL schemes, which may result in the current CIP13 spec being overloaded with more extensions or in new schemes based on a separate URI protocol (e.g. cardano-nft//) being adopted de facto. In fact, there is already interest in extending CIP13 for including delegation portfolios, on-chain metadata requests and eventually weā€™ll need to consider native assets in payments too.
So there is clearly a need for a more sustainable, standardised framework.

Proposal

Write a new CIP that would replace CIP13 with a definition of a generalised URL scheme based on a single URI (ie. we keep web+cardano//). This CIP should:

  • Provide a framework for adding new extensions (or actions) to the Cardano URI protocol. Tentatively this could simply be:
    web+cardano//$ACTION[?key=value][&key=value]*

  • Provide a framework for describing each new action as a separate CIP. This means that each new action, like transfer or stake should have its own CIP describing specific URI parameters, and other technical considerations.

  • Keep a track of all the new actions added to the protocol

Iā€™ll monitor this thread for a few days and then Iā€™ll submit a CIP proposal.

Backwards compatibility

Wallets may still support the old scheme, since only payments work differently and delegation actions already follow the main idea presented here.

Examples

// ADA payments can be kept as before
web+cardano//Ae2tdPwUPEZ76BjmWDTS7poTekAvNqBjgfthF92pSLSDVpRVnLP7meaFhVd

// a payment request for a specific native token
web+cardano//transfer?addr=Ae2tdPwUPEZ76BjmWDTS7poTekAvNqBjgfthF92pSLSDVpRVnLP7meaFhVd&assetId=asset1rjklcrnsdzqp65wjgrg55sy9723kw09mlgvlc3&amount=10

// single pool delegation
web+cardano://stake?d12e6fe1123bf111b77b57994bcd836af8ba2b3aa72cfcefbec2d3d4=1

// delegation portfolio, split as (1/3, 2/3).
web+cardano://stake?d12e6fe1123bf111b77b57994bcd836af8ba2b3aa72cfcefbec2d3d4=1&c94e6fe1123bf111b77b57994bcd836af8ba2b3aa72cfcefbec2d3d0=2"
7 Likes

Yo! This is a great idea Iā€™ve been trying to wrap my head around for a good while. Thanks for starting the initiative!

On my side, Iā€™ve specifically been thinking how to address metadata from URLs, and during my tests, I came up with the need for also specifying network and metadatum label.
Following your suggestion, I think a first approach/example to what Iā€™ve been trying to solve could be something like:

web+cardano://metadata?network=testnet?key=1337

Maybe also add a type for it? In e.g., type=nft721 etc?

1 Like

yes @v-almonacid I believe thatā€™s what everybody will need in the long runā€¦ just letā€™s first please complete the process of agreeing upon (by way of a properly merged CIP version) the long pending pool link (//stake) component first :sunglasses: :pray: (comment on github)

2 Likes

Great! yeah, if take this path, we can have a separate CIP for web+cardano://metadata with its own custom parameters.

1 Like

@v-almonacid @SebastienGllmt @Frederic we decided at the CIP meeting today to go ahead with this plan, since we had a recent PR proposing some detailed changes to the URI scheme (suggesting many more like it will be submitted over time).

As I think youā€™ve also imagined, Iā€™ve put forward that there would be organisational and technical bottlenecks from having one massive document (CIP-0013, which currently has the only 2 URI scopes of ā€œpayment linksā€ and ā€œstake pool linksā€) as a comprehensive URI scheme. This bottleneck would be restrictive based on the number of URI scopes I expect will be proposed.

Having one single ā€œURI frameworkā€ CIP, untouched as other URI protocol extensions emerge, would prevent one single document from having an unmanageable amount of authors who wouldnā€™t be traceable to the parts of the URI scheme they have introduced (and may also have some social / ethical responsibility for).

So Iā€™ve planned to draft a new framework CIP according to your guidelines above & the discussion at this meeting (CIP Editors Meeting #30 - Crowdcast) unless Vicente you would prefer to do it first, or as co-authors. Iā€™ll progress this in the first half of October when clear of some obligations regarding the Cardano Summit & will watch this thread in the meantime.

Hey, so it looks this ended up being necessary as I thought. Iā€™ll be happy to help with the spec. I can submit a first draft PR in the following days and then we can work together on it.

2 Likes

sounds goodā€¦ I should be ready to help progress this after about 1 more work week :sunglasses:

1 Like

Hey @COSDpool , Iā€™m really sorry but Iā€™ve been too busy and offline for quite some time. If you want to take the lead on this, go ahead cause Iā€™m really having trouble to find time to work on these kind of things right now :frowning:

1 Like

thanks @v-almonacid for the update & the vote of confidence. Iā€™ve also been having one of those offline periods, hopefully emerging soon. Looking forward to getting this done next monthā€¦ will tag you here & on Github when I have something posted :sunglasses:

p.s. @v-almonacid since in the last few months there havenā€™t been any generally applicable extensions to the Cardano URI Scheme beyond those currently documented in CIP-0013 Iā€™d been proceeding slowly with this.

Now it seems like the developer community has standardised on working with payments & stake pool delegation through the dApp connector(s) instead. This really hit home for me last week when I couldnā€™t choose a stake pool in the Nami wallet without using the web site pool.pm to formulate the delegation request so it could be signed in the wallet.

I still think as per CIP-0013 there would be great utility in using URIs for delegation changes & payments, and many other things e.g. working with metadata, but without developers going along with that idea it seems thereā€™s less need to generalise the existing Cardano URI Scheme.

Therefore Iā€™m no longer planning to submit our planned proposal (which would deprecate CIP-0013 & maybe require 2 new proposals for the payments + stake pool links) until any developer shows an interest in implementing URI support. In the meantime Iā€™ll keep watching this thread to stay aware of how others feel about this. :face_with_monocle:

2 Likes

Hey @COSDpool , that makes a lot of sense. If the feature is not required then we would just add more overhead with that CIP.

When I was working on Yoroi mobile there were a few use-cases I was thinking about which inspired this proposal. For instance, itā€™s harder to implement a dApp conector for mobile platforms so using URIs was a possible simple solution to provide at least some smart contract functionality. I donā€™t know if thatā€™s still relevant though but I think you are right and we should just wait and see.

1 Like

This is one of many quite questionable design decisions of Nami to only allow delegation to their own pool out of the box.

That being said, I really would like URIs more than full dApp connections for a lot of use cases, but if the wallet apps donā€™t do it, there is not much we can do.

1 Like

An additional reason to leave CIP-0013 alone (without creating space pre-emptively for adding more URI methods)ā€¦at todayā€™s CIP meeting, for the huge dApp Connector (CIP-0030) weā€™ve tentatively agreed that new additions should be added as separate CIPs.

Therefore, as long as weā€™re sticking with that precedent, Iā€™m going to suggest that any PRā€™s coming for new Cardano URI methods, i.e. proposing additions to CIP-0013, be submitted as separate CIPs instead.

p.s. CIP-0013 update by tomislavhoracek Ā· Pull Request #130 Ā· cardano-foundation/CIPs Ā· GitHub

Hi @COSDpool would you please help me to understand why you want us to throw CIP-0013? I would like to update it instead of re-creating a new one so we have there the whole discussion documented.

If by ā€œthrow CIP-0013ā€ you mean ā€œclose your current PR and submit a new oneā€ā€¦ Since itā€™s already explained in my last comment above, Iā€™ll post here the minutes for that meeting when theyā€™re released so you can follow that discussion.

If you want to weigh in against the group consensus that future URI protocol updates (or future dApp connector updates, etc.) be submitted as new CIPs, please consider coming to the CIP meeting and making your case.

That discussion wonā€™t be lost. In fact the latest & probably last update to CIP-0013 (ā€œStake Pool URIsā€) began as a PR which also had to be closed to follow the group consensus at the time about whether it should be a separate CIP. You can still see this discussion at the link to my closed PR#25 in the header of CIP-0013.

Already created a new draft :wink: [CIP-0035] Proposal for open Daedalus or desktop wallet via URL by danielmain Ā· Pull Request #234 Ā· cardano-foundation/CIPs Ā· GitHub
Hope itā€™s ok now

1 Like

The discussion awakens again & continues here, with the first generally useful extension to the Cardano URI Scheme proposed in over 2 years (cc @v-almonacid):

1 Like