Skip to content

Secp256k1.getPublicKey

Computes the secp256k1 ECDSA public key from a provided private key.

Imports

Named
import { Secp256k1 } from 'ox'

Examples

import { Secp256k1 } from 'ox'
 
const publicKey = Secp256k1.getPublicKey({ privateKey: '0x...' })

Definition

function getPublicKey(
  options: getPublicKey.Options,
): PublicKey.PublicKey

Source: src/Secp256k1.ts

Parameters

options

  • Type: getPublicKey.Options

The options to compute the public key.

options.privateKey

  • Type: 0x${string} | Uint8Array

Private key to compute the public key from.

Return Type

The computed public key.

PublicKey.PublicKey