vyperlang / vyper

Pythonic Smart Contract Language for the EVM
https://vyperlang.org
Other
4.83k stars 790 forks source link

Add built-in cryptographic constants (e.g. `secp256k1` curve order) #3967

Open pcaversaccio opened 3 months ago

pcaversaccio commented 3 months ago

It would be useful to have certain cryptographic constants as built-in constants:

Example:

Furthermore, we could add some important BLS constants for example. A good reference/database on these constants can be found here.

fubuloubu commented 3 months ago

New constants and stuff like this would be great for namespacing in the standard library e.g. from crypto.secp256k1 import CURVE_ORDER or something (containing other types and functions like .derive_public_key(Signature) -> PublicKey)

mozz30-tech commented 2 months ago

It would be useful to have certain cryptographic constants as built-in constants:

Example:

  • The order of the secp256k1 curve : 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141
  • The order of the secp256r1 curve : 0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551

Furthermore, we could add some important BLS constants for example. A good reference/database on these constants can be found here.