feat: optionally display personal_sign data as hex#4039
feat: optionally display personal_sign data as hex#4039bwheeler96 wants to merge 1 commit intoMetaMask:masterfrom
Conversation
Allows developers to specify the display encoding of a personal_sign request in the RPC call. Closes MetaMask#3931. For example, requesting users to sign a sha3 hash with personal_sign would result in ugly UTF-8 renderings of hex data. Developers can now sign this data using `web3.personal.sign('0xabcdef', web3.eth.coinbase, { encoding: 'hex' }, callback)` and the data will be displayed as hex.
|
Like I mentioned in #4117, I think this opens some phishing vulnerabilities, since a site could present another site's challenge in hex encoding, obscuring its actual meaning. You replied on that issue:
To that I reply: It sounds like you're waiting for EIP 712 to finalize. In the meanwhile, you can use a temporary beta implementation that is sure to break, to see how it feels: Also please do go over there, review the spec, and see if you can help solidify it! I can't wait for a good version to be produced. My ideal result would include a Closing this for now b/c the security concern and the better alternative available. |
|
@danfinlay EIP 712 is not backwards compatible which sucks. I would argue that the phishing argument is not very valid as pretty much 100% of users are clicking right through the massive warning that could be used to sign arbitrary data (including other sites TOS, transactions, etc). I understand your decision, but I think individual wallet clients need to start spurring innovation independently, otherwise improvements (like EIP 712) are going to sit in the queue forever. |
People click through the hex blob, but people read the legible text in signatures like on CryptoKitties. We need to tend towards more comprehensibility, not less.
Take some ownership of the ecosystem and contribute, or you'll wait for centralized client devs to do all your innovating for you. We'll get there, just slower than you'd like. PRs welcome. |
|
Btw we're hiring as fast as we reasonably can (we're on a training cycle now). We are accelerating, and we will get there, but incentivized parties are always welcome to accelerate the features they are passionate about. |
Allows developers to specify the display encoding of a personal_sign request in the RPC call. Fixes #3931.
For example, requesting users to sign a sha3 hash with personal_sign would result in ugly UTF-8 renderings of hex data. Developers can now sign this data using
web3.personal.sign('0xabcdef', web3.eth.coinbase, { encoding: 'hex' }, callback)and the data will be displayed as hex.I attempted to add a test case in the
confirm-sig-requests.jsintegration test, but I was having difficulty getting the request I added in thedevelopment/states/confirm-sig-requests.jsonfile to appear in the final test. Maybe someone can point me in the right direction?