Which JavaScript library should I use to sign a transaction hash? I don’t want to sign a transaction object. I simply want to sign the hash so I'll have a signature, not a signed transaction object.


After a little deeper research I've found how this is done using the secp256k1 library in the ethereumjs-util code:

const sig = secp256k1.sign(msgHash, privateKey)

Where msgHash is a Buffer containing the transaction hash. sig.signature is the signature hex code.

Code found here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.