Lightprotocol / groth16-solana

groth16 verifier implementation with solana altbn syscalls
https://crates.io/crates/groth16-solana
Apache License 2.0
21 stars 3 forks source link

Deserialize proof_a #7

Open ppoliani opened 5 months ago

ppoliani commented 5 months ago

I can see the tests here do some pre-processing on proof_a. I'm trying to do the same using JavaScript so i can then pass the value into a Solana Program. Could you share an example of how we can achieve the same thing in JS?

The code starting from this line https://github.com/Lightprotocol/groth16-solana/blob/master/src/groth16.rs#L316 does some transformation on proof_a which I can't find a way to accomplish in JS.

ananas-block commented 5 months ago

See this js code does the transformation, https://github.com/Lightprotocol/light-protocol/blob/deb9d9e0b90295c362beaf9f955fbb561ecba576/prover.js/src/prover.ts#L166-L293. We will do a new prover.js release in a couple weeks which will include this functionality.