randomPrivateKey
Last updated
Was this helpful?
Generates a random compressed private key.
import { randomPrivateKey } from '@stacks/transactions';
const privateKey = randomPrivateKey();
// e.g. 'f5a31c1268a1e37d4edaa05c7d11183c5fbfdcdc48aae36ea4d8cd5cb709932801'The returned key is always in compressed format (ends with 01, 66 hex characters).
Uses cryptographically secure random bytes from @noble/secp256k1.
function randomPrivateKey(): string;string
A random compressed private key as a hex string.
Last updated
Was this helpful?
Was this helpful?