I am trying to sign a message using the following code:ethJsUtil.ecsign(ethJsUtil.sha256(msg),new Buffer('0x...'))
Where 0x... is my private key taken from MyEtherWallet. It gives the error in the title both with and without the 0x at the beginning
ethJsUtil.ecsign(ethJsUtil.sha256(msg),ethJsUtil.toBuffer('0x...'))
works.
new Buffer
was returning an empty buffer
Basically you pasted:
node ./keygen.js 0xdd0c9ec256a7e76a6693a0d2dea01a6de6b7dfeaf3afcaef7b95647758c79c1a
Instead of:
node ./keygen.js dd0c9ec256a7e76a6693a0d2dea01a6de6b7dfeaf3afcaef7b95647758c79c1a