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"
5 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)

1 Like

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