From 96989b026d8f37f9998761ffabc99fb0ab2631df Mon Sep 17 00:00:00 2001 From: Tim Molter Date: Wed, 19 Oct 2022 13:50:16 +0200 Subject: [PATCH 1/3] initial --- kip-0016.md | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 kip-0016.md diff --git a/kip-0016.md b/kip-0016.md new file mode 100644 index 0000000..b9f83de --- /dev/null +++ b/kip-0016.md @@ -0,0 +1,98 @@ +--- +KIP: 0016 +Title: URI Scheme +Author: Tim Molter tim@eucalyptuslabs.com +Status: Draft +Type: Standard +Category: Applications +Created: 2022-10-19 +--- + +## Abstract + +This KIP proposes a URI scheme for making Kadena payments. + + +## Motivation + +The convenience of representing payment requests by standard URLs has been a major factor in the wide adoption of Bitcoin, Ethereum and others. Bringing a similarly convenient mechanism to Kadena would speed up its acceptance as a payment platform among end-users. In particular, URIs encoded as QR codes ease the process of requesting and sending payments via smart phones and end user applications. Thus, payment request URIs could be delivered through a very broad, ever growing selection of channels and accelerate the adoption and usablity of Kadena. + + +## Backwards Compatibility + +N/A + +## Specification + +### Syntax + +Payment request URIs contain "kadena" in their schema (protocol, blockchain) part and are constructed as follows: + + + request = "kadena:" k-address [ "?" kadenaparams ] + kadenaparams = [ amountparam / chainidparam / assetidparam ] + amountparam = "amount=" [Number] + chainidparam = "chainid=" [Number] + assetidparam = "assetid=" [String] + + +* Here, "String" corresponds to valid characters of an RFC 3986 URI query component, excluding the "=" and "&" characters, which this KIP takes as separators. +* "Number" corresponds to any non-negative integer or decimal. +* When reading invalid parameters, the should just be ignored. +* When creating parameters, if the are null or undfined, do not include them in the parameters list. + + +### amountparam + +The `amount` parameter defines how much KDA or token to send. Integer is not enforced because of the fact that Kadena tokens can choose their own number of decimals and there is no common smallest unit (i.e. Satoshi for Bitcoin). + +### chainidparam + +The `chainid` parameter defines which Kadena chain to send to. Valid integer values are 0 to 19. + +### assetidparam + +The `assetid` parameter defines which Kadena asset (either main Kadena (KDA) or token) to send. + +### Valid Examples + +Just the address: + kadena:k:cf415c73edb4666a967933bddc2e6c4a6e13b8ec0566e612b9f3cbe4a4d8506e + +With Amount: + kadena:k:cf415c73edb4666a967933bddc2e6c4a6e13b8ec0566e612b9f3cbe4a4d8506e?amount=1.01101 + +With Asset Id for main Kadena Coin: + kadena:k:cf415c73edb4666a967933bddc2e6c4a6e13b8ec0566e612b9f3cbe4a4d8506e + +With Asset Id for main Kadena Coin with Additional Asset Id: + kadena:k:cf415c73edb4666a967933bddc2e6c4a6e13b8ec0566e612b9f3cbe4a4d8506e?assetid=coin + +With Chain Id: + kadena:k:cf415c73edb4666a967933bddc2e6c4a6e13b8ec0566e612b9f3cbe4a4d8506e?chainid=19 + +With Asset Id for Flux token: + kadena:k:cf415c73edb4666a967933bddc2e6c4a6e13b8ec0566e612b9f3cbe4a4d8506e?assetid=runonflux.flux + +With All Parameters: + kadena:k:cf415c73edb4666a967933bddc2e6c4a6e13b8ec0566e612b9f3cbe4a4d8506e?amount=137&chainid=8&assetid=runonflux.flux + + +### Invalid Examples + +With Token Name as Schema: + flux:k:cf415c73edb4666a967933bddc2e6c4a6e13b8ec0566e612b9f3cbe4a4d8506e + +With Chain Id as String: + kadena:k:cf415c73edb4666a967933bddc2e6c4a6e13b8ec0566e612b9f3cbe4a4d8506e?chainid=XXX + +With Negative Amount: + kadena:k:cf415c73edb4666a967933bddc2e6c4a6e13b8ec0566e612b9f3cbe4a4d8506e?amount=-42 + +With Null/Undefined Parameters: + kadena:k:cf415c73edb4666a967933bddc2e6c4a6e13b8ec0566e612b9f3cbe4a4d8506e?amount=null&chainid= + + +## References +* EIP-681: +* BIP-21: From 20a19d08fd2573306f96eea53a767a825abd026b Mon Sep 17 00:00:00 2001 From: Tim Molter Date: Tue, 1 Nov 2022 07:59:23 +0100 Subject: [PATCH 2/3] added clarification about param datatypes and default values --- kip-0016.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/kip-0016.md b/kip-0016.md index b9f83de..414bb10 100644 --- a/kip-0016.md +++ b/kip-0016.md @@ -31,28 +31,28 @@ Payment request URIs contain "kadena" in their schema (protocol, blockchain) par request = "kadena:" k-address [ "?" kadenaparams ] kadenaparams = [ amountparam / chainidparam / assetidparam ] - amountparam = "amount=" [Number] - chainidparam = "chainid=" [Number] - assetidparam = "assetid=" [String] + amountparam = "amount=" {Number} + chainidparam = "chainid=" {Number} + assetidparam = "assetid=" {String} -* Here, "String" corresponds to valid characters of an RFC 3986 URI query component, excluding the "=" and "&" characters, which this KIP takes as separators. -* "Number" corresponds to any non-negative integer or decimal. +* Here, {String} datatype corresponds to valid characters of an RFC 3986 URI query component, excluding the "=" and "&" characters, which this KIP takes as separators. +* {Number} datatype corresponds to any non-negative integer or decimal. * When reading invalid parameters, the should just be ignored. -* When creating parameters, if the are null or undfined, do not include them in the parameters list. +* When creating parameters, if the are null or undefined, do not include them in the parameters list. ### amountparam -The `amount` parameter defines how much KDA or token to send. Integer is not enforced because of the fact that Kadena tokens can choose their own number of decimals and there is no common smallest unit (i.e. Satoshi for Bitcoin). +The `amount` parameter defines how much KDA or token to send. Integer is not enforced because of the fact that Kadena tokens can choose their own number of decimals and there is no common smallest unit (i.e. Satoshi for Bitcoin). `amount` is optional and not required, and if not included it is considered as undefined. ### chainidparam -The `chainid` parameter defines which Kadena chain to send to. Valid integer values are 0 to 19. +The `chainid` parameter defines which Kadena chain to send to. Valid integer values are 0 to 19. `chainid` is optional and not required, and if not included it is considered as undefined. There is no default value, i.e. `chainId` = 0. ### assetidparam -The `assetid` parameter defines which Kadena asset (either main Kadena (KDA) or token) to send. +The `assetid` parameter defines which Kadena asset (either main Kadena (KDA) or token) to send. `assetid` is optional and not required, and if not included it is considered the main Kadena (KDA) token a.k.a. `coin` by default. ### Valid Examples From 303b997f2a0478d2d7d0fc256b43f49a8e6af8ae Mon Sep 17 00:00:00 2001 From: Tim Molter Date: Tue, 8 Nov 2022 10:29:46 +0100 Subject: [PATCH 3/3] updated params to camelCase --- kip-0016.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/kip-0016.md b/kip-0016.md index 414bb10..08ea3c7 100644 --- a/kip-0016.md +++ b/kip-0016.md @@ -32,8 +32,8 @@ Payment request URIs contain "kadena" in their schema (protocol, blockchain) par request = "kadena:" k-address [ "?" kadenaparams ] kadenaparams = [ amountparam / chainidparam / assetidparam ] amountparam = "amount=" {Number} - chainidparam = "chainid=" {Number} - assetidparam = "assetid=" {String} + chainidparam = "chainId=" {Number} + assetidparam = "assetId=" {String} * Here, {String} datatype corresponds to valid characters of an RFC 3986 URI query component, excluding the "=" and "&" characters, which this KIP takes as separators. @@ -48,11 +48,11 @@ The `amount` parameter defines how much KDA or token to send. Integer is not enf ### chainidparam -The `chainid` parameter defines which Kadena chain to send to. Valid integer values are 0 to 19. `chainid` is optional and not required, and if not included it is considered as undefined. There is no default value, i.e. `chainId` = 0. +The `chainId` parameter defines which Kadena chain to send to. Valid integer values are 0 to 19. `chainId` is optional and not required, and if not included it is considered as undefined. There is no default value, i.e. `chainId` = 0. ### assetidparam -The `assetid` parameter defines which Kadena asset (either main Kadena (KDA) or token) to send. `assetid` is optional and not required, and if not included it is considered the main Kadena (KDA) token a.k.a. `coin` by default. +The `assetId` parameter defines which Kadena asset (either main Kadena (KDA) or token) to send. `assetId` is optional and not required, and if not included it is considered the main Kadena (KDA) token a.k.a. `coin` by default. ### Valid Examples @@ -66,16 +66,16 @@ With Asset Id for main Kadena Coin: kadena:k:cf415c73edb4666a967933bddc2e6c4a6e13b8ec0566e612b9f3cbe4a4d8506e With Asset Id for main Kadena Coin with Additional Asset Id: - kadena:k:cf415c73edb4666a967933bddc2e6c4a6e13b8ec0566e612b9f3cbe4a4d8506e?assetid=coin + kadena:k:cf415c73edb4666a967933bddc2e6c4a6e13b8ec0566e612b9f3cbe4a4d8506e?assetId=coin With Chain Id: - kadena:k:cf415c73edb4666a967933bddc2e6c4a6e13b8ec0566e612b9f3cbe4a4d8506e?chainid=19 + kadena:k:cf415c73edb4666a967933bddc2e6c4a6e13b8ec0566e612b9f3cbe4a4d8506e?chainId=19 With Asset Id for Flux token: - kadena:k:cf415c73edb4666a967933bddc2e6c4a6e13b8ec0566e612b9f3cbe4a4d8506e?assetid=runonflux.flux + kadena:k:cf415c73edb4666a967933bddc2e6c4a6e13b8ec0566e612b9f3cbe4a4d8506e?assetId=runonflux.flux With All Parameters: - kadena:k:cf415c73edb4666a967933bddc2e6c4a6e13b8ec0566e612b9f3cbe4a4d8506e?amount=137&chainid=8&assetid=runonflux.flux + kadena:k:cf415c73edb4666a967933bddc2e6c4a6e13b8ec0566e612b9f3cbe4a4d8506e?amount=137&chainId=8&assetId=runonflux.flux ### Invalid Examples @@ -84,13 +84,13 @@ With Token Name as Schema: flux:k:cf415c73edb4666a967933bddc2e6c4a6e13b8ec0566e612b9f3cbe4a4d8506e With Chain Id as String: - kadena:k:cf415c73edb4666a967933bddc2e6c4a6e13b8ec0566e612b9f3cbe4a4d8506e?chainid=XXX + kadena:k:cf415c73edb4666a967933bddc2e6c4a6e13b8ec0566e612b9f3cbe4a4d8506e?chainId=XXX With Negative Amount: kadena:k:cf415c73edb4666a967933bddc2e6c4a6e13b8ec0566e612b9f3cbe4a4d8506e?amount=-42 With Null/Undefined Parameters: - kadena:k:cf415c73edb4666a967933bddc2e6c4a6e13b8ec0566e612b9f3cbe4a4d8506e?amount=null&chainid= + kadena:k:cf415c73edb4666a967933bddc2e6c4a6e13b8ec0566e612b9f3cbe4a4d8506e?amount=null&chainId= ## References