Files
nostr-tools/schnorr.js
2021-01-04 14:15:27 -03:00

11 lines
297 B
JavaScript

import BigInteger from 'bigi'
import ecurve from 'ecurve'
const curve = ecurve.getCurveByName('secp256k1')
const G = curve.G
export function pubkeyFromPrivate(privateHex) {
const privKey = BigInteger.fromHex(privateHex)
return G.multiply(privKey).getEncoded(true).slice(1).toString('hex')
}