ERC-8119: Key Parameters - Standard Format for Parameterized String Keys

This ERC proposes a standard format for parameterized string keys used in EVM key-value storage. It defines a simple convention using a colon and space separator (`: `) to represent variations or instances of metadata types, enabling better interoperability across different implementations.

PR: https://github.com/ethereum/ERCs/pull/1455/

Many EVM-based smart contracts use key-value storage (e.g., Solidity mappings, Vyper hash maps) to store metadata where string keys may need to represent multiple instances or variations of the same metadata type. Without a standardized format, different implementations use inconsistent formats like `“registration-1”`, `“registration:1”`, or `“registration1”`, leading to:

- Interoperability issues between contracts and tooling

- Parsing difficulties for clients and indexers

- Fragmentation in the ecosystem

This standard enables consistent parameterized keys that are both human-readable and easy to parse programmatically. Standards such as ERC-8048 (Onchain Metadata for Token Registries) and ERC-8049 (Contract-Level Onchain Metadata) can leverage this ERC to support parameterized metadata keys.

When string keys include parameters, they **MUST** use a colon and space separator (`: `).

Valid formats:

- `“registration: 1”`

- `“registration: 2”`

- `“user: alice”`

- `“key: value:with:colons”` (colons allowed in parameter, but not `: `)

**Invalid formats:**

- `“registration-1”` (hyphen separator)

- `“registration:1”` (colon without space)

- `“registration1”` (no separator)

The colon and space separator (`: `) was chosen because:

- It improves human readability compared to formats like `key:value` or `key-value`

- It provides a clear, unambiguous separator that is easy to parse programmatically

- It maintains compatibility with existing parsers that support this format

This format was inspired by TOON format (developed by Johann Schopplich), and we acknowledge this preceding work.

1 Like