Skip to content

signature verification in evm(solidity) #253

@Dmytro-yakymuk

Description

@Dmytro-yakymuk

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);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions