validate_lighter_pubkey

Documentation for eth_defi.lighter.pubkey.validate_lighter_pubkey function.

validate_lighter_pubkey(pubkey)

Validate a Lighter API-key public key client-side.

Mirrors the on-chain checks in ZkLighter.changePubKey so callers fail fast before submitting a transaction: the pubkey must be exactly PUB_KEY_BYTES_SIZE bytes, each 8-byte little-endian limb must be strictly below GOLDILOCKS_MODULUS, and it must not be all-zero.

Parameters

pubkey (bytes) – The API-key public key, as produced by the Lighter SDK.

Raises

ValueError – If the pubkey is malformed.

Return type

None