Asimov Governance
Blockchain-based Governance for Robots
In OM1, we leverage a blockchain-based system for regulating robot bahaviors. This is done via storing rule sets for desired robot behaviors on smart contracts following ERC-7777 contract standards, and inserting those rules to the prompts of our models. Such a system affords immutability and transparency to the rules that robots need to follow, and help ensure that the robots observe safe and human-friendly behaivors.
For a full explanation of the smart contract implementation, check https://eips.ethereum.org/EIPS/eip-7777
For an in-depth look into the workings of the blockchain regulated system, check https://openmind.org/research.html
The implementation details for the current governance rules based on Asimov’s Laws.
Overview
The GovernanceEthereum
class retrieves governance rules from the Ethereum blockchain. It interacts with the blockchain via JSON-RPC calls and decodes the governance rules from contract responses.
Features
- Queries Ethereum blockchain for governance rules using JSON-RPC.
- Retrieves governance rule sets using Ethereum smart contract calls.
- Decodes ABI-encoded blockchain responses.
- Implements Asimov’s Laws:
Functions
Note: Etherscan.io does not handle bytes[]/json well. Hence we use the following functions to load and decode rules from blockchain.
Method: load_rules_from_blockchain()
Description
- Queries the Ethereum blockchain using JSON-RPC to fetch governance rules.
- Calls the ERC-7777 smart contract function
getRuleSet()
. - Decodes and returns the governance rule set.
Process
- Constructs a JSON-RPC request to call
getRuleSet()
. - Sends a
POST
request to the blockchain RPC endpoint. - Parses the response and extracts the rule set.
Returns
str
: Decoded governance rules if successful.None
: If the request fails.
Method: decode_eth_response()
Description
- Decodes the ABI-encoded response from Ethereum smart contract calls.
Parameters
Parameter | Type | Description |
---|---|---|
hex_response | str | Raw hex response from blockchain. |
Process
- Converts hex to bytes.
- Extracts string length from ABI-encoded data.
- Decodes UTF-8 string from ABI format.
- Cleans non-printable characters.
Returns
str
: Decoded governance rule set.None
: If decoding fails.
Ethereum Contract Details
RULES are stored on the ETHEREUM HOLESKY testnet and can be inspected directly at
Smart Contract Functions Used
Function | Selector | Description |
---|---|---|
getRuleSet() | 0x1db3d5ff | Retrieves the active rule set. |
getLatestRuleSetVersion() | 0x254e2f1e | Retrieves the latest rule set version (currently 2 ). |