Skip to content
This repository was archived by the owner on May 12, 2025. It is now read-only.

secp256k1 precompiles#123

Closed
zeroXbrock wants to merge 7 commits intomainfrom
secp256k1-precompiles
Closed

secp256k1 precompiles#123
zeroXbrock wants to merge 7 commits intomainfrom
secp256k1-precompiles

Conversation

@zeroXbrock
Copy link
Member

@zeroXbrock zeroXbrock commented Dec 8, 2023

📝 Summary

  • add randomUint precompile
  • add secp256k1 precompiles
    • secp256k1Sign
    • secp256k1RecoverPubkey
    • secp256k1VerifySignature

TODO:

  • add tests

📚 References


  • I have seen and agree to CONTRIBUTING.md

fetchBidsAddr = common.HexToAddress("0x0000000000000000000000000000000042030001")
fillMevShareBundleAddr = common.HexToAddress("0x0000000000000000000000000000000043200001")
newBidAddr = common.HexToAddress("0x0000000000000000000000000000000042030000")
randomUintAddr = common.HexToAddress("0x00000000000000000000000000000000F00bA777")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should the hex addresses follow the same scheme as the others?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see a loose pattern in how the addresses are chosen, but it doesn't seem totally consistent.
For example, from

fetchBidsAddr                = common.HexToAddress("0x0000000000000000000000000000000042030001")

we might infer that 0x00..42 implies MEV-Share bid-related precompiles. But then we see

fillMevShareBundleAddr       = common.HexToAddress("0x0000000000000000000000000000000043200001")

So then we might infer that 0x00..42 is strictly bids and 0x00..43 is just bundle-related. But then we see

simulateBundleAddr           = common.HexToAddress("0x0000000000000000000000000000000042100000")

So then my guess is that the scheme is "start with 0x000000000000000000000000000000004 and have some zeros in the middle?"... Is there an actual pattern I should be following?
I thought this address was fun :p but happy to change it -- just wondering how best to avoid conflicts w/ other precompile PRs.

@ferranbt ferranbt mentioned this pull request Dec 13, 2023
1 task
@dmarzzz
Copy link
Member

dmarzzz commented Dec 13, 2023

@zeroXbrock didnt realize my PR does the same #127 , Im curious why we need recover as a precompile if solidity already exposes ecrecover? also we dont include the curve name on signEthTransaction so Im not sure we need to for signing an arbitrary message either if its in ethereums native curve, only for non-native curves

@dmarzzz
Copy link
Member

dmarzzz commented Jan 7, 2024

closing because stale

@dmarzzz dmarzzz closed this Jan 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants