oceanprotocol / pm

Zenhub needs each issue associated with one repo. This repo is a workaround, to mark issues that span >1 repos.
4 stars 0 forks source link

Signature refactor #144

Closed alexcos20 closed 2 years ago

alexcos20 commented 2 years ago

In our backends, we are using the following logic to sign requests:

web3.eth.sign(encode_defunct(message), wallet)  (py)
web3.eth.sign(message, wallet)   (js)

which is incompatible with how signatures are checked in solidity

Proposal:

ie:

consumerMessage = web3.utils.soliditySha3({
      t: 'bytes',
      v: web3.utils.utf8ToHex(message)
 })
consumerSignature = web3.eth.sign(consumerMessage, wallet)

This requires a refactor on multiple components, and thus they need to be merged/deployed in the same time.

Affected repos: