NEWTON
Asked
4 months ago
16
views
0
I’m signing a message using
account.signMessage(data)
and immediately verifying the signature with the same data and it’s returning false. I don’t see any issue open on this subject on starknet.js. Is this something you’ve already encountered by any chance?
here’s the code:
const data = { types: proposeTypes, primaryType: 'Propose', domain, message }; const sig = await user.account.signMessage(data); let res = await user.account.verifyMessage(data, sig); // returns `false`
I see that’s the expected way to use signMessage through the tests (https://github.com/0xs34n/starknet.js/blob/b20819424dea824c96ac31e0542733c84d87d441/__tests__/account.test.ts#L125-L126).
So I guess something’s going wrong when it comes to either hashing the data and signing it or hashing the data and verifying the signature?
btw: for those wondering: verifyMessage
only works if the account is deployed: if you’re doing this with an account not deployed (basically just a keypair) then this won’t work :)
Newton
asked
4 months ago
There are no answers for this question yet
Want to give yours?
How to use Argent (or any from the main providers) account in the StarkNet.py?
How do I transform data from javascript to Cairo?
How to verify Empiric’s Data Entries Using Events?
Can you explain what is Abstract Account?
What is an abstract account?
How can I connect a StarkNet account using starknetjs?
How to submit a StarkNet contract?
How can I read contract memory with starknetjs?
What the etherscan equivalent for starknet is ?
How does Account Abstraction improve the UX compared to other methods?
Which is this extension that shows you errors before compilation ser?
How does warp handles the contract solidity version?
What's the best advanced StarkNet guide?
How to get the block hash in Cairo lang?