
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@iden3/react-native-rapidsnark
Advanced tools
This library is React Native wrapper for the Rapidsnark. It enables the generation of proofs for specified circuits within a React Native environment.
iOS: Compatible with any iOS device with 64 bit architecture.
Version for emulator built without assembly optimizations, resulting in slower performance.
Android: Compatible with arm64-v8a, x86_64 architectures.
npm i @iden3/react-native-rapidsnark
Function takes path to .zkey file and witness file (base64 encoded) and returns proof and public signals.
Reads .zkey file directly from filesystem.
import {groth16Prove} from "react-native-rapidsnark";
// ...
const zkeyPath = "path/to/zkey";
const wtns = await RNFS.readFile("path/to/wtns", "base64");
const {proof, pub_signals} = await groth16Prove(zkeyPath, wtns);
Verifies proof and public signals against zkey.
import {groth16Prove, groth16Verify} from "react-native-rapidsnark";
// ...
const zkey = await RNFS.readFile("path/to/zkey", "base64");
const wtns = await RNFS.readFile("path/to/wtns", "base64");
const verificationKey = await RNFS.readFile("path/to/verification_key", "base64");
const {proof, pub_signals} = await groth16Prove(zkey, wtns);
const proofValid = groth16Verify(proof, pub_signals, verificationKey);
Calculates public buffer size for specified zkey.
import { groth16PublicBufferSize } from "react-native-rapidsnark";
// ...
const public_buffer_size_file = await groth16PublicBufferSize("path/to/zkey");
groth16Prove
has an optional proofBufferSize
, publicBufferSize
and errorBufferSize
parameters. If publicBufferSize is too small it will be recalculated automatically by library.
These parameters are used to set the size of the buffers used to store the proof, public signals and error.
If you have embedded circuit in the app, it is recommended to calculate the size of the public buffer once and reuse it.
To calculate the size of public buffer call groth16PublicBufferSize
.
If you're getting invalid witness length error - check that your witness file is not corrupted and is generated for the same circuit as zkey.
If you get an error like this:
building for 'iOS-simulator', but linking in object file (${SRC_ROOT}/ios/Frameworks/Rapidsnark.xcframework/ios-arm64/librapidsnarkmerged.a[2](fq.o)) built for 'iOS'
Build Phases
tabLink Binary With Libraries
Rapidsnark.xcframework
from Workspace/Pods
folder.Check out the example app and example README for a working example.
Place circuits in example/assets
folder and run example/assets/copy_assets.sh
to copy them to the app directories.
Name them circuit.zkey
, witness.wtns
and verification_key.json
.
The project is licensed under either of
at your option.
FAQs
React-native wrapper for rapidsnark
We found that @iden3/react-native-rapidsnark demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.