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

signature verification in evm(solidity) #253

Closed
Dmytro-yakymuk opened this issue Apr 28, 2023 · 2 comments
Closed

signature verification in evm(solidity) #253

Dmytro-yakymuk opened this issue Apr 28, 2023 · 2 comments

Comments

@Dmytro-yakymuk
Copy link

Dmytro-yakymuk commented Apr 28, 2023

maybe there are some cases of using signatures from your examples in evm contracts?
what are the verification options? i just know ECDSA.recover(hash, signature)
from @openzeppelin/contracts/utils/cryptography/ECDSA.sol

where there is v value

if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            /// @solidity memory-safe-assembly
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
    } else {
    return (address(0), RecoverError.InvalidSignatureLength);
}
@Dmytro-yakymuk Dmytro-yakymuk changed the title signature verification signature verification in evm Apr 28, 2023
@Dmytro-yakymuk Dmytro-yakymuk changed the title signature verification in evm signature verification in evm(solidity) Apr 28, 2023
@cychuang0924
Copy link
Contributor

cychuang0924 commented Apr 30, 2023

Hi Dmytro-yakymuk,
This PR maybe help you #118

If you have any question, please let me know.

Thanks a lot!

@Dmytro-yakymuk
Copy link
Author

Hi Dmytro-yakymuk, This PR maybe help you #118

If you have any question, please let me know.

Thanks a lot!

It helped, thanks!

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

No branches or pull requests

2 participants