NEWTON
Asked
9 months ago
25
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
9 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?
Cairo: Using less than or greater than in conditional
Cairo: let vs tempvar what is the difference?
I am already running a full Ethereum node on my server. Can I set the PATHFINDER_ETHEREUM_API_URL parameter to my node's endpoint for pathfinder?
Any idea why this code doesn’t connect to argentX in brave?
What's the best advanced StarkNet guide?
Equivalent to Solidity's keccak256(abi.encodePacked())?
How can I use dynamic allocation in Cairo?