Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
@ambire/signature-validator
Advanced tools
Readme
As signatures can be daunting at times, this is a library aiming to implement universal signature verification, supporting:
eth_sign
)eth_signTypedData_v*
)isValidSignature
)Simple eth_sign
verification
import ethers from 'ethers';
import { verifyMessage } from '@ambire/signature-validator';
const provider = new ethers.providers.JsonRpcProvider('https://polygon-rpc.com')
async function run() {
// Replace `ethers.verifyMessage(message, signature) === signer` with this:
const isValidSig = await verifyMessage({
signer: '0xaC39b311DCEb2A4b2f5d8461c1cdaF756F4F7Ae9',
message: 'My funds are SAFU with Ambire Wallet',
signature: '0x9863d84f3119ac01d9e3bf9294e6c0c3572a07780fc7c49e8dc913806f4b1dbd4cc075462dc84422a9b981b2556f9c9197d76da7ba3603e53e9300869c574d821c',
// this is needed so that smart contract signatures can be verified
provider,
})
console.log('is the sig valid: ', isValidSig)
}
run().catch(e => console.error(e))
For more examples, you can check the /tests folder
To test signatures in an easier manner, you can use the signature-validator UI here: https://sigtool.ambire.com/
A formal audit is on the roadmap.
Currently though, you can self-audit the library quite easily as it's only ~80 lines of code (index.js).
npm i --development
npm test
FAQs
Signature validation library aiming to verify all different signature types for Ethereum and other EVM chains, including smart contract signatures (EIP 1271) and typed data (EIP 712)
The npm package @ambire/signature-validator receives a total of 2,831 weekly downloads. As such, @ambire/signature-validator popularity was classified as popular.
We found that @ambire/signature-validator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.