Skip to content

Unable to "recover" after providing the generated "challenge" and "signature" using a valid Ethereum address #6

@ltfschoen

Description

@ltfschoen

I've tried this numerous times, providing a valid Ethereum address as the MetaAddress URL parameter to generate a "challenge", and then making a subsequent request to the other API endpoint with both that "challenge" and the "signature", but it always recovers a different Ethereum address from the original one.

I have checked that Node caching is working

I wrote the following script to generate the "signature" from the "challenge":

require('dotenv').config()
const Web3 = require('web3');

const { PRIVATE_KEY } = process.env;

const main = async () => {
  const infuraHttpProviderUrl = 'https://ropsten.infura.io/v3/<PROJECT_ID>';
  const web3Provider = new Web3.providers.HttpProvider(infuraHttpProviderUrl);
  const web3 = new Web3(web3Provider);

  const metaAuthChallenge = '<INSERT_GENERATED_CHALLENGE>';
  const metaAuthSignature = web3.eth.accounts.sign(metaAuthChallenge, PRIVATE_KEY);
  console.log('metaAuthSignature for metaAuthChallenge: ', metaAuthSignature);
}

main()
  .catch(console.error)
  .finally(() => process.exit());

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions