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

Provide blockchain info for wallets via RPC endpoint #3012

Closed
PeterTheOne opened this issue Sep 30, 2020 · 10 comments
Closed

Provide blockchain info for wallets via RPC endpoint #3012

PeterTheOne opened this issue Sep 30, 2020 · 10 comments
Labels

Comments

@PeterTheOne
Copy link
Contributor

PeterTheOne commented Sep 30, 2020

I'd like to get some feedback before submitting a draft:

Intro

Every wallet (Metamask, Mobile Wallets, Web Wallets, etc.) that deals with multiple networks need some basic information for every blockchain that it connects to. Metamask for example asks for: "Network Name", "New RPC URL", "ChainID (optional)", "Symbol (optional)", "Block Explorer URL (optional)".

Metamask screenshot

Most of the time there is a good default for these values, only in edge cases a user would want to customize them. There are lists for these values like https://github.com/ethereum-lists/chains where a user could manually look up the correct values. Often some networks are already pre configured by the wallet.

Proposal

There should be an RPC endpoint to fetch these values. Once the user enters the RPC url the values can be fetched from the RPC and the form fields can be filled automatically. Currently there only seems to be an endpoint to fetch the chainId.

The endpoint would provide these values when configured:

  • Network Name
  • ChainId
  • (NetworkId)
  • (Native Coin Name)
  • Native Coin Symbol
  • Blockchain Explorer URL (and explorer type? blockscout, etherscan, etc. to figure out the url structure...)
  • (Faucet URL)
@github-actions
Copy link

Since this is your first issue, we kindly remind you to check out EIP-1 for guidance.

@tjayrush
Copy link

The two URLs can clearly not be standardized with any value other than localhost.

@MicahZoltu
Copy link
Contributor

Since this would be a one-to-many relationship, there is little need for standardization. I recommend building the API you have proposed, documenting it with API docs, and then lobbying various wallets to use it. No EIP necessary. 😄

@MicahZoltu
Copy link
Contributor

Ah, maybe I misunderstood. Are you wanting a new JSON-RPC method on all clients that can be queried to get the other details, so the user would only need to put in a single JSON-RPC endpoint and then fetch the rest? If so, I recommend creating an EIP for each of the endpoints you would like to see added.

@PeterTheOne
Copy link
Contributor Author

Ah, maybe I misunderstood. Are you wanting a new JSON-RPC method on all clients that can be queried to get the other details, so the user would only need to put in a single JSON-RPC endpoint and then fetch the rest?

This is what I meant!

If so, I recommend creating an EIP for each of the endpoints you would like to see added.

Ok, so one endpoint for every value? If that is the recommended way, then I'll go with that.

@MicahZoltu
Copy link
Contributor

One endpoint per value seems like a more modular solution than a single monolithic endpoint. Different wallets may want to query for different sets of data, and while there are solutions like GraphQL for that, introducing GraphQL into Ethereum clients is a bigger project (though one that there is an EIP for).

If you are going to create multiple endpoints, then I recommend one EIP per endpoint.

Note: One vs many endpoints is my personal opinion, not that of an EIP Editor. One EIP per endpoint is my EIP Editor statement, as we really prefer EIPs to be very small/modular (and it increases the chance of adoption).

@BelfordZ
Copy link

@PeterTheOne good call on this one, and thanks for taking the time to write it up. Any chance you could write the method specification using OpenRPC "method" syntax? This way we can get this added to the JSON RPC standard method set, and regenerate sdk's so we can get to using these values in a sane way :)

@PeterTheOne
Copy link
Contributor Author

@BelfordZ Sure, please show me an example of an EIP with spec in OpenRPC syntax. The spec for eth_symbol would be very similiar to eth_chainId https://github.com/etclabscore/ethereum-json-rpc-specification/blob/255254545293e0a901bc85dda5c6bd282f98f9fc/openrpc.json#L148-L162 .

@github-actions
Copy link

There has been no activity on this issue for two months. It will be closed in a week if no further activity occurs. If you would like to move this EIP forward, please respond to any outstanding feedback or add a comment indicating that you have addressed all required feedback and are ready for a review.

@github-actions github-actions bot added the stale label Oct 24, 2021
@github-actions
Copy link

github-actions bot commented Nov 7, 2021

This issue was closed due to inactivity. If you are still pursuing it, feel free to reopen it and respond to any feedback or request a review in a comment.

@github-actions github-actions bot closed this as completed Nov 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants