You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* first draft, will proofread for GitHub flavoured markdown
* remove accidentally duplicated line
* URI scheme is no longer "basic" but all encompassing
* ugly typo at top, need to correct immediately
* clarify that other URI standards should have their own CIPs
* doc reorganisation means "next" link not appropriate anymore
* better clarification of terms used in grammar
* ABNF section improperly broken between protocols + badly formatted
* makes more sense with *all* stake pool details in one place
* former "grammar" only section now includes *interpretation*
* final corrections for initial draft
* consolidated + simplified language for payment links vs BIP-21
* moved payment Rationale out of Spec, simplified section anchors
* typo
* current discussion has become significant
This proposal describes a basic URI scheme to handle Ada transfers and links to single stake pools or weighted lists of multiple pools.
27
+
This describes a general standard URI scheme with two specific protocols to handle Ada transfers and links to weighted lists of stake pools.
25
28
26
29
## Motivation: why is this CIP necessary?
27
30
31
+
### In general:
32
+
33
+
Developers of protocols that use URI schemes should be able to choose unique protocol keywords indicating how these links are handled by applications.
34
+
35
+
Beyond the two earliest defined protocols below, protocols using distinct keywords (e.g. `//stake`) can be defined in other CIPs and implemented without ambiguity by applications which interpret those particular URI protocols.
36
+
28
37
### For payment URIs:
29
38
30
39
Users who create community content often want donations as a financial incentive. However, forcing users to open their wallet and copy-paste an address lowers the amount of people likely to send tokens (especially if they have to sync their wallet first).
@@ -49,74 +58,79 @@ URIs for weighted stake pool lists provide alternatives to using a JSON file to
49
58
50
59
The core implementation should follow the [BIP-21](https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki) standard (with `bitcoin:` replaced with `web+cardano:`)
51
60
52
-
Rationale:
53
-
- Use `cardano:` over `ada:` as other projects that implement this standard tend to take the project name over the currency name (this makes sense if we consider this protocol as a generic way for interacting with the blockchain through wallets - as opposed to a simple payment system)
54
-
- Many wallets support multiple currencies. Following the same standard will ensure higher adoption of our protocol.
The protocol term (e.g. `//stake`) is called the _authority_ as defined in [Wikipedia > Uniform Resource Identifier > Syntax](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Syntax).
65
71
66
-
1. BIP-21 is limited to only features Bitcoin supports. A similar feature for Ethereum would, for example, also support gas as an extra parameter. BIP-21 is easily extensible but we have to take precaution to avoid different wallets having different implementations of these features as they become available on Cardano. To get an idea of some extra features that could be added, consider this (still under discussion) proposal for Ethereum: [EIP-681](https://eips.ethereum.org/EIPS/eip-681)
72
+
### Choice of URI scheme name
67
73
68
-
2. Depending on the protocol registration method (see next section), browsers generally enforce a `web+` or `ext+` prefix for non-whitelisted protocols (note: `bitcoin:` was whitelisted; see [registerProtocolHandler > Permitted schemes](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/registerProtocolHandler#permitted_schemes)). The prefix `ext+` is recommended for extensions, but not mandatory (see [protocol_handlers](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/protocol_handlers)).
74
+
`cardano:` is chosen over `ada:` because other projects that implement this standard tend to take the project name over the currency name (this makes sense if we consider this protocol as a generic way for interacting with the blockchain through wallets and dApps - as opposed to a simple payment system).
69
75
70
-
### ABNF Grammar (Proposal)
76
+
Depending on the protocol registration method (see Rationale), browsers generally enforce a `web+` or `ext+` prefix for non-whitelisted protocols (note: `bitcoin:` was whitelisted; see [registerProtocolHandler > Permitted schemes](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/registerProtocolHandler#permitted_schemes)). The prefix `ext+` is recommended for extensions, but not mandatory (see [protocol_handlers](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/protocol_handlers)).
71
77
72
-
This is an initial, simplified protocol definition for fast implementation; it only requires:
78
+
### Grammar & interpretation
73
79
74
-
* for a payment URI (authority unspecified), an address and an optional amount parameter;
75
-
* for a stake pool URI (authority = `stake`), a weighted list of one or more stake pools.
80
+
This top-level definition is mainly to allow switching to a particular protocol for each separately defined `authority`, with a payment link being the default:
76
81
77
-
As discussed above, these rules are likely to evolve in order to support other capabilities of the Cardano blockchain.
82
+
* When `authority` is unspecified, it is a payment URI (with an address and an optional amount parameter;
83
+
* When `authority` is explicit (containing `//` followed by the authority keyword), it is defined in the `//stake` case below or in a separate CIP for that protocol.
-[RFC 2234: Augmented BNF for Syntax Specifications: ABNF](https://datatracker.ietf.org/doc/html/rfc2234)
100
96
-[Unicode in ABNF](https://tools.ietf.org/html/draft-seantek-unicode-in-abnf-00)
101
97
102
98
#### Payment URI queries
103
99
100
+
```
101
+
paymentref = cardanoaddress [ "?" amountparam ]
102
+
cardanoaddress = *(base58 | bech32)
103
+
amountparam = "amount=" *digit [ "." *digit ]
104
+
```
105
+
104
106
The amount parameter must follow the [same rules](https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki#transfer-amountsize) described in BIP-21, namely, it must be specified in decimal ADA, without commas and using the period (.) decimal separator.
105
107
106
108
#### Stake pool URI queries
107
109
108
-
For brevity, essential in many Internet contexts, `poolticker` must be supported here in addition to the unambiguous `poolhexid`.
When there is more than one pool registered with any of the specified `poolticker` parameters (whether for pool groups which have the same ticker for all pools, or for separate pools using the same ticker), the choice to which pool(s) to finally delegate is left to the user through the wallet UI.
115
+
stakepool = poolhexid | poolticker
116
+
poolhexid = 56HEXDIG
117
+
poolticker = 3*5UNICODE
118
+
119
+
proportion = *digit [ "." *digit ]
120
+
```
121
+
122
+
For brevity, essential in many Internet contexts, `poolticker` must be supported here in addition to the unambiguous `poolhexid`.
111
123
112
-
##### Interpretation of `proportion`:
124
+
##### Interpretation of `proportion`
113
125
114
126
* If only one stake pool is specified, any proportion is meaningless and ignored.
115
127
* If all stake pools have a numerical proportion, each component of the resulting stake distribution will have the same ratio as the provided `proportion` to the sum of all the propotions.
116
128
* Any missing `proportion` is assigned a precise value of `1`.
117
129
* If a stake pool is listed multiple times, the URI is rejected as invalid.
118
130
119
-
### Handling stake pool links
131
+
##### Handling stake pool links
132
+
133
+
When there is more than one pool registered with any of the specified `poolticker` parameters (whether for pool groups which have the same ticker for all pools, or for separate pools using the same ticker), the choice to which pool(s) to finally delegate is left to the user through the wallet UI.
120
134
121
135
The wallet UI should always confirm the exact delegation choice even when it is unambiguous from the URI. When the user has multiple wallets, the wallet UI must select which wallet(s) the user will be delegating from.
122
136
@@ -125,6 +139,10 @@ If, during a wallet or other application's development process, it is still only
125
139
* any value for the first URI query argument;
126
140
* any URI query argument beyond the first.
127
141
142
+
#### Other URI queries
143
+
144
+
An ABNF grammar should be specified and explained similarly for each CIP that defines a new Cardano URI authority by explicitly defining the terms `authority` and `query` as for the "Stake pool" case above.
145
+
128
146
### Security Considerations
129
147
130
148
1. For payment links, we cannot prompt the user to send the funds right away as they may not be fully aware of the URI they clicked or were redirected to. Instead, it may be better to simply pre-populate fields in a transaction.
@@ -133,7 +151,9 @@ If, during a wallet or other application's development process, it is still only
133
151
134
152
## Rationale: how does this CIP achieve its goals?
135
153
136
-
### Why not use Universal links, deep links or other non-protocol-based Solution?
154
+
### Rationale for general URI scheme
155
+
156
+
#### Why not use Universal links, deep links or other non-protocol-based Solution?
137
157
138
158
An alternative solution to the original problem described above is to use standard URL links in combination with a routing backend system. The routing system is used to redirect to the app's URI. The advantage of this scheme is that it allows to provide a fallback mechanism to handle the case when no application implementing the protocol is installed (for instance, by redirecting to the App Store or Google Play). This is the approach behind iOS Universal Links and Android App Links. In general, it provides a better user experience but requires a centralized system which makes it unsuitable for as a multi-app standard.
139
159
@@ -143,13 +163,21 @@ For background, see
143
163
-[Apple Developer Docs > Defining a custom URL scheme for your app](https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app)
### How URI delegation portfolio links supplement use of JSON files for the same purpose?
166
+
### Rationale for payment links
167
+
168
+
#### Why confine payment links to address and amount like BIP-21?
169
+
170
+
BIP-21 is limited to only features Bitcoin supports. A similar feature for Ethereum would, for example, also support gas as an extra parameter. BIP-21 is easily extensible but we have to take precaution to avoid different wallets having different implementations of these features as they become available on Cardano. To get an idea of some extra features that could be added, consider this (still under discussion) proposal for Ethereum: [EIP-681](https://eips.ethereum.org/EIPS/eip-681)
171
+
172
+
### Rationale for stake pool links
173
+
174
+
#### How do URI delegation portfolio links supplement use of JSON files for the same purpose?
147
175
148
176
URIs facilitate the "social element" of delegated staking and pool promotion through a socially familiar, easily accessible, and less centralised convention for sharing stake pool references and potential delegation portfolios without having to construct or host a JSON file.
149
177
150
178
The processing of a JSON file delivered by a web server will depend highly on a user's platform and might not even be seen by the wallet application at all. With a properly associated `web+cardano:` protocol, developers and users have another option available in case JSON files are not delivered properly to the wallet application.
151
179
152
-
For a CIP based on this principle, see [CIP-0017](https://github.com/cardano-foundation/CIPs/tree/master/CIP-0017).
180
+
For a CIP based on this principle, see [CIP-0017](https://github.com/cardano-foundation/CIPs/blob/master/CIP-0017/README.md).
153
181
154
182
## Path to Active
155
183
@@ -159,18 +187,24 @@ For a CIP based on this principle, see [CIP-0017](https://github.com/cardano-fou
159
187
-[x] Yoroi
160
188
-[x] There exist one or more wallets supporting Stake Pool URIs.
161
189
-[ ] TBD
190
+
-[x] There exist other CIPs or drafts defining additional URI protocols.
191
+
-[ ] There exist one or more wallets supporting additional URI protocols.
192
+
-[ ] TBD
162
193
163
194
### Implementation Plan
164
195
165
-
Survey contemporary wallet developers to suggest adoption of both feature sets, since they are likely to be considered separately:
196
+
Encourage wallet and dApp developers to support all currently defined URI protocols, keeping in mind these are each likely to be considered separately:
166
197
167
198
- Payment URIs
168
199
- Stake Pool URIs
200
+
- all other URI schemes defined in separate CIPs
169
201
170
-
This survey can be conducted and/or advocated by either (ideally both):
202
+
Education and advocacy about these standards should be done by:
171
203
204
+
- Developers of applications and standards requiring new URI schemes
0 commit comments