Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KIP-0016: URI Scheme #30

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions kip-0016.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
KIP: 0016
Title: URI Scheme
Author: Tim Molter [email protected]
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} 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 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). `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. `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.

### 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: <https://github.com/ethereum/EIPs/blob/master/EIPS/eip-681.md>
* BIP-21: <https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki>