Skip to content

Add vm.pubKey(uint)(uint,uint) cheatcode to Vm.sol #356

@pmerkleplant

Description

@pmerkleplant

Vm.sol provides a function to receive the address of a private key: addr(uint256)(address).
Could we get a function to receive the public key as well?

The public key is a secp256k1 point and should be returned in Affine coordinates, i.e. (unit x_coordinate, uint y_coordinate).

To receive the public key of a private key, you currently either have to implement an ecMul function in solidity, quickly leading to out-of-gas errors or use ffi, leading to big overhead and long-running testsuites.

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