-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Proposal for AddToken URI standard #961
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8bcc0dd
Submit EIP for AddToken URI standard
smilingkylan cd02f3f
Merge branch 'master' of https://github.com/ethereum/EIPs into add-to…
smilingkylan 602e817
Update EIP based on PR comments
smilingkylan a5b5029
Inclusion of other required EIPs, explanation of STRING, make some pa…
smilingkylan 5ff44ab
Merge branch 'master' of https://github.com/ethereum/EIPs into add-to…
smilingkylan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
eip: 961 | ||
title: URL Format for Tokens | ||
status: Active | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be 'Draft'. |
||
type: Standards Track | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Standards track EIPs must also specify a category. |
||
author: Kylan Hurt <kylan@edgesecure.co>, Eliran Zach <eliran@edgesecure.co> | ||
created: 2018-04-01 | ||
requires: 20, 137, 831 | ||
--- | ||
|
||
## Simple Summary | ||
A standard way of representing token information, facilitating the process of adding ERC #20 tokens as URLs on the application layer. | ||
|
||
## Abstract | ||
URLs embedded in QR-codes, hyperlinks in web-pages, emails or chat messages provide for robust cross-application signaling between very loosely coupled applications. A standardized URL format for fundamental token information allows for instant invocation of the user's preferred wallet application (even if it is a webapp or a swarm đapp), with the correct parameterization of the token's information only to be confirmed by the user. | ||
|
||
## Motivation | ||
The convenience of representing payment requests by standard URLs has been a significant factor in the cryptocurrency. Extending this convenient mechanism to support embedding of basic token information would help to facilitate the usage of Ethereum-based tokens. In particular, QR-code embedded URLs could be generated by token-generators to help users track the tokens via any wallet software that has the ability to scan QR codes (particularly mobile wallets). For example, rather than users needing to find the contract address and number of decimal places for a given token through an online directory, they could simply scan a QR-code provided by the token generator with this data embedded. The wallet software could then automatically add the tokens to the user's wallet. This would improve the user experience associated with purchasing and holding tokens as a digital asset. | ||
|
||
|
||
## Specification | ||
|
||
### Syntax | ||
Token data URLs contain "ethereum" in their schema (protocol) part and are constructed as follows: | ||
|
||
request = "ethereum" ":" "token_info-" target_address "@" chain_id [ "?" parameters ] | ||
target_address = ethereum_address | ||
chain_id = 1*DIGIT | ||
ethereum_address = ( "0x" 40*40HEXDIG ) / ENS_NAME | ||
parameters = parameter *( "&" parameter ) | ||
parameter = key "=" value | ||
key = "symbol" / "decimals" / "name" / "type" | ||
value = STRING / number (0-18) / STRING / STRING | ||
|
||
Where all of the key + value pairs are optional, allowing for maximum flexibility on the application layer. | ||
|
||
|
||
### Semantics | ||
|
||
`target_address` is mandatory and denotes the contract address with which the user is asked to interact. | ||
|
||
`chain_id` is mandatory and contains the decimal chain ID, such that transactions on various test- and private networks can be requested. | ||
|
||
If using ENS names instead of hexadecimal addresses, the resolution is up to the payer, at any time between receiving the URL and sending the transaction. Hexadecimal addresses always take precedence over ENS names, i.e. even if there exists a matching ENS name consisting of 40 hexadecimal digits, it should never be resolved. Instead, the hexadecimal address should be used directly. | ||
|
||
1. `symbol` (optional) is the token symbol (STRING) - Defaults to "SYM" | ||
2. `decimals` (optional) is a whole number between 0 and 18 (inclusive) - Defaults to 18 | ||
3. `name` (optional) is a more user-friendly name (STRING) for the token, typically the name of the project that generated the tokens - Defaults to the value of symbol | ||
4. `type` (optional) is the type of token (STRING), e.g. "ERC20". - Defaults to "ERC20" | ||
|
||
Note: `STRING` is a URL-encoded unicode string of arbitrary length, where delimiters and the percentage symbol (`%`) are mandatorily hex-encoded with a `%` prefix. | ||
|
||
## Rationale | ||
The proposed format is chosen to resemble `ethereum:pay` URLs as closely as possible, as both users and application programmers are already familiar with that format. Individuals generating these URLs are free to add and remove arbitrary parameters as they see fit. | ||
|
||
## Compatibility and Versioning | ||
Future upgrades that are partially or fully incompatible with this proposal must use a prefix other than `token_info-` that is separated by a dash (`-`) character from whatever follows it, as specified by ERC #831. | ||
|
||
## Copyright | ||
|
||
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove indentation here.