* Include LICENCE in the Jekyll build * Replace old licence link with new and improved licence link * Add note to EIP-1 mandating the new link * Maybe this fixes it? * Rename LICENCE so that jekyll picks it up * Add original LICENCE file back * Delete the markdown file * Add Jekyll header Hopefully the tooling still detects it as CC0 * Remove Jekyll header * Maybe this will trick Jekyll and satisfy github? * Remove config changes * Enable incremental build * Will it work if I rename it? * I'll just paste the content of the licence into the file... * Perhaps this will work * Replace the licence file * Fix false positive Co-authored-by: Micah Zoltu <micah@zoltu.net> * Resolve feedback * Perhaps this might work * It didn't work This reverts commit 55116e15168fb20ae57dea97388bb260c0941465. * Will licencee still detect this correctly? * Jekyll Preamble in licence file * Include it? * Licence -> License, get rid of CC0.md * Force wording of copyright waiver * Formatting consistent with the rest of the list * Spelling * Escape * Task failed successfully * Fix two more links * Will this render it? * Perhaps this will work too * .md essential * Fix the issues Micah noted Co-authored-by: Micah Zoltu <micah@zoltu.net>
3.0 KiB
eip | title | author | discussions-to | type | category | status | created | requires |
---|---|---|---|---|---|---|---|---|
695 | Create `eth_chainId` method for JSON-RPC | Isaac Ardis <isaac.ardis@gmail.com>, Wei Tang (@sorpaas), Fan Torchz (@tcz001), Erik Marks (@rekmarks) | https://ethereum-magicians.org/t/eip-695-create-eth-chainid-method-for-json-rpc/1845 | Standards Track | Interface | Final | 2017-08-21 | 155 |
Simple Summary
Include eth_chainId
method in eth_
-namespaced JSON-RPC methods.
Abstract
The eth_chainId
method should return a single STRING result
for an integer value in hexadecimal format, describing the
currently configured CHAIN_ID
value used for signing replay-protected transactions,
introduced by EIP-155.
Motivation
Currently although we can use net_version
RPC call to get the
current network ID, there's no RPC for querying the chain ID. This
makes it impossible to determine the current actual blockchain using
the RPC.
Specification
eth_chainId
Returns the currently configured chain ID, a value used in replay-protected transaction signing as introduced by EIP-155.
The chain ID returned should always correspond to the information in the current known head block. This ensures that caller of this RPC method can always use the retrieved information to sign transactions built on top of the head.
If the current known head block does not specify a chain ID, the client should treat any
calls to eth_chainId
as though the method were not supported, and return a suitable
error.
Parameters
None.
Returns
QUANTITY
- integer of the current chain ID.
Example
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":83}'
// Result
{
"id": 83,
"jsonrpc": "2.0",
"result": "0x3d" // 61
}
Rationale
An ETH/ETC client can accidentally connect to an ETC/ETH RPC endpoint without knowing it unless it tries to sign a transaction or it fetch a transaction that is known to have signed with a chain ID. This has since caused trouble for application developers, such as MetaMask, to add multi-chain support.
Backwards Compatibility
Not relevant.
Security Considerations
Consumers should prefer eth_chainId
over net_version
, so that they can reliably identify chain they are communicating with.
Implementers should take care to implement eth_chainId
correctly and promote its use, since the chain ID is critical in replay attack prevention as described in EIP-155, and consumers will rely on it to identify the chain they are communicating with.
Implementation
Reference
Return value QUANTITY
adheres to standard JSON RPC hex value encoding, as documented in the Ethereum Wiki.
Copyright
Copyright and related rights waived via CC0.