initial commit.

This commit is contained in:
fiatjaf
2021-01-04 14:15:27 -03:00
commit b077271d46
7 changed files with 99 additions and 0 deletions

10
schnorr.js Normal file
View 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')
}