> For the complete documentation index, see [llms.txt](https://zpass.docs.aleo.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zpass.docs.aleo.org/zpass-sdk/overview/proveoffchain.md).

# proveOffChain

## Description

The `proveOffChain` method generates an off-chain proof for a ZPass credential, executing the program locally without submitting to the blockchain. The program can be both deployed on-chain or a local program that is not deployed on-chain but is provided and agreed upon by all the involved parties (issuer, user, verifier).

### Parameters

* **`options` (ProveOffChainOptions)**: An object containing:
  * **`localProgram` (string)**: The Aleo program source code
  * **`functionName` (string)**: Name of the function to execute
  * **`inputs` (string\[])**: Array of input parameters for the function
  * **`offlineQuery` (OfflineQuery, optional)**: An optional offline query object used to insert the global state root and state paths needed to create a valid inclusion proof offline.

### Returns

Returns a Promise that resolves to an object containing:

* **`outputs` (string\[])**: Array of function outputs
* **`execution` (string)**: The execution trace
* **`verifyingKey` (string)**: The verifying key for the proof

### Example

```javascript
const { outputs, execution, verifyingKey } = await zpass.proveOffChain({
    localProgram: programSource,
    functionName: functionName,
    inputs: [signature, `{
      issuer: ${issuer},
      subject: ${subject},
      dob: ${dob},
      nationality: ${nationality},
      expiry: ${expiry}
    }`,
      `{ salt: ${salt} }`,
    ],
});
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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/proveoffchain.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.
