@pedrouid Would you mind updating the official ERC draft to reflect this? Also, why did the EIP712 and EthSign type swap? EIP712 used to be the one before. I don’t mind either way, but I’ve personally been using the following:
I raised an issue that was addressed a while back, and I’d like to re-submit it.
I think this enumeration put some very different thinks at the same level, like if there was a choice between them when it’s more of a combination.
EthSign and EIP712 are standard on how to compute a digest (aka challengeHash) which signature’s is checked at a further point. This allows signature verification mechanisms supporting a single type (bytes32) to extend to any message with some guaranties.
The choice here is app based. If the 0x protocole uses EIP712 signature I, as a user, have to use this scheme.
EIP1271, EIP1654 (and ecrecover) are standards that describe how to check the actual signature against the digest produced earlier.
This is the part we want to make “universal” as its availability dependes on the wallet used by the user. External accounts support direct ecrecover. Smart contract based wallet do not support ecrecover but can support EIP1271 and or EIP1654. We would like dapps to support these seamlessly.
What I mean is we can have EthSign + ecrecover (most common case today), EthSign + EIP1271, EIP712 + ecrecover , EIP712 + EIP1271, … depending of the digest scheme and the signing account specifications.
That being said, I understand this enumeration does not allow combination of bytes. What Signature byte should be set in the case of an structure signed with EIP712 hashing by a wallet using EIP1271 ?
EIP 712 changed significantly over time, there are now 4 variations out there (MetaMask supports 3: v1, v3, v4), so it might be worth either reserving an identifier for each, or specifying which is intended by this standard.
v1: Was very simple, just a key-value store, no array or struct support.
v2: Cipher browser was the only one to implement it, I’m unaware of where to find docs on it.
v3: Added array support
v4: Added struct, and recursive type support.