EIP-1271 support in OperatorRegistry

Senthil Bala
Witness Chain
Published in
2 min readJun 25, 2024

Status of the implementation: On Testnet

WitnessChain’s OperatorRegistry has standardized on EIP-1271 to enable both External Operator Accounts (EOA) and Smart Contract Wallets (SCW) to register seamlessly.

EIP-1271 is an Ethereum Improvement Proposal that defines a standard for verifying signatures from smart contracts, ensuring compatibility and security across different types of addresses.

By adopting this standard, the OperatorRegistry allows EOAs to register directly using their private key signatures, while SCWs can utilize their smart contract logic to validate signatures. This approach ensures that both types of accounts can participate in the registration process, promoting inclusivity and interoperability within the blockchain ecosystem.

This standardization also enhances the robustness of the registration process by providing a consistent and secure method for verifying signatures, regardless of whether they originate from an EOA or an SCW.

The below image depicts a sequence diagram outlining two methods for Operator Registration on the WitnessChain AVS.

Method 1: Registration Via EoA Wallet

calculateOperatorRegistrationDigestHash

  • The OperatorEoA (External Operator Account) initiates the process by calling the function calculateOperatorRegistrationDigestHash.
  • This function takes three parameters: [OperatorEoAAddress, OperatorEoAAddress (itself), expiry].

Return digestHash

  • The function returns a digestHash, which is a unique hash generated based on the input parameters.

OperatorRegistry.registerWatchtowerAsOperator

  • The OperatorEoA then calls the registerWatchtowerAsOperator function on the OperatorRegistry contract.
  • This function call includes four parameters: [OperatorEoAAddress, expiry, and the signature(digestHash)] (the digest hash signed by the OperatorEoA).

Completion

  • The OperatorRegistry contract processes the registration, effectively registering the OperatorEoA as an operator.

Method 2: Registration Via SmartContract

calculateOperatorRegistrationDigestHash

  • The OperatorEoAWallet initiates the registration by calling the calculateOperatorRegistrationDigestHash function.
  • This function takes three parameters: [OperatorEoAAddress, OperatorSmartContractAddress, and an expiry].

Return digestHash

  • The function returns a digestHash, which is generated based on the input parameters.

registerToWitnessChain (This can be different based on the operator’s smart contract function signature)

  • The OperatorEoAWallet then calls the registerToWitnessChain function on the OperatorSmartContract, passing in three parameters: OperatorEoAAddress, expiry, and the signature(digestHash) (the digest hash signed by the OperatorEoAWallet).

OperatorRegistry.registerWatchtowerAsOperator

  • Internally, the registerToWitnessChain function of the OperatorSmartContract calls the registerWatchtowerAsOperator function on the OperatorRegistry contract.
  • The parameters passed are: [OperatorEoAAddress, expiry, and signature(digestHash)].

Completion

  • The OperatorRegistry contract processes the registration, registering the OperatorSmartContract as an operator

Operators can use one of the above 2 approaches to register themselves on the WitnessChain’s OperatorRegistry Contracts.

Status of the implementation: On Testnet

--

--