Feat/deploy contracts and zk setup - #7
Merged
Conversation
Changed include paths from 'node_modules/circomlib/...' to 'circomlib/...' so the circuit compiles correctly using the -l flag: circom reputation_score.circom -l ../node_modules circomlib is hoisted to the root node_modules by npm workspaces, so the shorter path works with the library search flag.
The previous implementation used raw Bytes which is incompatible with soroban-sdk 27. Rewrote to use the typed BN254 wrappers: - Bn254G1Affine::from_bytes(BytesN<64>) - Bn254G2Affine::from_bytes(BytesN<128>) - Bn254Fr::from_bytes(BytesN<32>) Verification logic: 1. Compute vk_x = IC[0] + MSM(IC[1..3], public_inputs) 2. Pairing check: e(-pi_a, pi_b) * e(alpha, beta) * e(vk_x, gamma) * e(pi_c, delta) == 1 3. Enforce meets_threshold public input == field element 1 VK points are currently placeholder zero-bytes; will be replaced with real values after trusted setup (see vk_bytes.rs).
…nt_gate Address::into() no longer implements IntoVal in soroban-sdk 27. Replaced with Address::into_val(&env) for correct Val encoding when building the args vec for env.invoke_contract().
…ed setup Generated via snarkjs trusted setup for the ReputationScore circuit (382 constraints, powers-of-tau 2^16): snarkjs powersoftau new bn128 16 pot16.ptau snarkjs powersoftau prepare phase2 pot16.ptau pot16_final.ptau snarkjs groth16 setup reputation_score.r1cs pot16_final.ptau reputation_score_0000.zkey snarkjs zkey contribute ... -> reputation_score_final.zkey snarkjs zkey export verificationkey -> verification_key.json node scripts/extract_vk.js -> vk_bytes.rs Encoding: G1 = 64 bytes (x||y), G2 = 128 bytes (x_c1||x_c0||y_c1||y_c0). Public inputs: [threshold, commitment, meets_threshold]
…for sdk 27 deploy.js: - WASM_DIR now points to target/wasm32v1-none/release/ (Rust 1.86+ requires wasm32v1-none instead of wasm32-unknown-unknown) patch_verifier.js: - Updated regex patterns to match soroban-sdk 27 API: Bn254G1Affine::from_bytes(BytesN::from_array(&env, &[0u8; N])) instead of the old Bytes::from_slice(...) form - Updated comment stripping to match the new TODO block wording
…comlib dep - contracts:build script now uses --target wasm32v1-none (required by Rust 1.86+ for Soroban contracts; wasm32-unknown-unknown is deprecated) - Added circomlib ^2.0.5 as a root dependency so it is hoisted to node_modules/ and available to the circuit compiler via -l flag
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
No description provided.