randomPrivateKey

Generates a random ECDSA private key on the secp256k1 curve.

Example

import { Secp256k1 } from "ox";
const privateKey = Secp256k1.randomPrivateKey();
function randomPrivateKey(
options?: Options<as>,
): randomPrivateKey.ReturnType<as>;

Parameters

The options to generate the private key.

Type

let options: Options<as>;

Returns

let returnType: randomPrivateKey.ReturnType<as>;

The generated private key.