Closed sarvalabs-harshrastogi closed 1 month ago
When signing a message using a randomly generated wallet with the ECDSA_SECP256K1 signing algorithm, verification fails. However, slicing the first two characters of the public key makes verification successful.
Below is the code how to reproduce it
import { Wallet } from 'js-moi-sdk'; const wallet = Wallet.createRandomSync(); const message = 'Hello World'; const buffmessage = Buffer.from(message, 'utf-8'); const signed = wallet.sign(buffmessage, wallet.signingAlgorithms.ecdsa_secp256k1);
But when i tried to verify the string it retuned be false
const isVerified = wallet.verify(buffmessage, signed, wallet.publicKey console.log(isVerified); // >> false
But if the slice of starting two characters of public key it works
const isVerified = wallet.verify(buffmessage, signed, wallet.publicKey.slice(2) console.log(isVerified); // >> true
closed in #83
When signing a message using a randomly generated wallet with the ECDSA_SECP256K1 signing algorithm, verification fails. However, slicing the first two characters of the public key makes verification successful.
Below is the code how to reproduce it
But when i tried to verify the string it retuned be false
But if the slice of starting two characters of public key it works