Skip to content

chore: update dependencies + migrate to @iden3/react-native-rapidsnark 0.0.1-beta.2 (npm)#5

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/update-dependencies-android-ios-bundles
Draft

chore: update dependencies + migrate to @iden3/react-native-rapidsnark 0.0.1-beta.2 (npm)#5
Copilot wants to merge 2 commits intomainfrom
copilot/update-dependencies-android-ios-bundles

Conversation

Copy link

Copilot AI commented Mar 23, 2026

Migrates from a local path reference to the published @iden3/react-native-rapidsnark@0.0.1-beta.2 npm package and updates all iden3/polygonid dependencies to their latest compatible versions.

API Migration

The new rapidsnark package changed its native interface: groth16_prover (byte array in-memory) → groth16Prove (zkey file path + base64 witness), and groth16_verify argument order changed.

share/proof/prove.ts — writes proving key to a UUID-named temp file, calls new API, cleans up in finally:

const zkeyPath = `${tmpDir}/proving_key_${uuidv4()}.zkey`;
await RNFS.writeFile(zkeyPath, fromByteArray(provingKey), 'base64');
const { proof, pub_signals } = await groth16Prove(zkeyPath, calcResult);

share/proof/verify.ts — swapped argument order to match new signature (proof, inputs, vk):

return await groth16Verify(
  JSON.stringify(proof),
  JSON.stringify(pub_signals),
  byteDecoder.decode(verificationKey),
);

Breaking API changes from updated packages

  • @iden3/js-jwz@1.13.1ProvingMethod interface now requires get supportedCircuits(): string[]; added to ProvingMethodGroth16AuthV2
  • @0xpolygonid/js-sdk@1.43.0AbstractPrivateKeyStore now requires list(): Promise<{alias, key}[]>; added to AppStoragePrivateKeyStore

Dependency updates

Package From To
@iden3/react-native-rapidsnark ../react-native-rapidsnark (local) 0.0.1-beta.2
@0xpolygonid/js-sdk ^1.7.5 ^1.43.0
@iden3/js-jwz ^1.1.2 ^1.13.1
@iden3/js-iden3-core ^1.1.0 ^1.8.0
@iden3/js-jsonld-merklization ^1.1.2 ^1.7.2
@iden3/js-merkletree ^1.1.2 ^1.5.1
@iden3/js-crypto ^1.0.3 ^1.3.2
react-native 0.72.6 0.72.17
snarkjs ^0.7.2 ^0.7.5
rfc4648 ^1.5.3 ^1.5.4
react-native-fs ^2.20.0 (new, required for zkey temp file I/O)

iOS note

Podfile.lock needs regeneration via pod install after merge — the new react-native-rapidsnark podspec adds a dependency on the rapidsnark CocoaPod (0.0.1-beta.2).

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