Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Add personal_ecRecover and personal_sign #995

Open
hensha256 opened this issue Nov 7, 2019 · 4 comments
Open

Add personal_ecRecover and personal_sign #995

hensha256 opened this issue Nov 7, 2019 · 4 comments

Comments

@hensha256
Copy link

Expected Behavior

ganache-cli should successfully ecrecover using the web3 function

Current Behavior

  • I have the latest version of ganache-cli Listening on 127.0.0.1:8545
  • web3.eth.personal has now become the package web3-eth-personal, which I have imported into my package.json

In the below code, signature was signed by a ganache address using web3-eth.sign

const web3EthPersonal = require('web3-eth-personal')
const personal = new web3EthPersonal('ws://127.0.0.1:8545')

async isSignatureValid(order) {
    const signature = order['signature']
    const orderHash = hashes.getOrderHash(order, signature['validator'])
    const orderHashHex = ethUtil.bufferToHex(orderHash)

    const signingAddress = await personal.ecRecover(
      orderHashHex,
      signature['r'] + signature['s'] + signature['v']
    )
    return signingAddress == signature['signatory']
  }

When this code gets to personal.ecRecover, it calls through to ganache-cli which I have confirmed in the cli:

Listening on 127.0.0.1:8545
eth_sign
personal_ecRecover

However I am getting the following error message:
Error: Returned error: Method personal_ecRecover not supported.

Steps to Reproduce (for bugs)

The code snippet in the previous section

Your Environment

  • Version used: 6.7.0
  • Version of Truffle/Remix/Other tools used: truffle 5.0.43
  • NodeJS Version: [ ] 6.x, [ ] 7.x (unsupported), [X] 8.x, [ ] 9.x
  • Operating System and version (include distro if Linux): MacOS
  • Link to your project or repro gist:
  • Commit hash to use with above link for reproduction:
  • I intend to submit a pull request to fix this issue: [ ]

also:
"web3-eth": "1.2.2",
"web3-eth-personal": "1.2.2"

@davidmurdoch davidmurdoch transferred this issue from trufflesuite/ganache-cli-archive Aug 19, 2021
@leeftk leeftk modified the milestones: 7.0.0, 7.1.0 Oct 6, 2021
@leeftk
Copy link

leeftk commented Oct 6, 2021

Hey, @hensha256 thanks for raising this. We think this would be a great addition, as well as personal_sign. I'll add this to our roadmap. Thanks!

@davidmurdoch davidmurdoch changed the title Web3 personal_ecRecover not supported Add personal_ecRecover and personal_sign Oct 6, 2021
@ukstv
Copy link

ukstv commented Nov 30, 2021

Hey @leeftk when do you think it has a chance of being generally available?

@mortezardana
Copy link

gm, is there any update on this issue?
I'm currently developing a web app with a wallet gate, which people can sign-up/in with their Ethereum wallet ( e.g. Metamask ), in the process of verifying user's public address and the ownership of that wallet by the user, and trying to sign a nonce parameter and check it with user's provided public address in the back-end. But cannot actually test this mechanism with ganache to see if it works. So any updates on this issue or any other help would be appreciated, cheers

P.S I'm using a Spring back-end and angular for front-end, and using web3j for java and web3 library for angular, with ganache as a testnet.

@lilcryptopump
Copy link

👀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Status: Backlog
Development

No branches or pull requests

6 participants