ERC-5139 RPC Provider List Standard (Remote Procedure Call Provider Lists)

Stagnant · Accounts & wallets · created 2022-06-06

Standardizes the list of RPC (Remote Procedure Call) providers that a wallet can connect to as JSON, letting users pick a trusted list and switch it easily.

Why it is needed

As Ethereum compatible chains and scaling solutions have multiplied, it has become common for users to add new RPC providers to their wallets via EIP-3085 with little verification. An RPC provider added this way can track requests or, in the worst case, show users false information or frontrun their transactions. But without a standardized format for RPC provider lists, each wallet has to manage its own set of trusted providers differently, and it is hard for users to move or verify this list across wallets. This standard reduces that risk by letting wallets ship a verified list by default while still letting users easily switch to a different list if they want.

In depth

Root lists and extension lists

Provider lists come in two forms: a "root list" with a top level providers key, and an "extension list" with extends and changes keys. A root list holds providers keyed by name inside a providers object, and each provider follows the Provider schema (name, logo, priority, chains). An extension list does not contain providers directly; instead it designates a parent list via extends and modifies the parent's providers using changes in RFC 6902 JSON Patch format. The two forms are mutually exclusive; a single list cannot have both providers and extends/changes at the same time.

Provider and ProviderChain fields

A Provider consists of a name (1 to 40 characters, a string matching a specified pattern), an optional logo (recommended as a 64x64 SVG/PNG URI), an optional priority (an integer), and a chains array. Each entry in the chains array is a ProviderChain with a chainId (an EIP-155 chain ID, an integer of 1 or greater) and endpoints (an array of URI strings, at least one, no duplicates). In other words, it is a two-tier structure where one provider can support multiple chains, and each chain can have multiple endpoints (for load balancing or redundancy).

Versioning rules (SemVer)

List versions follow Semantic Versioning 2.0.0. The major version MUST be bumped when a provider is removed, when a key in the providers object is changed, or when the last ProviderChain for any chainId is removed. If the major version has not changed, the minor version MUST be bumped when a provider is added or when the first ProviderChain for any chainId is added. If neither major nor minor has changed, any change MUST bump the patch version. This rule lets list subscribers infer the nature of a change just from the version number.

Publishing methods

Provider lists SHOULD be published on mainnet under an ENS (Ethereum Name Service) name using EIP-1577 contenthash. They MAY instead be published via HTTPS, in which case an Access-Control-Allow-Origin: * header MUST generally be set so that other origins can also access it.

The priority field and how it is applied

A priority of 0 denotes the highest priority, and higher values denote lower priority. Multiple providers can share the same priority. Providers without a priority are treated as having equal priority among themselves, but always lower priority than any provider that has one specified. A wallet consuming the list may use priority to determine connection order, but may also ignore it entirely, and SHOULD explain to users how its implementation interprets priority.

extends and changes in an extension list

The extends field specifies the parent list's location, either as uri or ens, along with a compatible version range via the version field. If mode is absent or '^', the compatible range is determined by the leftmost nonzero component of the specified version (for example, 1.2.3 is equivalent to >=1.2.3, <2.0.0); if mode is '=', compatibility requires an exact match with the parent's version. A list consumer MUST reject an extension list whose parent version is incompatible, and if it continues using a previously stored parent list, it MUST display a warning that the list is outdated. The changes field is an RFC 6902 JSON Patch document, and the JSON pointer paths within it are resolved relative to the parent list's providers field.

Algorithm for applying extension lists

If the current list is an extension list, a list consumer checks whether the parent (from) has not already been seen, fetches the parent list, validates its schema and version compatibility, then replaces the current list with the parent and repeats this process. Once a root list is reached, its contents are copied into a result variable; then, if there are children, each child's changes are applied to the result's providers and validated against the schema again while moving toward the child. Once there are no more children, the result's providers is returned as the final result. List consumers SHOULD limit the length of extension list chains to a reasonable level.

Proposal status

This proposal is currently Stagnant, meaning it is no longer being actively discussed or progressed. Since standardization has not been completed, the schema or detailed rules may change in the future, or it may not be adopted at all.

Things to watch out for

Original ERC · ← ERCs