Web3.js: Implementing of EIP-712

Created on 17 Apr 2019  路  9Comments  路  Source: ChainSafe/web3.js

Description

Implementing of the eth_signTypedData method as described here.

https://github.com/ethereum/web3.js/issues/1975

Expected behavior

web3.eth.signTypedData() exists.

Versions

  • web3.js: latest
2.x Feature Request Stale

Most helpful comment

The EIP states that web3.eth.signTypedData will be a separate method in Web3 1.0 and will have a different signature than web3.eth.sign.

https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md#specification-of-the-web3-api

What's the source of truth on this issue?

All 9 comments

This method already exists in web3-eth. https://github.com/ethereum/web3.js/blob/1.0/packages/web3-eth/src/methods/EthSignMethod.js#L23

The method name is web3.eth.sign(). We can make an alias for web3.eth.signTypedData(). @nivida

The EIP states that web3.eth.signTypedData will be a separate method in Web3 1.0 and will have a different signature than web3.eth.sign.

https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md#specification-of-the-web3-api

What's the source of truth on this issue?

I'm wondering is someone implementing web3.eth.signTypedData ?

This would be super useful as previous signing method is basically deemed deprecated as of now - at least that's what MetaMask is going to tell you when trying to use existing web3.js methods for signing.

After reading @princesinha19 's message I tried having a look at the linked source file (which does not exist).

What I managed to find (https://github.com/ethereum/web3.js/blob/1.x/packages/web3-eth/src/index.js) does NOT contain any reference to eth_signTypedData, and the inputSignFormatter used to format eth_sign's inputs clearly does not support eth_signTypedData's format.

I'm almost mad that I was given false hopes that this issue was addressed ... it should have been years ago ... Being forced to do rpc call myself, I wonder if there is a point to using web3.js anymore in 2020

@Amxx Actually, the structure of the repo got changed that's why the given link reference doesn't exist anymore. Sorry if my message caused any inconvenience to you.

I do not know ... why is this problem difficult to fix .. please help me.?

I got sick of it. If you have any interest in the issue being fixxed, please test my PR

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions

Was this page helpful?
0 / 5 - 0 ratings