# proveOnChain

## Description

The `proveOnChain` method generates an on-chain proof for a ZPass credential.

### Parameters

* **`options` (OnChainOptions)**: An object containing:
  * **`program` (string)**: The Aleo program source code
  * **`functionName` (string)**: Name of the function to execute
  * **`inputs` (string\[])**: Array of input parameters for the function
  * **`fee` (number, optional)**: Transaction fee in microcredits
  * **`password` (string, optional)**: Password for key encryption

### Returns

Returns a Promise that resolves to a string containing the transaction ID of the proof.

### Example

```javascript
const transactionId = await zpass.proveOnChain({
    program: programSource,
    functionName: "prove_credential",
    inputs: ["record1234", "2u32"],
    fee: 1000000
});
```


---

# 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://zpass.docs.aleo.org/zpass-sdk/overview/proveonchain.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.
