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

Support for relevant aspects of ecrecover #105

Open
suhabe opened this issue Oct 17, 2019 · 1 comment
Open

Support for relevant aspects of ecrecover #105

suhabe opened this issue Oct 17, 2019 · 1 comment
Labels
enhancement New feature or request question Further information is requested

Comments

@suhabe
Copy link

suhabe commented Oct 17, 2019

Can solc-verify handle the ecrecover function?

For example, how I can write annotations that specify that this function returns the recovered address if the signature components are valid and otherwise reverts?

pragma solidity 0.5.0;
contract ecrecover00 {
    function execute(bytes32 hash, uint8 sigV, bytes32 sigR, bytes32 sigS) 
                               pure external returns(address) {
        address recovered = ecrecover(hash, sigV, sigR, sigS);
        require(recovered > address(0));
        return recovered;
    }
}
@dddejan
Copy link
Member

dddejan commented Oct 17, 2019

The ecrecover function is currently treated as uninterpreted so there is no meaning attached to it's computation (see, e.g., example).

It is unlikely that we will ever be able to reason about very specific properties such as "signature components are valid" in a generic way. Automated reasoning tools have serious limitations when it comes to reasoning efficiently about cryptographic functions.

To properly support ecrecover property like this, we'd have to extend our spec language with a dedicated predicate ecvalid(...) and manually encode its properties. This is something we are thinking about but it might take a while.

@dddejan dddejan added question Further information is requested enhancement New feature or request labels Oct 17, 2019
@dddejan dddejan changed the title Ecrecover Support for relevant aspects of ecrecover Oct 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants