• Generates an Ed25519 public/private key pair for use with other methods in this package that accept CryptoKey objects.

    Parameters

    • Optionalextractable: boolean

      Setting this to true makes it possible to extract the bytes of the private key using the crypto.subtle.exportKey() API. Defaults to false, which prevents the bytes of the private key from being visible to JS.

    Returns Promise<CryptoKeyPair>

    import { generateKeyPair } from '@solana/keys';

    const { privateKey, publicKey } = await generateKeyPair();