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
Update EIP-2537: rename PAIRING to PAIRING_CHECK; introduce PAIRING_PRODUCT precomiple #8309
base: master
Are you sure you want to change the base?
Conversation
File
|
EIPS/eip-2537.md
Outdated
|BLS12_G2MUL | 0x0f | precompile address | | ||
|BLS12_G2MULTIEXP | 0x10 | precompile address | | ||
|BLS12_PAIRING_CHECK | 0x11 | precompile address | | ||
|BLS12_PAIRING_PRODUCT | 0x11 | precompile address | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would need to be at a different address
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Fixed with c4f2e32
@zhenfeizhang thanks for this! I'm open to updating the name from "pairing" to "pairing check" I intend to get some feedback on tomorrow's ACDE and the next roll call around the necessity for the "pairing result" precompile so until then let's just let this sit and see what we decide to do |
hi @zhenfeizhang ! we discussed on a recent ACD call and there was some pushback that:
please let me know if you see it differently, but at the moment I'd lean towards keeping the EIP as is, and waiting for something like EVMMAX to land to unlock these other use cases |
Hey @ralexstokes I have a few responses to your points:
I'm in support of changing the name to "pairing check" |
+1 |
To clarify, it would require us to settle on a specific ABI for Fp12/GT, and would be useless without Fp12/GT multiplication at minimum and ideally endomorphism accelerated GT exponentiation as well. If this is the way we want to go, the ABI encoding should be canonical and should not be the default dump from Gnark and Kilic which are dependent on the Fp2 -> Fp6 -> Fp12 towering, see supranational/blst#101 (comment) |
given that it seems it would require additional standardization work to settle on something for the pairing product (see prior comment from mratsim), I think it best to leave that for future work. moving the name to |
Updated as proposed. |
this PR does the following
BLS12_PAIRING
toBLS12_PAIRING_CHECK
.The function does not return the actual pairing result but instead checks if the result is identity or not. This renaming reflects the actual behavior. EIP for BN256 also used
pairing check
terminology.BLS12_PAIRING_PRODUCT
precompile.In certain cases there may be a need to compute the actual pairing product, instead of checking the product is 1 or not. Without precompile, we cannot compute a pairing product in solidity. For future proof, I suggest to add this precompile.
Note that for
BN256
, such a precompile does not exist, but the developers can still code this function in solidity (and pay a high gas fee) as the base field fits in U256 and there exists precompiles forMULMOD
. This is almost impossible for BLS12-381. Here the base field is of 381 bits. If one were to implement pairing product, they have to implement the base field operation first, and then implement the actual pairing operation. This base field operation is already very expensive as we don't haveMULMOD
for 381 bits objects. The overall gas cost will be prohibitively high.