I'm trying to authenticate a user's wax wallet identity on the server. The method I'm trying to follow is this -
- The client sends the server the (claimed) WAX wallet address
- The server creates a random hash and sends it to the client
- The client creates a transaction with the hash and signs it. Instead of pushing it to the chain, the transaction is created with broadcast set to false and it sends the signed transaction to the server
- This is the part where I'm having a problem. What I want to do is use the eosjs API to get the actual public key of the wallet address, and then use eosjs-ecc's recover or verify methods to get a public key from the transaction and verify that it is the same. When I try this, it is producing different public keys each time and none of them match the actual one.
Here's the code I have at the moment: https://github.com/udbhav-s/waxlogindemo If the method I'm trying isn't possible, is there any other way to authenticate a user without using on chain transactions?