# 6. 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.

1. Node.js and browser uses a web assembly implementation: [snarkjs](https://github.com/iden3/snarkjs).
2. Mobile apps use a C++ implementation: [@railgun-community/native-prover](https://github.com/Railgun-Community/native-prover).

````typescript
import { getProver, SnarkJSGroth16 } from "@railgun-community/wallet";
import { groth16 } from "snarkjs";

/**
 * Sets up the Groth16 proving system for the Node.js environment.
 *
 * This function configures the Railgun prover to use the SnarkJS Groth16 implementation.
 * It should be called before performing any zero-knowledge proof operations in a Node.js context.
 *
 * @remarks
 * The function uses the `getProver()` method to obtain the current prover instance
 * and sets the SnarkJS Groth16 implementation on it.
 *
 * @returns A Promise that resolves when the setup is complete
 *
 * @example
 * ```typescript
 * await setupNodeGroth16();
 * // Now the Railgun prover is configured to use Groth16 in Node.js
 * ```
 */
export const setupNodeGroth16 = async (): Promise<void> => {
  // @ts-ignore
  getProver().setSnarkJSGroth16(groth16 as SnarkJSGroth16);
};
````


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.railgun.org/developer-guide/wallet/getting-started/6.-load-a-groth16-prover-for-each-platform.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
