Skip to content
Lattice

IAccountSigner

Git Source

Title: IAccountSigner

Author: David Dada <daveproxy80@gmail.com> (https://github.com/dadadave80)

Admin/read surface of the AccountSigner facet — the account's single-owner signer that backs both ERC-4337 validateUserOp and ERC-1271 isValidSignature. ECDSA is the default/legacy scheme; a P256 (secp256r1) raw key, a WebAuthn passkey, or a native Hedera account may be set as the owner instead.

For ECDSA the owner may be an EOA or an ERC-1271 contract (validation routes through the repo's SignatureChecker). owner() is authoritative when signerType() is ECDSA or HederaAccount — both store an address; the passkey schemes store a key pair instead.

Functions

owner

The ECDSA owner. Authoritative only when signerType() == ECDSA.

function owner() external view returns (address);

Returns

NameTypeDescription
<none>address

signerType

The active signature scheme.

function signerType() external view returns (SignerType);

Returns

NameTypeDescription
<none>SignerType

p256PublicKey

The P256/WebAuthn public key coordinates (zero unless a passkey owner is set).

function p256PublicKey() external view returns (bytes32 x, bytes32 y);

Returns

NameTypeDescription
xbytes32
ybytes32

requireUserVerification

Whether WebAuthn assertions must carry the User-Verified flag.

function requireUserVerification() external view returns (bool);

Returns

NameTypeDescription
<none>bool

setOwner

Sets an ECDSA owner (EOA or ERC-1271). Resets the scheme to ECDSA. Admin only.

function setOwner(address newOwner) external;

Parameters

NameTypeDescription
newOwneraddress

setP256Signer

Sets a raw P256 (secp256r1) public key as the owner. Admin only.

function setP256Signer(bytes32 x, bytes32 y) external;

Parameters

NameTypeDescription
xbytes32
ybytes32

setWebAuthnSigner

Sets a WebAuthn passkey (P256 key + UV policy) as the owner. Admin only.

function setWebAuthnSigner(bytes32 x, bytes32 y, bool requireUserVerification) external;

Parameters

NameTypeDescription
xbytes32
ybytes32
requireUserVerificationbool

setHederaAccountSigner

Sets a native Hedera account (ED25519 or ECDSA key) as the owner: signatures are verified by the Hedera Account Service system contract (HIP-632), so no key material is stored. Admin only.

Reverts HederaAccountServiceUnavailable on a chain where HAS does not answer. That guard is load-bearing, not defensive: a Lattice account is its OWN DEFAULT_ADMIN_ROLE holder (AccountInit seeds address(this)), so every admin call — including setOwner, the only way back to ECDSA — has to pass the signer that this call replaces. Arming a Hedera signer where HAS is dead would make every signature false and leave no authority able to undo it: the account, its owner change and its diamondCut upgrade path would all be permanently stranded.

function setHederaAccountSigner(address account) external;

Parameters

NameTypeDescription
accountaddressThe Hedera account's EVM alias or long-zero 0x000…&lt;accountNum> address.

Events

OwnerSet

Emitted when the ECDSA signing owner changes (also re-arms the ECDSA scheme).

event OwnerSet(address indexed previousOwner, address indexed newOwner);

Parameters

NameTypeDescription
previousOwneraddress
newOwneraddress

P256SignerSet

Emitted when a raw P256 (secp256r1) public key is set as the owner.

event P256SignerSet(bytes32 x, bytes32 y);

Parameters

NameTypeDescription
xbytes32
ybytes32

WebAuthnSignerSet

Emitted when a WebAuthn passkey (P256 public key + UV policy) is set as the owner.

event WebAuthnSignerSet(bytes32 x, bytes32 y, bool requireUserVerification);

Parameters

NameTypeDescription
xbytes32
ybytes32
requireUserVerificationbool

HederaAccountSignerSet

Emitted when a native Hedera account is set as the owner.

event HederaAccountSignerSet(address indexed account);

Parameters

NameTypeDescription
accountaddress

Errors

InvalidOwner

The new owner is the zero address.

error InvalidOwner();

InvalidP256Key

The P256 public key is (0, 0).

error InvalidP256Key();

HederaAccountServiceUnavailable

The Hedera Account Service system contract is not live on this chain, so a Hedera signer could never verify anything and arming one would strand the account.

error HederaAccountServiceUnavailable();

Enums

SignerType

The signature scheme backing the account owner. ECDSA (0) is the default on every account.

APPEND-ONLY. The active scheme is persisted as a uint8, so a new scheme MUST be appended as the LAST value: reordering or inserting one would silently retype every live account's stored scheme.

enum SignerType {
        ECDSA,
        P256,
        WebAuthn,
        HederaAccount
    }

Variants

NameDescription
ECDSA
P256
WebAuthn
HederaAccount