Function generatePrivateKey

  • Securely generate a valid Secp256k1 private key.

    By default, this function uses crypto.getRandomValues to produce sufficiently-random key material, but another source of randomness may also be provided.

    To generate an HD Key, use generateHdPrivateKey.


    • secureRandom: (() => Uint8Array) = generateRandomSeed

      a method that returns a securely-random 32-byte Uint8Array

        • (): Uint8Array
        • Securely generate a 32-byte, cryptographically random seed (Uint8Array) for use in HD Key derivation (see deriveHdPrivateNodeFromSeed).

          To generate a single Secp256k1 private key, use generatePrivateKey.

          Returns Uint8Array

    Returns Uint8Array

Generated using TypeDoc