Skip to content

Feat/deploy contracts and zk setup - #7

Merged
IyanuOluwaJesuloba merged 6 commits into
mainfrom
feat/deploy-contracts-and-zk-setup
Jul 16, 2026
Merged

Feat/deploy contracts and zk setup#7
IyanuOluwaJesuloba merged 6 commits into
mainfrom
feat/deploy-contracts-and-zk-setup

Conversation

@IyanuOluwaJesuloba

Copy link
Copy Markdown
Collaborator

No description provided.

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
@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nullius Error Error Jul 16, 2026 1:29pm
nullius- Error Error Jul 16, 2026 1:29pm
nullius-frontend Error Error Jul 16, 2026 1:29pm
nullius-frontend-1xlu Error Error Jul 16, 2026 1:29pm
nullius. Error Error Jul 16, 2026 1:29pm
nulliuss Error Error Jul 16, 2026 1:29pm

@IyanuOluwaJesuloba
IyanuOluwaJesuloba merged commit d84fdba into main Jul 16, 2026
2 of 9 checks passed
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.

1 participant