Skip to content

Commit

Permalink
updated implementation details in EIP-712 (ethereum#3763)
Browse files Browse the repository at this point in the history
* updated implementation details in EIP-712

* fixed typos
  • Loading branch information
wschwab authored and drortirosh committed Oct 3, 2021
1 parent 7334860 commit 2428685
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions EIPS/eip-712.md
Original file line number Diff line number Diff line change
Expand Up @@ -414,13 +414,39 @@ To be done before this EIP can be considered accepted:
* [x] Finalize specification of structure hashing
* [x] Domain separators
* [x] Add test vectors
* [ ] Review specification
* [x] Review specification

To be done before this EIP can be considered "Final":

* [ ] Implement `eth_signTypedData` in major RPC providers.
* [ ] Implement `web3.eth.signTypedData` in Web3 providers.
* [ ] Implement `keccak256` struct hashing in Solidity.
* [x] Implement `eth_signTypedData` in major RPC providers.
* [x] Implement `web3.eth.signTypedData` in Web3 providers.
* [x] Implement `keccak256` struct hashing in Solidity.

**Rationale for marking goals as done:**
* `eth_signTypedData`

MetaMask has had a series of `eth_signTypedData` since 2017 ([article](https://medium.com/metamask/scaling-web3-with-signtypeddata-91d6efc8b290)), and is an accepted standard in the wallet ecosystem.

* `web3.eth.signTypedData`

While this api does **not** exist in the web3.js library as of this writing, it is included as an experimental feature in the Ethers library [here](https://medium.com/metamask/scaling-web3-with-signtypeddata-91d6efc8b290). It can also be called from the Web3.js library by using the `sendAsync` method:

```javascript
web3.currentProvider.sendAsync({
method: 'eth_signTypedData',
params: [msgParams, from]
```
In addition, the `signTypedData` function is of limited utility in web3 convenience libraries, as it is generally relevant to the interface that stores the private keys used for signing, and with the excepetionof burner wallets, this is almost always done in practice within a wallet.
* `keccak256` struct hashing
While the `keccak256` function in Solidity cannot be invoked directly on structs, the introduction of `abi.encode` gives a sufficient and well-accepted avenue to hashing structs.
* review of specification
In the time since EIP-712 has been proposed, it has enjoyed wide ecosystem adoption, and has become the foundation for a number of other EIPs building on top of it. (For example, ERC20 token Permits (transaction-less token approvals) in [EIP-2612](./eip-2612.md).) MetaMask uses EIP-712 for more readable output to present users, and other wallets have followed suit. The widespread traction and use of this EIP over the course of years justify regarding as sufficiently reviewed.
## Copyright
Expand Down

0 comments on commit 2428685

Please sign in to comment.