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

Create draft EIP-symbol #3014

Merged
merged 15 commits into from
Oct 3, 2020
61 changes: 61 additions & 0 deletions EIPS/eip-symbol.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
eip: <to be assigned>
PeterTheOne marked this conversation as resolved.
Show resolved Hide resolved
title: Create `eth_symbol` method for JSON-RPC
author: Peter Grassberger (@PeterTheOne)
discussions-to: https://github.com/ethereum/EIPs/issues/3012
PeterTheOne marked this conversation as resolved.
Show resolved Hide resolved
status: Draft
type: Standards Track
category : Interface
created: 2020-09-30
requires (*optional): <EIP number(s)>
PeterTheOne marked this conversation as resolved.
Show resolved Hide resolved
replaces (*optional): <EIP number(s)>
PeterTheOne marked this conversation as resolved.
Show resolved Hide resolved
---

## Simple Summary
Add `eth_symbol` method to the JSON-RPC that returns the symbol of the native coin of the network.

## Abstract
Wallets (Metamask, Mobile Wallets, Web Wallets, etc.) 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.
PeterTheOne marked this conversation as resolved.
Show resolved Hide resolved

## Motivation
<!-- The motivation is critical for EIPs that want to change the Ethereum protocol. It should clearly explain why the existing protocol specification is inadequate to address the problem that the EIP solves. EIP submissions without sufficient motivation may be rejected outright. -->
PeterTheOne marked this conversation as resolved.
Show resolved Hide resolved
User action is required when adding another to a wallet. 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
<!-- The technical specification should describe the syntax and semantics of any new feature. The specification should be detailed enough to allow competing, interoperable implementations for any of the current Ethereum platforms (go-ethereum, parity, cpp-ethereum, ethereumj, ethereumjs, and [others](https://github.com/ethereum/wiki/wiki/Clients)). -->
PeterTheOne marked this conversation as resolved.
Show resolved Hide resolved

Method: `eth_symbol`.

Params: none.

Returns: `result` - the native coin symbol, string

Example:

```
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_symbol","params":[],"id":1}'

// Result
{
"id": 1,
"jsonrpc": "2.0",
"result": "ETH"
}
```

## Rationale
<!-- The rationale fleshes out the specification by describing what motivated the design and why particular design decisions were made. It should describe alternate designs that were considered and related work, e.g. how the feature is supported in other languages. The rationale may also provide evidence of consensus within the community, and should discuss important objections or concerns raised during discussion. -->
PeterTheOne marked this conversation as resolved.
Show resolved Hide resolved
(Similar to https://eips.ethereum.org/EIPS/eip-695 and symbol from https://eips.ethereum.org/EIPS/eip-20)

todo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe mention why eth_symbol instead of eth_nativeCurrencySymbol?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I now mentioned it but I'm open for alternatives and more discussion.


## Implementation
<!-- The implementations must be completed before any EIP is given status "Final", but it need not be completed before the EIP is accepted. While there is merit to the approach of reaching consensus on the specification and rationale before writing code, the principle of "rough consensus and running code" is still useful when it comes to resolving many discussions of API details. -->
PeterTheOne marked this conversation as resolved.
Show resolved Hide resolved
None yet.

PeterTheOne marked this conversation as resolved.
Show resolved Hide resolved
## Security Considerations
<!-- All EIPs must contain a section that discusses the security implications/considerations relevant to the proposed change. Include information that might be important for security discussions, surfaces risks and can be used throughout the life cycle of the proposal. E.g. include security-relevant design decisions, concerns, important discussions, implementation-specific guidance and pitfalls, an outline of threats and risks and how they are being addressed. EIP submissions missing the "Security Considerations" section will be rejected. An EIP cannot proceed to status "Final" without a Security Considerations discussion deemed sufficient by the reviewers. -->
PeterTheOne marked this conversation as resolved.
Show resolved Hide resolved
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 beleaving he/she is dealing with another native coin.

## Copyright
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).