-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Messages should be able to be signed when requested by a site. It should be done in a standardized way that Ethereum does, in that it is prefixed with a know prefix, hashed and then signed by the user. This signed data is also crafted in such a way as to never allow it to be a valid signed transaction.
- It will allow smart contracts to use ecrcover to verify the signature, and to recover the signers address as well.
- It would also allow MetriMask to be used as a method of web authentication.
- Probably useful for all sorts of cross-chain shenanigans.
an example of how a solidity function might look
function recoverSigner(bytes memory message, bytes memory signature) internal pure returns (address)
{
require(signature.length == 65, "VendorRegistry: Action failed, invalid signature.");
uint8 v;
bytes32 r;
bytes32 s;
assembly
{
r := mload(add(signature, 32))
s := mload(add(signature, 64))
v := byte(0, mload(add(signature, 96)))
}
return ecrecover(keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", keccak256(message))), v, r, s);
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request