Skip to main content
Version: 11.x

Function: getPublicKey()

getPublicKey(privKey, isCompressed?): Uint8Array<ArrayBufferLike> & Uint8Array<ArrayBuffer>

Defined in: node_modules/@scure/starknet/index.d.ts:49

Derives a Stark public key from a private key.

Parameters​

privKey​

TArg<Hex>

private key as bytes or hex

isCompressed?​

boolean

whether to return the compressed public key format

Returns​

Uint8Array<ArrayBufferLike> & Uint8Array<ArrayBuffer>

Encoded Stark public key bytes.

Example​

Derive the Stark public key from a private key.

getPublicKey('1');