💎 Ethereum Improvement Proposal

ERC-7827: JSON Contract with Value Version Control

Standardized smart contract interface for on-chain JSON state output and key-value version control history. Authored by LexClinic (lex.clinic) & Kyle Smith (@Bestape).

Ethereum Standard Specification

ERC-7827 Technical Overview & Interface

Defining human-readable, RESTful Web3 smart contract state for legal engineering runtimes.

Standard Overview & Specification

ERC-7827 defines a standardized interface for smart contracts to maintain an on-chain JSON object with full historical version control for every key-value pair.

  • `json()`: Real-time on-chain JSON string output representing current contract state.
  • `version(key)`: Returns a chronologically ordered array of all historical values for a key.
  • `write(keys, values, replace)`: Atomic key-value write operations with overwrite protection.
Enables RESTful Web3 integration, human-readable auditability, and sublinear state tracking for computational contracts.
IERC7827.sol
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.0;

interface IERC7827 {
    /// @notice Returns the current state of the JSON object as a string
    function json() external view returns (string memory);

    /// @notice Returns chronologically ordered version history for a key
    function version(string calldata key) external view returns (string memory);

    /// @notice Writes new values to the on-chain JSON object
    function write(
        string[] calldata keys,
        string[] calldata values,
        bool replace
    ) external;
}