elliptic
elliptic copied to clipboard
Error: Unknown point format secp256k1
Error: Unknown point format
at ShortCurve.decodePoint
I'm getting this error after using the following code:
const ec = new EC('secp256k1');
const publicKey = ec.keyFromPublic("022e0ab4358780d72a4cac22ab75b257757663e5b204d96ccdce62f780536dac6a", 'hex');
Can somebody please help me as I need to generate a keypair based on that string to use:
return privateKeyPair.derive(publicKey.getPublic());
Can specify which version you use?
This code works fine with [email protected]
const EC = require('elliptic').ec
const ec = new EC('secp256k1');
const publicKey = ec.keyFromPublic("022e0ab4358780d72a4cac22ab75b257757663e5b204d96ccdce62f780536dac6a", 'hex');
You will get that error if you forget the 'hex' parameter when you use keyFromPublic.
@dsharhon look at my code, I clearly have that there
Can you show us the code that generates privateKeyPair?
I no longer use this. I opted in for a plain old js implementation of it.