The forthcoming "Add support of EIP-191, EIP-712 ... message formats" improvement to Custody contract introduces an inconsistency that breaks the "principle of least astonishment".
Both EIP-191 and EIP-712 are defined via message being signed. In the implementation this message is a state hash for EIP-191, and a channel Id and some state fields for EIP-712. The latter is a characteristics of that EIP, which improves clarify for users in regards to the information they are signing.
For a developer unfamiliar with the codebase this can be confusing. Moreover, for contributors this can create an overhead complexity of remembering "why is so". Therefore, it is suggested to remove this conflict by using the same message in the EIP-191 context as in EIP-712.
To implement this, changes to all components are required:
- in Smart Contract the
Utils.sol need to support this
- in FE and BE signing parties need to pass different values
The forthcoming "Add support of EIP-191, EIP-712 ... message formats" improvement to
Custodycontract introduces an inconsistency that breaks the "principle of least astonishment".Both EIP-191 and EIP-712 are defined via
messagebeing signed. In the implementation thismessageis a state hash for EIP-191, and a channel Id and some state fields for EIP-712. The latter is a characteristics of that EIP, which improves clarify for users in regards to the information they are signing.For a developer unfamiliar with the codebase this can be confusing. Moreover, for contributors this can create an overhead complexity of remembering "why is so". Therefore, it is suggested to remove this conflict by using the same
messagein the EIP-191 context as in EIP-712.To implement this, changes to all components are required:
Utils.solneed to support this