Skip to content
Lattice

AccountSigner

Git Source

Inherits: IAccountSigner

Title: AccountSigner

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

Single-owner signer facet. The configured owner's signatures authorize ERC-4337 validateUserOp (see ERC4337Validation) and ERC-1271 isValidSignature (see ERC1271Signature). ECDSA is the default scheme; a P256 (secp256r1) raw key, a WebAuthn passkey, or a native Hedera account can be set as the owner instead.

Stateless delegator — logic/storage live in AccountSignerLib. The ECDSA owner may be an EOA or an ERC-1271 contract; passkey verification uses the vendored audited Solady P256/WebAuthn libs.

Note:

  • lattice-version: 0.2.0

Functions

owner

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

function owner() external view virtual returns (address);

Returns

NameTypeDescription
<none>address

signerType

The active signature scheme.

function signerType() external view virtual returns (SignerType);

Returns

NameTypeDescription
<none>SignerType

p256PublicKey

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

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

Returns

NameTypeDescription
xbytes32
ybytes32

requireUserVerification

Whether WebAuthn assertions must carry the User-Verified flag.

function requireUserVerification() external view virtual 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 virtual;

Parameters

NameTypeDescription
newOwneraddress

setP256Signer

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

function setP256Signer(bytes32 x, bytes32 y) external virtual;

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 virtual;

Parameters

NameTypeDescription
xbytes32
ybytes32
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 virtual;

Parameters

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

exportSelectors

ERC-8153 selector export: this facet's cuttable selectors, tightly packed (4 bytes each).

Excludes exportSelectors() itself (0x0ef22643) - it is never cut into a diamond. Order matches forge inspect AccountSigner methodIdentifiers (alphabetical by signature); kept in exact parity by ExportSelectorsParityTest. Chunks: owner() 0x8da5cb5b p256PublicKey() 0x29ede33c requireUserVerification() 0x90d1a7de setHederaAccountSigner(address) 0x9c012f57 setOwner(address) 0x13af4035 setP256Signer(bytes32,bytes32) 0x0987050a setWebAuthnSigner(bytes32,bytes32,bool) 0x2c87b6e5 signerType() 0x37d694aa

function exportSelectors() external pure virtual returns (bytes memory selectors);

Returns

NameTypeDescription
selectorsbytes