smartcontractkit / chainlink

node of the decentralized oracle network, bridging on and off-chain computation
https://chain.link
Other
6.98k stars 1.7k forks source link

[DEVEL] <invoke the vrf.sol problem > #3477

Closed yanyanho closed 3 years ago

yanyanho commented 4 years ago

Description I try to invoke the method " randomValueFromVRFProof" of the vrf.sol . The transaction failed for the line

"require(ecmulVerify(p2, s, sp2Witness), "Second multiplication check failed"); " in linearCombination function. I don't know why , I just use the vrf.go to generate proof.

Your Environment go solidity

PatrickAlphaC commented 3 years ago

Could you add more details here? I'm not sure we can reproduce your error with this much information.

yanyanho commented 3 years ago

Could you add more details here? I'm not sure we can reproduce your error with this much information.

I just wonder that it is needed to use the ecmulVerify function like that "require(ecmulVerify(p1, c, cp1Witness), "First multiplication check failed"); require(ecmulVerify(p2, s, sp2Witness), "Second multiplication check failed") "

I encounter a problem when verify the proof generated by vrf.go. It failed in ecmulVerify function.

PatrickAlphaC commented 3 years ago

When did it fail at this step? Could you add a number ordered list so we can easily reproduce?

yanyanho commented 3 years ago

When did it fail at this step? Could you add a number ordered list so we can easily reproduce?

sorry, I'm busy these day. Is it necessary to do this opreration: require(ecmulVerify(p1, c, cp1Witness), "First multiplication check failed"); require(ecmulVerify(p2, s, sp2Witness), "Second multiplication check failed") I ignore this It can still work.

PatrickAlphaC commented 3 years ago

Maybe you can send a minimum reproducible code example for us to test, I'm not sure I understand the context of this.

se3000 commented 3 years ago

Closing this for now as it lacks enough detail to be reproducible. Please reopen with more details when you have them.

coventry commented 3 years ago

Is it necessary to do this opreration: require(ecmulVerify(p1, c, cp1Witness), "First multiplication check failed"); require(ecmulVerify(p2, s, sp2Witness), "Second multiplication check failed") I ignore this It can still work.

Yes, these are necessary. They're used to verify that certain elliptic-curve points have an arithmetic relationship which the VRF proof depends on.

yanyanho commented 3 years ago

I got is @coventry . for this link : https://ethresear.ch/t/you-can-kinda-abuse-ecrecover-to-do-ecmul-in-secp256k1-today/2384/9.
Yet I wonder why your implementation need use "uWitness" , your VRF implementation is a litter different from https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-vrf-05#section-5. c = ECVRF_hash_points(H, Gamma, kB, kH) is also different .