Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signing personal messages #4

Open
SeqSEE opened this issue Aug 20, 2021 · 1 comment
Open

Signing personal messages #4

SeqSEE opened this issue Aug 20, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@SeqSEE
Copy link
Contributor

SeqSEE commented Aug 20, 2021

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);
       }
@nibbles83 nibbles83 added the enhancement New feature or request label Aug 20, 2021
@nibbles83
Copy link
Contributor

So I've merged in bitcoin message signing to Metrimask #23

However this doesnt specifically address the functionality you are looking for. However Qtum have implemented QIP-6 (https://blog.qtum.org/qip-6-87e7a9743e14) which allows the use of btc_ecrecover within a pre-compiled contract. I believe this should allow the functionality you are looking for.

qtumproject/qips#7
qtumproject/qtum#664

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants