---
eip: 7777
label: ERC-7777
title: Governance for Human Robot Societies
status: Review
type: Standards Track
category: ERC
created: 2024-09-29
official: https://eips.ethereum.org/EIPS/eip-7777
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7777.md
canonical: https://eips.huatuo.xyz/eip-7777/
lang: en
tldr: 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.
tags: [identity, robots, governance, interface]
---

# ERC-7777: Governance for Human Robot Societies

> Defines interfaces for managing the identities of humans and robots, and establishing rule sets for their interaction.

**TL;DR:** 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):

```solidity
// 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):

```ts
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](/eip-8004/).


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-7777
