Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
circom-to-soroban-hexto parse and validate thecurvefield from verification key JSON inputs, ensuring we only serialize BLS12-381 keys.packages/zk/build/verification_key.json) to the repository so the tool has a valid input for on-chain contract configurations.Root Cause
Previously,
circom-to-soroban-hexignored thecurveproperty in verification key JSON files. Since the only pre-existing vkey (packages/circuits/build/verification_key.json) was BN254 (bn128), running the tool silently marshaled a BN254 curve into a BLS12-381 byte layout, creating a mis-curved key blob that would later fail cryptographic checks on Soroban.Technical Changes
VerificationKeyJsonstruct inpackages/contracts/circom-to-soroban-hex/src/main.rsto include acurve: Stringfield.vk_hexto verify thatcurve == "bls12381". If any other curve (such asbn128) is encountered, the tool panics with a clear mismatch error message naming the required curve.packages/zk/build/verification_key.jsonas specified.Verification / Tests
circom-to-soroban-hex vk packages/circuits/build/verification_key.jsonnow aborts with a curve mismatch error.circom-to-soroban-hex vk packages/zk/build/verification_key.jsonsuccessfully emits the expected BLS12-381 hex blob.Closes #65