-
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
Create draft EIP-symbol #3014
Merged
Merged
Create draft EIP-symbol #3014
Changes from 14 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
3bd98bb
Create draft EIP-symbol
PeterTheOne dc6bace
eip-symbol fix created date
PeterTheOne a0bbde3
eip-symbol: add reference to eip-20
PeterTheOne 8dca9cb
eip-symbol remove implementation section
PeterTheOne 344ccb6
eip-symbol: remove "requires"
PeterTheOne affa4bf
eip-symbol: remove "replaces"
PeterTheOne edd66e3
eip-symbol: several improvements
PeterTheOne db075a1
eip-symbol set eip number
PeterTheOne 2cbe342
Rename eip-symbol.md to eip-3014.md
PeterTheOne 644ea60
eip-3014: set example code formatting to js
PeterTheOne 3e0f817
eip-3014: remove white space
PeterTheOne 53fef9a
eip-3014: fix typo
PeterTheOne cf6e2fa
eip-3014: remove different kinds of wallets
PeterTheOne 34fa660
eip-3014: fix eip references
PeterTheOne 3231064
eip-3014: fix links to other EIPs
PeterTheOne 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,48 @@ | ||
--- | ||
eip: 3014 | ||
title: Create `eth_symbol` method for JSON-RPC | ||
author: Peter Grassberger (@PeterTheOne) | ||
discussions-to: https://github.com/ethereum/EIPs/issues/3012 | ||
status: Draft | ||
type: Standards Track | ||
category: Interface | ||
created: 2020-09-30 | ||
--- | ||
|
||
## Simple Summary | ||
Add `eth_symbol` method to the JSON-RPC that returns the symbol of the native coin of the network. | ||
|
||
## Abstract | ||
The new method `eth_symbol` (`eth_`-namespaced) has no parameters and returns a string of the native coin of the network. For the Ethereum mainnet this will be `ETH`, other networks will have other symbols. | ||
|
||
## Motivation | ||
Wallets that deal with multiple networks need some basic information for every blockchain that they connect to. One of those things is the symbol of the native coin of the network. Instead of requiring the user to research and manually add the symbol it could be provided to the wallet via this proposed JSON-RPC endpoint and used automatically. There are lists of networks with symbols like https://github.com/ethereum-lists/chains where a user can manually look up the correct values. But this information could easily come from the network itself. | ||
|
||
## Specification | ||
Method: `eth_symbol`. | ||
|
||
Params: none. | ||
|
||
Returns: `result` - the native coin symbol, string | ||
|
||
Example: | ||
|
||
```js | ||
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_symbol","params":[],"id":1}' | ||
|
||
// Result | ||
{ | ||
"id": 1, | ||
"jsonrpc": "2.0", | ||
"result": "ETH" | ||
} | ||
``` | ||
|
||
## Rationale | ||
This endpoint is similar to [EIP-695](./eip-695) but it provides the symbol instead of `chainId`. It provides functionality that is already there for [ERC-20](./eip-20) tokens, but not yet for the native coin of the network. Alternative naming of `eth_nativeCurrencySymbol` was considered, but the context and the fact that it just returns one value makes it clear that that it returns the symbol for the native coin of the network. | ||
PeterTheOne marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Security Considerations | ||
It is a read only endpoint. The information is only as trusted as the JSON-RPC node itself, it could supply wrong information and thereby trick the user in believing he/she is dealing with another native coin. | ||
|
||
## 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.
Consider tightening up the title to be a bit more terse.
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.
good point #3018