3. Load a Groth16 prover for each platform
Once the RAILGUN Engine is initialized, you will set a Groth16 Prover.
NOTE: A Prover is only necessary for applications that intend to generate proofs, which are necessary to send private transactions (private transfers, private cross-contract calls, and unshielding). Shield-only applications can safely skip this step.
There is a distinct Groth16 prover for node/browser (snarkjs) and a different prover for mobile (native prover). Both provers generate Groth16 snarks using different assembly processes that are compatible with different platforms.
Node.js and browser uses a web assembly implementation: snarkjs.
Mobile apps use a C++ implementation: @railgun-community/native-prover.
Example: Minified SnarkJS (browser)
Get snarkjs.min.js file from the Wallet SDK repo.
Load script in your app's index.html:
<script src="./snarkjs.min.js"></script>
Example: SnarkJS NPM (node.js)
Install with yarn add snarkjs
Example: Native Prover (mobile)
Install with yarn add @railgun-community/native-prover
Last updated