👋 Introduction
Zero-knowledge proofs are a kind of security tool in cryptography. They let one person (the prover) show another person (...
For further actions, you may consider blocking this person and/or reporting abuse
@zeref101 quick question. I've got a circuit with the following public inputs
When I create the proof.json it ends up having the following values:
out1is basically an array with 5 bytes e.g. values between 0 and 255. Theaddressoutput though is a poseidon hash. As I understand it's a big value in the Circom curve's Field set.How do I pass this into the on-chain program? Do I call it this way?
const publicSignalsBuffer = publicSignals.map((i) => to32ByteBuffer(BigInt(i)))Update
I can't get this example verity the ZKP successfully. It feels like the JS code is missing some transformation on the proof_a similar to what the rust code does here github.com/Lightprotocol/groth16-s...
For anyone interested, I have written a Rust crate and bundled it into wasm to use it directly in JS. Check it out here github.com/Apocentre/solana-zk-exa...
This is an awesome article. Thanks for this tutorial. May I ask you if you can share the code for
to32ByteBuffer?Ended up doing something like this:
Thanks, Pavlos! Good catch on the missing code. I've updated the post. I'm not sure about your solution, but if it works, then great! 🙌