ERC-7777 Human-robot social governance (Governance for Human Robot Societies)

Review · Other · created 2024-09-29

A standard interface that lets robots hold on-chain identities via smart contracts, so humans and robots can agree on a defined rule set and together form and operate communities.

Why it is needed

Robots have no place or moment of birth, so they do not naturally fit into existing government systems where rules are automatically determined by birthplace. According to the source, robots cannot obtain standard identification such as a passport, it is unclear which rules apply to them, and they cannot use human-centric banking systems. Even if a robot is harmed, it is hard to know which court has jurisdiction. The source points out that traditional, region- and human-centric institutions can be inefficient, slow to change, and opaque. An open, immutable decentralized computer does not distinguish whether its computational substrate is a human brain or not, so it could serve as a more equitable governance framework. However, because the space of possible rule sets is infinite, a common interface is needed to reduce friction in forming, joining, maintaining, and dissolving such communities.

What to implement

In depth

A structure split across two interfaces

This standard defines two interfaces, IUniversalIdentity and IUniversalCharter. IUniversalIdentity lets robots obtain an on-chain identity to interact and transact with humans, and supports proof of a physical robot's identity through cryptographic signatures from secure hardware and a challenge-response mechanism. IUniversalCharter lets humans and robots create, join (register), maintain (update), leave, and terminate self-regulating communities based on a predefined rule set. Each robot is represented by a single smart contract, and it must follow the rules defined in that contract to interact with other participants on-chain.

Rule management in IUniversalIdentity

addRule(bytes memory rule) adds to the identity a rule the robot has agreed to follow. A rule is a string such as 'A robot must keep a 1m distance from humans.' encoded as a dynamic byte array, and it SHOULD be drawn from the rule set of the IUniversalCharter contract the robot intends to join. removeRule removes a rule the robot will no longer follow. checkCompliance(bytes memory rule) returns whether the robot complies with a specific rule, and implementation is required (MUST) for compliance verification. Rule additions and removals are logged via the RuleAdded and RuleRemoved events, making compliance status easy to track.

The HardwareIdentity struct and challenge-response authentication

The HardwareIdentity struct holds the fields publicKey (a hardware public key uniquely bound to this robot), manufacturer, operator, model, serialNumber, initialHashSignature (a root key signature over a hash of initial system state such as firmware or OS), and currentHashSignature (a signature over a periodically updated hash of the latest state). The public key is intended to be generated from the robot's secure element, providing proof that is difficult to tamper with or duplicate. Anyone can issue a challenge via generateChallenge and verify the value signed by the robot's hardware-protected private key using verifyChallenge, to physically confirm identity.

Registration, departure, and update rules in IUniversalCharter

registerUser(UserType userType, bytes[] memory ruleSet) MUST be implemented, and the implementing contract MUST call checkCompliance before registration to confirm the user complies with the rule set. UserType is an enum with the values Human and Robot, which is cheaper and less error-prone than a string and provides a basis for applying different logic per user type. leaveSystem MUST be callable only by the user themselves (msg.sender), and required rule compliance must be confirmed before leaving. checkCompliance(address user, bytes[] memory ruleSet) SHOULD call checkCompliance on the user's IUniversalIdentity contract for each rule. updateRuleSet and terminateContract SHOULD be restricted to authorized users, such as the contract owner.

Rule set version management in the reference implementation

The reference implementation UniversalCharter identifies rule sets by their keccak256(abi.encode(ruleSet)) hash and maps that to a version number. updateRuleSet rejects empty rule sets and duplicate registrations, increments currentVersion by 1, and stores it as the new version. registerUser looks up the registered version from the hash of the submitted rule set, and if the registrant is a robot, calls _checkRobotCompliance to invoke checkCompliance on the robot identity contract for every rule in that version. Humans are currently treated as compliant by default in the implementation. On the robot side, UniversalIdentity has subscribeAndRegisterToCharter, which fetches rules via the charter's getRuleSet(version) and registers immediately, and updateCompliance, which lets the owner update per-rule compliance status. Both contracts are built on OwnableUpgradeable, and the charter can halt operation based on the paused state in SystemConfig.

A proposal still under review

This proposal's status is Review. It is not yet a finalized standard, and its interface or details may change during review.

Things to watch out for

Original ERC · ← ERCs