Skip to content

Conversation

Trivo25
Copy link
Member

@Trivo25 Trivo25 commented Oct 15, 2025

}

#[napi]
pub fn prover_to_json(prover_index: External<WasmPastaFpPlonkIndex>) -> String {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh so instead of requiring a new type for Napi's indexes you expect receiving the old wasm type for this, that's interesting!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea WasmPastaFpPlonkIndex here is the exact same as in plonk-wasm with the exception of the wasm-bindgen macro but that can be fixed later. We should actually be able to share some types and functions between both implementations but i just copy&pasted for now

// TOOD: remove incl all dependencies when no longer needed and we only pass napi objects around
#[derive(Serialize, Deserialize)]
struct SerializedProverIndex {
prover_index: Vec<u8>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does it include separate fields for srs and prover index? In Kimchi's ProverIndex, srs is just one of its contents.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please let me know if there is an easier way to serialize ProverIndex<GAffine, OpeningProof<GAffine>>, that would be very helpful

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we actually have something similar already in caml_pasta_fp_plonk_index_encode but that doesnt encode the srs

.serialize(&mut rmp_serde::Serializer::new(&mut srs))
.map_err(|e| e.to_string())?;

let serialized = SerializedProverIndex { prover_index, srs };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like, isn't this redundant?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants