import { secp256k1 } from '@noble/curves/secp256k1' import { toHex } from '../encoding/toHex.js' import type { ErrorType } from '../errors/utils.js' import type { Hex } from '../types/data.js' export type PrivateKeyToPublicKeyErrorType = ErrorType export function privateKeyToPublicKey(privateKey: Hex): Hex { return toHex(secp256k1.getPublicKey(privateKey.slice(2), false)) }