mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-08 16:28:49 +00:00
10 lines
310 B
TypeScript
10 lines
310 B
TypeScript
import * as secp256k1 from '@noble/secp256k1'
|
|
|
|
export function generatePrivateKey(): string {
|
|
return secp256k1.utils.bytesToHex(secp256k1.utils.randomPrivateKey())
|
|
}
|
|
|
|
export function getPublicKey(privateKey: string): string {
|
|
return secp256k1.utils.bytesToHex(secp256k1.schnorr.getPublicKey(privateKey))
|
|
}
|