mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-17 04:18:50 +00:00
initial commit.
This commit is contained in:
10
schnorr.js
Normal file
10
schnorr.js
Normal file
@@ -0,0 +1,10 @@
|
||||
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')
|
||||
}
|
||||
Reference in New Issue
Block a user