flashbots/suave-geth

Private Key Gen Precompile

dmarzzz opened this issue · 5 comments

Rationale

Right now the EthBuildBlock precompile implicitly generates a private key to construct the mevboost payment transaction, but we dont have a precompile to do solely this task. Some SUAPPs would like to generate a private key from inside the SUAPP to claim they dont have control over it. If the SUAPP leaks this info via smart contract code then obviously their claim doesn't hold, but you can verify this via contract introspection.

Key should be ECDA secp256k1 and stored in a format that the signMessage precompile supports so that SUAPPs dont need to reformat.

allnil commented

May I look at it?

totally @allnil ! check out this guide to create a precompile https://suave.flashbots.net/tutorials/create-precompiles , from there you can just grab the key gen code that already exists in a few spots in geth and add some basic error checking and should be good to go

allnil commented

@dmarzzz
aaaammmm
https://suave.flashbots.net/tutorials/create-precompiles this tutorial wants a visitor password! 🗡️

allnil commented

@dmarzzz done! thank you!

np! also here's a good PR which show cases everything needed for adding a precompile #127

There's a bunch of boiler plate that is generated from the directions in the docs for creating a precompile