I need to implement bilinear pairing calculation on my contract. Specifically, I have uploaded some parameters and need other users to calculate the pairing for me and I will pay for them if their answers are correct. Therefore, I need to check their answers on my contracts, that is, implement the pairing equation. I have already found some similar solutions just like zksnark contracts which use the precompiled contracts. But these schemes just provide the pairing check module e(p1[0],p2[0])*e(p1[1],p2[2])...=1. What I want is to get whether e(a,b) is equal to P1. I hope someone can give me some hints or use precompiled contracts to implement my pairing calculation demand. Thanks!

  • I think you're gonna have to do a little bit more than "What I want is to get whether e(a,b) is equal to P1". For example, what are e, a, b and P1 here? – goodvibration Jun 12 at 11:46
  • Well, a and b are the G1 points, e(a,b) represents the pairing operation, and the P1 is the GT point from e(a,b). The existing scheme of the precompiled contracts provides the function that you upload some G1 points and it returns the bool result of your pairing operation just like e(a,b)*e(c,d)*...=1 that what I show above. And I need the P1, that is, the pairing operation result can be received and used on my contract. – AdrianWH Jun 13 at 5:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.