From b4c7280968a2e845f5ed9127d93cb3ea00087848 Mon Sep 17 00:00:00 2001 From: rphair Date: Sun, 17 Jan 2021 21:46:47 +0530 Subject: [PATCH 01/14] added work from PR#25 to support single stake pool links as well --- CIP-0013/CIP-0013.md | 74 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 64 insertions(+), 10 deletions(-) diff --git a/CIP-0013/CIP-0013.md b/CIP-0013/CIP-0013.md index a3ea112d7..68fceee7c 100644 --- a/CIP-0013/CIP-0013.md +++ b/CIP-0013/CIP-0013.md @@ -1,27 +1,36 @@ --- CIP: 13 Title: Cardano URI Scheme -Authors: Sebastien Guillemot , Vicente Almonacid +Authors: Sebastien Guillemot , Vicente Almonacid , Robert Phair Comments-URI: - https://github.com/Emurgo/EmIPs/pull/2 - https://forum.cardano.org/t/cip-cardano-payment-uri-scheme/41457 +- https://github.com/cardano-foundation/CIPs/pull/25 +- https://forum.cardano.org/t/cip-stake-uri-scheme-for-pools-delegation-portfolios/40594 Status: Draft Type: Informational -Created: 2020-10-20 +Created: 2020-09-22 License: CC-BY-4.0 --- # Abstract -This proposal describes a basic URI scheme to handle ADA transfers, as well -as possible approaches for a multiplatform implementation. +This proposal describes a basic URI scheme to handle ADA transfers and links to stake pools, as well as possible approaches for a multiplatform implementation. # Motivation +#### For payment URIs: + 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). If donating was as simple as clicking a link that opens a light wallet with pre-populated fields, users may be more willing to send tokens. URI schemes would enable users to easily make payments by simply clicking links on webpages or scanning QR Codes. +#### For stake pool URIs: + +Centralised sources of information, such as the Daedalus ranking algorithm and its presentation to the delegating user, have led a growing amount of stake to be disproportionately assigned to pools pushed near & beyond the saturation point. + +Stake pool URIs will provide a convenient and popular alternative to the trend of stake centralisation, while supporting diversity and resilience in the Cardano network. + # Specification 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:`) @@ -30,9 +39,11 @@ Rationale: - 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) - Many wallets support multiple currencies. Following the same standard will ensure higher adoption of our protocol. -Example: +Examples: ``` Donate +Stake with us +Choose our least saturated pool ``` ## Considerations @@ -43,20 +54,47 @@ Example: ## ABNF Grammar (Proposal) -This is an initial, simplified protocol definition for fast implementation; it only requires an address and an optional amount parameter. As discussed above, these rules are likely to evolve in time in order to support additional features, including unique capabilities of the Cardano blockchain. +This is an initial, simplified protocol definition for fast implementation; it only requires: + +* for a payment URI (authority unspecified), an address and an optional amount parameter; +* for a stake pool URI (authority = `stake`), a single stake pool reference. + +As discussed above, these rules are likely to evolve in time in order to support additional features, including multiple stake pool references (in proportions defining a "portfolio") and other unique capabilities of the Cardano blockchain. ``` -cardanourn = "web+cardano:" cardanoaddress [ "?" amountparam ] +cardanourn = "web+cardano:" (paymentref | stakepoolref) + +paymentref = cardanoaddress [ "?" amountparam ] cardanoaddress = *(base58 | bech32) -amountparam = "amount=" *digit [ "." *digit ] +amountparam = "amount=" *digit [ "." *digit ] + +stakepoolref = "//stake?" stakepool +stakepool = poolhexid | poolticker +poolhexid = 56HEXDIG +poolticker = 3*5UNICODE ``` +### Payment URI queries + 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. +### Stake pool URI queries + +For brevity, essential in many Internet contexts, `poolticker` must be supported here in addition to the unambiguous `poolhexid`. A safe interpretation of `poolticker` should be assured by the Daedalus wallet's integration with [SMASH](https://github.com/input-output-hk/smash) metadata. + +When there is more than one pool registered with the specified `poolTicker` (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 to finally delegate is left to the user through the wallet UI. + +In all cases above, the wallet UI must select, out of multiple wallets, which wallet(s) the user will be delegating from, and should confirm the exact choice even when it is unambiguous from the URI. + +These yet unsupported parameters in the URI query string should (by preference of the wallet UI designers) *either* be ignored *or* generate a warning message, to avoid leading the user to believe they are implementing a currently unsupported but perhaps popularly referenced multi-pool delegation list: + +* any value for the first URI query argument; +* any URI query argument beyond the first. + ## Security Considerations -1. 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. -2. We should be wary of people who disguise “donate” links as actually opening up a phishing website that LOOKS like a wallet. +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. +2. For either payment or staking links, we should be wary of people who disguise links as actually opening up a phishing website that LOOKS like that corresponding part of the wallet UI. # Rationale @@ -64,6 +102,18 @@ The amount parameter must follow the [same rules](https://github.com/bitcoin/bip 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. +## Why stake pool links are important + +The popular choice for Cardano stake pool promotion has so far been an already saturated and heavily centralised YouTube market for stake pool promotional videos, purporting to be educational while collectively carrying rapidly obsoleted information and exploitative influences. Stake pools should also be directly supported by delegators based on *relevant HTML content* to create an ecosystem with relevance and accountability. + +As K continues to increase, options for convenient *and informed* re-delegation will be more important as Ada holders face pool saturation more often. Both delegators and small pools looking to survive will inevitably rely on sources of information outside the wallet to connect delegators with pools beyond the highly contested top choices of the in-wallet ranking algorithms. + +Beyond the obvious help to small pools, further increases in the K value will also make this feature important for *larger* pools, to provide an "exit strategy" for saturated or saturating pools. + +A sudden DeFi migration to Cardano would cause a vast, sudden increase in transaction frequency and depth that the stake pool network will need to support with quality and diversity. A flow of delegation following small stake pool URIs will help maintain a number of pools sufficient to accommodate Cardano's needs during such expansion periods, by encouraging smaller operators to keep their pools operational and performant. + +More meaningful association between a pool's social identity and delegated stake will help ensure that pool operators are rewarded, by their own communities and other supporters. This will be further encouraged as when multiple pool links develop from this URI standard, which can implement crowd-sourced delegation to large numbers of smaller pools based on common interests. + ## Read More https://developer.mozilla.org/en-US/docs/Web/API/Navigator/registerProtocolHandler @@ -75,3 +125,7 @@ https://developer.android.com/training/app-links/deep-linking#adding-filters https://facebook.github.io/react-native/docs/linking.html https://developer.apple.com/documentation/uikit/core_app/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app + +https://en.wikipedia.org/wiki/Augmented_Backus%E2%80%93Naur_form + +https://tools.ietf.org/html/draft-seantek-unicode-in-abnf-00 From b24d0ef3e65936292f05319ffb2ba3cfe565d8c6 Mon Sep 17 00:00:00 2001 From: rphair Date: Sun, 17 Jan 2021 21:57:46 +0530 Subject: [PATCH 02/14] for brevity --- CIP-0013/CIP-0013.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CIP-0013/CIP-0013.md b/CIP-0013/CIP-0013.md index 68fceee7c..a86a2ee1e 100644 --- a/CIP-0013/CIP-0013.md +++ b/CIP-0013/CIP-0013.md @@ -106,9 +106,7 @@ An alternative solution to the original problem described above is to use standa The popular choice for Cardano stake pool promotion has so far been an already saturated and heavily centralised YouTube market for stake pool promotional videos, purporting to be educational while collectively carrying rapidly obsoleted information and exploitative influences. Stake pools should also be directly supported by delegators based on *relevant HTML content* to create an ecosystem with relevance and accountability. -As K continues to increase, options for convenient *and informed* re-delegation will be more important as Ada holders face pool saturation more often. Both delegators and small pools looking to survive will inevitably rely on sources of information outside the wallet to connect delegators with pools beyond the highly contested top choices of the in-wallet ranking algorithms. - -Beyond the obvious help to small pools, further increases in the K value will also make this feature important for *larger* pools, to provide an "exit strategy" for saturated or saturating pools. +As K continues to increase, options for convenient *and informed* re-delegation will be more important as Ada holders face pool saturation more often. Both delegators and small pools looking to survive will inevitably rely on sources of information outside the wallet to connect delegators with pools beyond the highly contested top choices of the in-wallet ranking algorithms. Larger pools will also need these URIs to provide an "exit strategy" from their saturating or saturated pools to preferred alternates. A sudden DeFi migration to Cardano would cause a vast, sudden increase in transaction frequency and depth that the stake pool network will need to support with quality and diversity. A flow of delegation following small stake pool URIs will help maintain a number of pools sufficient to accommodate Cardano's needs during such expansion periods, by encouraging smaller operators to keep their pools operational and performant. From 235ad40f7f4e0628c45eb87d4886978c06228064 Mon Sep 17 00:00:00 2001 From: rphair Date: Sun, 17 Jan 2021 22:02:03 +0530 Subject: [PATCH 03/14] for clarity --- CIP-0013/CIP-0013.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CIP-0013/CIP-0013.md b/CIP-0013/CIP-0013.md index a86a2ee1e..3e80c65e5 100644 --- a/CIP-0013/CIP-0013.md +++ b/CIP-0013/CIP-0013.md @@ -106,7 +106,7 @@ An alternative solution to the original problem described above is to use standa The popular choice for Cardano stake pool promotion has so far been an already saturated and heavily centralised YouTube market for stake pool promotional videos, purporting to be educational while collectively carrying rapidly obsoleted information and exploitative influences. Stake pools should also be directly supported by delegators based on *relevant HTML content* to create an ecosystem with relevance and accountability. -As K continues to increase, options for convenient *and informed* re-delegation will be more important as Ada holders face pool saturation more often. Both delegators and small pools looking to survive will inevitably rely on sources of information outside the wallet to connect delegators with pools beyond the highly contested top choices of the in-wallet ranking algorithms. Larger pools will also need these URIs to provide an "exit strategy" from their saturating or saturated pools to preferred alternates. +As K continues to increase, options for convenient *and informed* re-delegation will be more important as Ada holders face pool saturation more often. Both delegators and small pools looking to survive will inevitably rely on sources of information outside the wallet to connect delegators with pools beyond the highly contested top choices of the in-wallet ranking algorithms. Larger pools and collectives will also need these URIs to provide an "exit strategy" from saturating or saturated pools to preferred alternates. A sudden DeFi migration to Cardano would cause a vast, sudden increase in transaction frequency and depth that the stake pool network will need to support with quality and diversity. A flow of delegation following small stake pool URIs will help maintain a number of pools sufficient to accommodate Cardano's needs during such expansion periods, by encouraging smaller operators to keep their pools operational and performant. From 75faa8f06f8003115e1570f437fa80cd27d9624f Mon Sep 17 00:00:00 2001 From: rphair Date: Mon, 18 Jan 2021 15:28:41 +0530 Subject: [PATCH 04/14] response to first round of editing by co-author --- CIP-0013/CIP-0013.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/CIP-0013/CIP-0013.md b/CIP-0013/CIP-0013.md index 3e80c65e5..20c4d185d 100644 --- a/CIP-0013/CIP-0013.md +++ b/CIP-0013/CIP-0013.md @@ -6,6 +6,7 @@ Comments-URI: - https://github.com/Emurgo/EmIPs/pull/2 - https://forum.cardano.org/t/cip-cardano-payment-uri-scheme/41457 - https://github.com/cardano-foundation/CIPs/pull/25 +- https://github.com/cardano-foundation/CIPs/pull/61 - https://forum.cardano.org/t/cip-stake-uri-scheme-for-pools-delegation-portfolios/40594 Status: Draft Type: Informational @@ -80,11 +81,13 @@ The amount parameter must follow the [same rules](https://github.com/bitcoin/bip ### Stake pool URI queries -For brevity, essential in many Internet contexts, `poolticker` must be supported here in addition to the unambiguous `poolhexid`. A safe interpretation of `poolticker` should be assured by the Daedalus wallet's integration with [SMASH](https://github.com/input-output-hk/smash) metadata. +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 the specified `poolTicker` (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 to finally delegate is left to the user through the wallet UI. -In all cases above, the wallet UI must select, out of multiple wallets, which wallet(s) the user will be delegating from, and should confirm the exact choice even when it is unambiguous from the URI. +### Handling stake pool links + +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. These yet unsupported parameters in the URI query string should (by preference of the wallet UI designers) *either* be ignored *or* generate a warning message, to avoid leading the user to believe they are implementing a currently unsupported but perhaps popularly referenced multi-pool delegation list: @@ -104,13 +107,13 @@ An alternative solution to the original problem described above is to use standa ## Why stake pool links are important -The popular choice for Cardano stake pool promotion has so far been an already saturated and heavily centralised YouTube market for stake pool promotional videos, purporting to be educational while collectively carrying rapidly obsoleted information and exploitative influences. Stake pools should also be directly supported by delegators based on *relevant HTML content* to create an ecosystem with relevance and accountability. +As K continues to increase, options for convenient and informed re-delegation will be more important as Ada holders face pool saturation more often. Interfaces that connect delegators with pools beyond the highly contested top choices of the in-wallet ranking algorithms are important to avoid saturation and maintain decentralization. -As K continues to increase, options for convenient *and informed* re-delegation will be more important as Ada holders face pool saturation more often. Both delegators and small pools looking to survive will inevitably rely on sources of information outside the wallet to connect delegators with pools beyond the highly contested top choices of the in-wallet ranking algorithms. Larger pools and collectives will also need these URIs to provide an "exit strategy" from saturating or saturated pools to preferred alternates. +Larger pools and collectives can also use these URIs to link to a family of pools they own to avoid any one of their pools becoming saturated. -A sudden DeFi migration to Cardano would cause a vast, sudden increase in transaction frequency and depth that the stake pool network will need to support with quality and diversity. A flow of delegation following small stake pool URIs will help maintain a number of pools sufficient to accommodate Cardano's needs during such expansion periods, by encouraging smaller operators to keep their pools operational and performant. +Pool links allow for interfaces to initiate delegation transactions without requiring any code modifications to the wallets themselves. -More meaningful association between a pool's social identity and delegated stake will help ensure that pool operators are rewarded, by their own communities and other supporters. This will be further encouraged as when multiple pool links develop from this URI standard, which can implement crowd-sourced delegation to large numbers of smaller pools based on common interests. +A sudden DeFi migration to Cardano would cause a vast, sudden increase in transaction frequency and depth that the stake pool network will need to support with quality and diversity. A flow of delegation following small stake pool URIs will help maintain a number of pools sufficient to accommodate Cardano's needs during such expansion periods, by encouraging smaller operators to keep their pools operational and performant. More meaningful association between a pool's social identity and delegated stake will help ensure that pool operators are sufficiently rewarded by their own communities and other supporters. ## Read More From 0389fa18031ca4c412ec2667b731bdf8866cb161 Mon Sep 17 00:00:00 2001 From: rphair Date: Mon, 18 Jan 2021 19:18:16 +0530 Subject: [PATCH 05/14] second round of co-author edits --- CIP-0013/CIP-0013.md | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/CIP-0013/CIP-0013.md b/CIP-0013/CIP-0013.md index 20c4d185d..7f16b925c 100644 --- a/CIP-0013/CIP-0013.md +++ b/CIP-0013/CIP-0013.md @@ -16,7 +16,7 @@ License: CC-BY-4.0 # Abstract -This proposal describes a basic URI scheme to handle ADA transfers and links to stake pools, as well as possible approaches for a multiplatform implementation. +This proposal describes a basic URI scheme to handle Ada transfers and links to stake pools. # Motivation @@ -28,9 +28,13 @@ If donating was as simple as clicking a link that opens a light wallet with pre- #### For stake pool URIs: -Centralised sources of information, such as the Daedalus ranking algorithm and its presentation to the delegating user, have led a growing amount of stake to be disproportionately assigned to pools pushed near & beyond the saturation point. +Centralised sources of information have led a growing amount of stake to be disproportionately assigned to pools pushed near & beyond the saturation point. -Stake pool URIs will provide a convenient and popular alternative to the trend of stake centralisation, while supporting diversity and resilience in the Cardano network. +Stake pool URIs will provide an additional means for small pools to acquire delegation and maintain stability, supporting diversity and possibly fault-tolerance in the Cardano network through a more even distribution of stake. + +Interfaces that connect delegators with pools beyond the highly contested top choices of the in-wallet ranking algorithms are important to avoid saturation and maintain decentralization. + +Larger pools and collectives can also use these URIs to link to a family of pools they own to avoid any one of their pools becoming saturated. # Specification @@ -105,16 +109,8 @@ These yet unsupported parameters in the URI query string should (by preference o 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. -## Why stake pool links are important - -As K continues to increase, options for convenient and informed re-delegation will be more important as Ada holders face pool saturation more often. Interfaces that connect delegators with pools beyond the highly contested top choices of the in-wallet ranking algorithms are important to avoid saturation and maintain decentralization. - -Larger pools and collectives can also use these URIs to link to a family of pools they own to avoid any one of their pools becoming saturated. - Pool links allow for interfaces to initiate delegation transactions without requiring any code modifications to the wallets themselves. -A sudden DeFi migration to Cardano would cause a vast, sudden increase in transaction frequency and depth that the stake pool network will need to support with quality and diversity. A flow of delegation following small stake pool URIs will help maintain a number of pools sufficient to accommodate Cardano's needs during such expansion periods, by encouraging smaller operators to keep their pools operational and performant. More meaningful association between a pool's social identity and delegated stake will help ensure that pool operators are sufficiently rewarded by their own communities and other supporters. - ## Read More https://developer.mozilla.org/en-US/docs/Web/API/Navigator/registerProtocolHandler From adbee6ffbea9fe18a4d28db480ef33cb96df62c2 Mon Sep 17 00:00:00 2001 From: rphair Date: Mon, 18 Jan 2021 20:00:26 +0530 Subject: [PATCH 06/14] reclassified wallet integration as Motivation rather than Rationale --- CIP-0013/CIP-0013.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CIP-0013/CIP-0013.md b/CIP-0013/CIP-0013.md index 7f16b925c..dfb4b035d 100644 --- a/CIP-0013/CIP-0013.md +++ b/CIP-0013/CIP-0013.md @@ -36,6 +36,8 @@ Interfaces that connect delegators with pools beyond the highly contested top ch Larger pools and collectives can also use these URIs to link to a family of pools they own to avoid any one of their pools becoming saturated. +Pool links allow for interfaces to initiate delegation transactions without requiring any code modifications to the wallets themselves. + # Specification 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:`) @@ -109,8 +111,6 @@ These yet unsupported parameters in the URI query string should (by preference o 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. -Pool links allow for interfaces to initiate delegation transactions without requiring any code modifications to the wallets themselves. - ## Read More https://developer.mozilla.org/en-US/docs/Web/API/Navigator/registerProtocolHandler From 176b5c0a59804c42bc72fdec14d10c328db0d1f0 Mon Sep 17 00:00:00 2001 From: rphair Date: Sat, 20 Feb 2021 19:14:42 +0530 Subject: [PATCH 07/14] 2 of 3 changes from @nicarq via PR 65 --- CIP-0013/CIP-0013.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/CIP-0013/CIP-0013.md b/CIP-0013/CIP-0013.md index dfb4b035d..e3f6dd375 100644 --- a/CIP-0013/CIP-0013.md +++ b/CIP-0013/CIP-0013.md @@ -1,7 +1,7 @@ --- CIP: 13 Title: Cardano URI Scheme -Authors: Sebastien Guillemot , Vicente Almonacid , Robert Phair +Authors: Sebastien Guillemot , Vicente Almonacid , Robert Phair , Nicolas Arqueros Comments-URI: - https://github.com/Emurgo/EmIPs/pull/2 - https://forum.cardano.org/t/cip-cardano-payment-uri-scheme/41457 @@ -49,8 +49,8 @@ Rationale: Examples: ``` Donate -Stake with us -Choose our least saturated pool +Stake with us +Choose our least saturated pool ``` ## Considerations @@ -76,9 +76,12 @@ cardanoaddress = *(base58 | bech32) amountparam = "amount=" *digit [ "." *digit ] stakepoolref = "//stake?" stakepool -stakepool = poolhexid | poolticker -poolhexid = 56HEXDIG -poolticker = 3*5UNICODE +stakepool = (hexid | x) | (ticker | t) + +hexid = 56HEXDIG +x = 56HEXDIG ; same meaning as hexid +ticker = 3*5UNICODE +t = 3*5UNICODE ; same meaning as ticker ``` ### Payment URI queries From 20f35f69012cfc7dd55653cdee592feecdc3ebd5 Mon Sep 17 00:00:00 2001 From: rphair Date: Sat, 20 Feb 2021 23:52:28 +0530 Subject: [PATCH 08/14] undone most recent commit (removing PR65 suggestions) --- CIP-0013/CIP-0013.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CIP-0013/CIP-0013.md b/CIP-0013/CIP-0013.md index 7f16b925c..dfb4b035d 100644 --- a/CIP-0013/CIP-0013.md +++ b/CIP-0013/CIP-0013.md @@ -36,6 +36,8 @@ Interfaces that connect delegators with pools beyond the highly contested top ch Larger pools and collectives can also use these URIs to link to a family of pools they own to avoid any one of their pools becoming saturated. +Pool links allow for interfaces to initiate delegation transactions without requiring any code modifications to the wallets themselves. + # Specification 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:`) @@ -109,8 +111,6 @@ These yet unsupported parameters in the URI query string should (by preference o 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. -Pool links allow for interfaces to initiate delegation transactions without requiring any code modifications to the wallets themselves. - ## Read More https://developer.mozilla.org/en-US/docs/Web/API/Navigator/registerProtocolHandler From 85c4b7728e6360849175f54c342b204e106810ea Mon Sep 17 00:00:00 2001 From: rphair Date: Sun, 21 Feb 2021 00:00:01 +0530 Subject: [PATCH 09/14] undone most recent commit (removing PR65 suggestions) --- CIP-0013/CIP-0013.md | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/CIP-0013/CIP-0013.md b/CIP-0013/CIP-0013.md index e3f6dd375..dfb4b035d 100644 --- a/CIP-0013/CIP-0013.md +++ b/CIP-0013/CIP-0013.md @@ -1,7 +1,7 @@ --- CIP: 13 Title: Cardano URI Scheme -Authors: Sebastien Guillemot , Vicente Almonacid , Robert Phair , Nicolas Arqueros +Authors: Sebastien Guillemot , Vicente Almonacid , Robert Phair Comments-URI: - https://github.com/Emurgo/EmIPs/pull/2 - https://forum.cardano.org/t/cip-cardano-payment-uri-scheme/41457 @@ -49,8 +49,8 @@ Rationale: Examples: ``` Donate -Stake with us -Choose our least saturated pool +Stake with us +Choose our least saturated pool ``` ## Considerations @@ -76,12 +76,9 @@ cardanoaddress = *(base58 | bech32) amountparam = "amount=" *digit [ "." *digit ] stakepoolref = "//stake?" stakepool -stakepool = (hexid | x) | (ticker | t) - -hexid = 56HEXDIG -x = 56HEXDIG ; same meaning as hexid -ticker = 3*5UNICODE -t = 3*5UNICODE ; same meaning as ticker +stakepool = poolhexid | poolticker +poolhexid = 56HEXDIG +poolticker = 3*5UNICODE ``` ### Payment URI queries From efd6491be7edbefd2ffe3122831cbe221bf20766 Mon Sep 17 00:00:00 2001 From: Sebastien Guillemot Date: Thu, 10 Feb 2022 21:05:19 +0900 Subject: [PATCH 10/14] Collateral output CIP --- CollateralOutput/CollateralOutput.md | 60 ++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 CollateralOutput/CollateralOutput.md diff --git a/CollateralOutput/CollateralOutput.md b/CollateralOutput/CollateralOutput.md new file mode 100644 index 000000000..ae786ed59 --- /dev/null +++ b/CollateralOutput/CollateralOutput.md @@ -0,0 +1,60 @@ +--- +CIP: ? +Title: Explicit Collateral Output +Authors: Sebastien Guillemot +Status: Draft +Type: Standards +Created: 2022-02-10 +License: CC-BY-4.0 +--- + +# Abstract + +This document describes adding a new output type to transactions called Collateral Outputs + +# Motivation + +As of Alonzo, transactions that call Plutus smart contracts are required to put up collateral to cover the potential cost of smart contract execution failure. Inputs used as collateral have the following properties: + +1. Cannot contain any tokens (only ADA) +2. Cannot be a script address +3. Must be a UTXO input +4. Must be at least some percentage of the fee in the tx (concrete percentage decided by a protocol parameter) +5. Can be the same UTXO entry as used in non-collateral tx input +6. Is consumed entirely (no change) if the contract execution fails during phase 2 validation +7. Is not consumed if phase phase 2 validation succeeds + +Additionally, there cannot be more than *maxColInputs* (protocol parameter) inputs and the inputs have to cover a percentage of the fee defined by *collateralPercent* (protocol parameter) + +However, + +- Restriction #1 is problematic because hardcore dApp users rarely have UTXO entries that do not contain any tokens. To combat this, wallets have created a special wallet-dependent "collateral" UTXO to reserve for usage of collateral for dApps which is not a great UX. +- Restriction #6 is problematic because wallets want to protect users from signing transactions with large collateral as they cannot verify whether or not the transaction will fail when submitted (especially true for hardware wallets) + +# Specification + +If phrase-2 verification fails, we can send outputs to a special output marked as the collateral output. + +There are two ways to create collateral outputs + +1. Add collateral outputs as a new field inside the transaction. This change is similar to how collateral inputs were created a new field +2. Change the definition of outputs as `TxOut = Addr × Value × DataHash? × Source?` where source (optional for backwards compatibility) is an enum `0 = regular output, 1 = collateral output`. + +Option #1 provides the best backwards compatibility because we don't expect phase-2 validation to be a common occurrence and so wallets that (due to not being updated) never check collateral outputs will still in the overwhelming majority of cases return the correct result. + +Additionally, this requires updating the collateral requirement. + +If no collateral output is specified (and therefore no tokens are in the collateral input), then we keep the old definition + +``` +ubalance (collateral txb ◁ utxo) ≥ quot (txfee txb * (collateralPercent pp)) 100 +``` + +However, if collateral output is specified, then +1. Each collateral output needs to satisfy the same minimum ADA requirement as regular outputs +2. Collateral output needs to be balanced according to `sum(collateral_input) = sum(collateral_output) + collateral_consumed` +Where `collateral_consumed` is equal to the old formula (`quot (txfee txb * (collateralPercent pp)) 100`). Note that when collateral is consumed, any certificate, etc. in the transaction is ignored so they have no impact on the change calculation. + +## Copyright + +This CIP is licensed under [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/legalcode) From d3c48ce7734911fa7fc6ad7f64878b23d1d1c156 Mon Sep 17 00:00:00 2001 From: Sebastien Guillemot Date: Thu, 10 Feb 2022 21:09:28 +0900 Subject: [PATCH 11/14] rename file --- CollateralOutput/{CollateralOutput.md => README.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename CollateralOutput/{CollateralOutput.md => README.md} (100%) diff --git a/CollateralOutput/CollateralOutput.md b/CollateralOutput/README.md similarity index 100% rename from CollateralOutput/CollateralOutput.md rename to CollateralOutput/README.md From 07ff3b55323153a71aceabad97a6996edf848e63 Mon Sep 17 00:00:00 2001 From: Sebastien Guillemot Date: Tue, 15 Feb 2022 03:28:03 +0900 Subject: [PATCH 12/14] Include self-contained balancing requirement --- CollateralOutput/README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CollateralOutput/README.md b/CollateralOutput/README.md index ae786ed59..bdaa815be 100644 --- a/CollateralOutput/README.md +++ b/CollateralOutput/README.md @@ -1,7 +1,7 @@ --- CIP: ? Title: Explicit Collateral Output -Authors: Sebastien Guillemot +Authors: Sebastien Guillemot , Jared Corduan Status: Draft Type: Standards Created: 2022-02-10 @@ -55,6 +55,10 @@ However, if collateral output is specified, then 2. Collateral output needs to be balanced according to `sum(collateral_input) = sum(collateral_output) + collateral_consumed` Where `collateral_consumed` is equal to the old formula (`quot (txfee txb * (collateralPercent pp)) 100`). Note that when collateral is consumed, any certificate, etc. in the transaction is ignored so they have no impact on the change calculation. +## Self-contained balancing + +Some use-cases like hardware wallets, who do not have access to the content of the collateral inputs, cannot easily check if the collateral is balanced. Similar to how we specify an explicit fee as part of the transaction body to tackle this problem, the transaction body also needs a new field that explicitly specified how much collateral will be consumed in the case of phase-2 validation failure. + ## Copyright This CIP is licensed under [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/legalcode) From 138565ea4c2303fabc576c0f7f67228a54124b17 Mon Sep 17 00:00:00 2001 From: Sebastien Guillemot Date: Tue, 15 Feb 2022 19:31:08 +0900 Subject: [PATCH 13/14] Add Andre to the CIP --- CollateralOutput/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CollateralOutput/README.md b/CollateralOutput/README.md index bdaa815be..154ce4271 100644 --- a/CollateralOutput/README.md +++ b/CollateralOutput/README.md @@ -1,7 +1,7 @@ --- CIP: ? Title: Explicit Collateral Output -Authors: Sebastien Guillemot , Jared Corduan +Authors: Sebastien Guillemot , Jared Corduan , Andre Knispel Status: Draft Type: Standards Created: 2022-02-10 From c50eff35c4cd468e86e482182c392cd922b42aed Mon Sep 17 00:00:00 2001 From: rphair Date: Sat, 2 Jul 2022 16:10:49 -0400 Subject: [PATCH 14/14] pre merge changes, attempt as 3rd party --- {CollateralOutput => CIP-0040}/README.md | 4 ++-- README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename {CollateralOutput => CIP-0040}/README.md (99%) diff --git a/CollateralOutput/README.md b/CIP-0040/README.md similarity index 99% rename from CollateralOutput/README.md rename to CIP-0040/README.md index 154ce4271..0ecc7865f 100644 --- a/CollateralOutput/README.md +++ b/CIP-0040/README.md @@ -1,8 +1,8 @@ --- -CIP: ? +CIP: 40 Title: Explicit Collateral Output Authors: Sebastien Guillemot , Jared Corduan , Andre Knispel -Status: Draft +Status: Proposed Type: Standards Created: 2022-02-10 License: CC-BY-4.0 diff --git a/README.md b/README.md index 8cc4bc070..9b3773751 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ The entire process is described in greater detail in [CIP1 - "CIP Process"](./CI | 34 | [Chain ID Registry](./CIP-0034/) | Draft | | 35 | [Plutus Core Evolution](./CIP-0035) | Active | | 36 | [Catalyst/Voltaire Registration Transaction Metadata Format](./CIP-0036) | Proposed | +| 40 | [Collateral Output](https://github.com/cardano-foundation/CIPs/pull/216) | | 42 | [New Plutus Builtin: serialiseBuiltinData](./CIP-0042) | Proposed | | 52 | [Cardano Audit Best Practice Guidelines](./CIP-0052) | Proposed | | 1852 | [HD (Hierarchy for Deterministic) Wallets for Cardano](./CIP-1852/) | Active | @@ -75,7 +76,6 @@ Below are listed tentative CIPs still under discussion with the community. Discu | 37? | [Dynamic Saturation Based on Pledge](https://github.com/cardano-foundation/CIPs/pull/163) | | 38? | [On-Chain Token Metadata Standard](https://github.com/cardano-foundation/CIPs/pull/137) | | 39? | [Smart Contract Software Licenses](https://github.com/cardano-foundation/CIPs/pull/185) | -| 40? | [Collateral Output](https://github.com/cardano-foundation/CIPs/pull/216) | | 41? | [Collateral Rewards](https://github.com/cardano-foundation/CIPs/pull/217) | | 44? | [Additional Factors For NFT Market Verification](https://github.com/cardano-foundation/CIPs/pull/226) | | 45? | [Decentralization: Using Pledge as a Bidding Param](https://github.com/cardano-foundation/CIPs/pull/229) |