EIPs Explained

ERC-7777 · Review · ERC · 2024-09-29

ERC-7777: Governance for Human Robot Societies

Defines two contract interfaces, IUniversalIdentity for robot identities backed by hardware keys and IUniversalCharter for rule-based communities of humans and robots, so they can register, agree to rules and be checked for compliance on-chain.

What problem does it solve?

The authors expect robots and other non-human agents to increasingly act and transact alongside people. Such machines have no passport, no birthplace that decides which laws apply to them, and no access to ordinary banking. The proposal argues that public blockchains are a neutral place to give them an identity and let humans and robots opt into shared rule sets.

ERC-7777 standardizes the contract interfaces for that: one for a robot's identity, and one for a "charter" (a community with a rule set) that humans and robots can join, follow and leave. A standard interface means tools can work with any charter or identity contract instead of each project inventing its own.

How it works

IUniversalIdentity (one contract per robot):

  • getHardwareIdentity() returns a HardwareIdentity struct: a hardware-bound public key, manufacturer, operator, model, serial number, and signatures of the initial and current system-state hashes (e.g. firmware).
  • generateChallenge() and verifyChallenge(challenge, signature) implement challenge-response: anyone can ask the robot to sign a fresh challenge with its secure-element key to prove it is the physical device it claims to be.
  • addRule(bytes) / removeRule(bytes) record which rules the robot agrees to follow; rules are plain text encoded as bytes, e.g. "A robot must keep a 1m distance from humans."
  • checkCompliance(bytes rule) reports whether the robot complies with a rule.

IUniversalCharter (one contract per community):

  • registerUser(UserType, bytes[] ruleSet) where UserType is Human or Robot. The contract MUST check compliance before registering.
  • leaveSystem(), callable only by the user, again after a compliance check.
  • checkCompliance(user, ruleSet), which SHOULD call each rule on the user's identity contract.
  • updateRuleSet(...) and terminateContract(), which SHOULD be restricted to authorized accounts.

Events (UserRegistered, UserLeft, RuleSetUpdated, RuleAdded, SubscribedToCharter, and others) make every change visible to off-chain systems.

Sample code

The charter interface (from the spec):

// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.20;

interface IUniversalCharter {
    enum UserType { Human, Robot }

    function registerUser(UserType userType, bytes[] memory ruleSet) external;
    function leaveSystem() external;
    function checkCompliance(address user, bytes[] memory ruleSet) external view returns (bool);
    function updateRuleSet(bytes[] memory newRuleSet) external;
    function terminateContract() external;

    event UserRegistered(address indexed user, UserType userType, bytes[] ruleSet);
    event UserLeft(address indexed user);
    event ComplianceChecked(address indexed user, bytes[] ruleSet);
    event RuleSetUpdated(bytes[] newRuleSet, address updatedBy);
}

A robot joining a charter. In the reference implementation the robot's identity contract is the registered address, so registration goes through it (updateCompliance and subscribeAndRegisterToCharter are reference-implementation helpers, not part of the interface):

import { Contract, toUtf8Bytes } from "ethers";

const rule = toUtf8Bytes("A robot must keep a 1m distance from humans.");
const identity = new Contract(IDENTITY, [
  "function addRule(bytes)",
  "function updateCompliance(bytes,bool)",
  "function subscribeAndRegisterToCharter(address,uint256)",
], ownerSigner);

await (await identity.addRule(rule)).wait();
await (await identity.updateCompliance(rule, true)).wait();
await (await identity.subscribeAndRegisterToCharter(CHARTER, 1n)).wait(); // rule set version 1

Things to know

  • Status: Review. The interfaces may still change before Final.
  • "Compliance" is only as meaningful as whoever sets it. In the reference implementation the identity contract's owner sets compliance status, so on-chain checks reflect the owner's attestation, not physical verification of behavior. Its hardware challenge check is also only a placeholder.
  • Rule management and ownership are security-critical: restrict addRule, removeRule, compliance updates and updateRuleSet, and protect upgradeable initializers against re-execution.
  • Large rule sets cost a lot of gas to pass and check; the spec suggests capping their size.
  • For a related approach to on-chain identity and reputation for autonomous agents, see ERC-8004.

#identity #robots #governance #interface

Details

Authors
OpenMind, Jan Liphardt <[email protected]>, Shaohong Zhong (@ShaohongZ), Boyuan Chen (@bchen-dev), Paige Xu <[email protected]>, James Ball <[email protected]>, Thamer Dridi <[email protected]>
Status
Review
Type
Standards Track / ERC
Created
2024-09-29

Machine-readable: Markdown · JSON