Verifying signature for Smart Account #583
Unanswered
GavinStein1
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a server side function that accepts a challenge and a signed challenge which it expects to be signed by a particular smart account. The function knows the address of the smart account (this is the address that is returned by the Smart Account client function getAccountAddress()).
To implement this functionality, I generate a challenge, and then get the user to sign this challenge. They do this with the following code in the frontend.
(Note: smartAccount is type BiconomySmartAccountV2)
The challenge and signed challenge is then sent to the server. The server receives these parameters and hashes the challenge.
const challengeHash = ethers.hashMessage(challenge);
I then create an ethers.Contract object with the smartContract address, the ABI for a Biconomy smart account (from here), and an RPC url provider. On that contract object I call isValidSignature().
I thought this would work. It is how I've seen other people implement signature verification. Unfortunately I get the following error:
Does anyone have any idea what I am doing wrong?!
Beta Was this translation helpful? Give feedback.
All reactions