# Off-Chain Proofs

### Overview

The flow is the following:

1. Your site redirects user to Holonym where the user generates the requested proof.
2. After generating the proof, the user is redirected to a callback specified by the organization. The proof is included in the URL query parameters. At the callback location, the organization can verify the proof.

### 1. Redirect user to Holonym

Redirect user to the following URL:

```
https://app.holonym.id/prove/off-chain/<proofType>?callback=<callback>
```

Parameter descriptions:

* `proofType` - Either `uniqueness` (for government ID proof of uniqueness), `uniqueness-phone` (for phone proof of uniqueness), or `us-residency` (for proof of US residency).
* `callback` - The URL to which the user should be redirected once they've generated their proof. The proof will be added a query parameter to this callback. For example, if `callback` is `https://example.com`, the user will be redirected to `https://example.com?proof=<proof>`.

### 2. Verify proof

The user will not be redirected to the callback unless the proof is valid. But you may want to verify the proof yourself.&#x20;

You can use the [@holonym-foundation/off-chain-sdk](https://www.npmjs.com/package/@holonym-foundation/off-chain-sdk) package to verify proofs.

```javascript
import { 
  verifyUniquenessProof
} from '@holonym-foundation/off-chain-sdk';

/**
 * @param proof - The value of the "proof" query parameter passed to the callback URL
 * @returns {Promise<boolean>}
 */
async function verify(proof) {
  const parsedProof = JSON.parse(proof);
  const result = await verifyUniquenessProof(parsedProof);
  console.log(`User is unique: ${result}`);
  return result;
}
```


---

# 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://zeronym-docs.holonym.id/for-developers/off-chain-proofs.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.
