IAccountSigner
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
| Name | Type | Description |
|---|---|---|
| <none> | address |
signerType
The active signature scheme.
function signerType() external view returns (SignerType);Returns
| Name | Type | Description |
|---|---|---|
| <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
| Name | Type | Description |
|---|---|---|
| x | bytes32 | |
| y | bytes32 |
requireUserVerification
Whether WebAuthn assertions must carry the User-Verified flag.
function requireUserVerification() external view returns (bool);Returns
| Name | Type | Description |
|---|---|---|
| <none> | bool |
setOwner
Sets an ECDSA owner (EOA or ERC-1271). Resets the scheme to ECDSA. Admin only.
function setOwner(address newOwner) external;Parameters
| Name | Type | Description |
|---|---|---|
| newOwner | address |
setP256Signer
Sets a raw P256 (secp256r1) public key as the owner. Admin only.
function setP256Signer(bytes32 x, bytes32 y) external;Parameters
| Name | Type | Description |
|---|---|---|
| x | bytes32 | |
| y | bytes32 |
setWebAuthnSigner
Sets a WebAuthn passkey (P256 key + UV policy) as the owner. Admin only.
function setWebAuthnSigner(bytes32 x, bytes32 y, bool requireUserVerification) external;Parameters
| Name | Type | Description |
|---|---|---|
| x | bytes32 | |
| y | bytes32 | |
| requireUserVerification | bool |
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
| Name | Type | Description |
|---|---|---|
| account | address | The Hedera account's EVM alias or long-zero 0x000…<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
| Name | Type | Description |
|---|---|---|
| previousOwner | address | |
| newOwner | address |
P256SignerSet
Emitted when a raw P256 (secp256r1) public key is set as the owner.
event P256SignerSet(bytes32 x, bytes32 y);Parameters
| Name | Type | Description |
|---|---|---|
| x | bytes32 | |
| y | bytes32 |
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
| Name | Type | Description |
|---|---|---|
| x | bytes32 | |
| y | bytes32 | |
| requireUserVerification | bool |
HederaAccountSignerSet
Emitted when a native Hedera account is set as the owner.
event HederaAccountSignerSet(address indexed account);Parameters
| Name | Type | Description |
|---|---|---|
| account | address |
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
| Name | Description |
|---|---|
| ECDSA | |
| P256 | |
| WebAuthn | |
| HederaAccount |