-
Notifications
You must be signed in to change notification settings - Fork 5
Payments: JS validation
Diogo edited this page Nov 5, 2018
·
3 revisions
To validate the signature belongs to the signing address, we can use the method recover from web3.account.recover:
function checkSignatureMatch(signingAddress, transaction, signature) {
var expectedSigningAddress = web3.eth.accounts.recover(transaction, signature);
var isEqual = expectedSigningAddress === signingAddress;
return isEqual;
}