Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

190
Views
Error de firma no válida de ethers al intentar verificar una firma

Estoy trabajando en un dapp que necesita verificar las firmas de los usuarios. Al probar con Metamask, todo está bien.

When trying to verify a signature from Ambire wallet, I get "Error: invalid signature string" from ethers.utils.verifyMessage For example, here's the signature I got from Ambire: 0xf1b5f561c1914d513f4020edd397f729836e26eeae8f1b9e4070d134492aa38b0a84b9d7cefe06f180ade91595fd74c4e845c2b8c2d053fa57785fdf5ec5dca31c01

Cuando trato de verificarlo esto sucede

 require('ethers').utils.verifyMessage('test', '0xf1b5f561c1914d513f4020edd397f729836e26eeae8f1b9e4070d134492aa38b0a84b9d7cefe06f180ade91595fd74c4e845c2b8c2d053fa57785fdf5ec5dca31c01') Uncaught: Error: invalid signature string (argument="signature", value="0xf1b5f561c1914d513f4020edd397f729836e26eeae8f1b9e4070d134492aa38b0a84b9d7cefe06f180ade91595fd74c4e845c2b8c2d053fa57785fdf5ec5dca31c01", code=INVALID_ARGUMENT, version=bytes/5.6.1)

¿Alguna idea de si esto se puede solucionar?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Para admitir billeteras inteligentes como Ambire, Gnosis Safe, Argent y otras, debe implementar EIP 1271 .

Verificación de firma universal de Ambire, compatible con:

  • Verificación de mensajes estándar (eth_sign)
  • 712 Verificación de datos escritos (eth_signTypedData_v*)
  • 1271 Verificación en cadena de contrato inteligente (isValidSignature) Una verificación fuera de cadena de firma de contrato inteligente opcional (por ejemplo, si la billetera inteligente es hipotética y aún no se ha implementado)

Verificación simple de eth_sign usando @ambire/signature-validator

 const ethers = require('ethers') const { verifyMessage } = require('@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))
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!