> For the complete documentation index, see [llms.txt](https://docs.notcentralised.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.notcentralised.com/circuits/hashapprover.md).

# HashApprover

The `HashApprover`  is a  [zkSNARK](https://en.wikipedia.org/wiki/Non-interactive_zero-knowledge_proof)s circuit is responsible for generating the hash of a key-value pair using the Poseidon hash function.

### Input Signals

The circuit takes in the following input signals:

* **key**: Represents the key for which the hash will be generated.
* **value**: Represents the value that is paired with the key for the hash generation.

```circom
signal input key;
signal input value;
```

### Output Signals

The circuit produces two output signals:

* **hash**: The generated hash of the input key-value pair.
* **keyOut**: A pass-through of the input key signal.

```circom
signal output hash;
signal output keyOut;
```

### Components

* **hasher**: A `Poseidon` hashing component that takes two inputs: key and value, and outputs the hash.

```circom
component hasher = Poseidon(2);
hasher.inputs[0] <== key;
hasher.inputs[1] <== value;
hash <== hasher.out;
```

### Inclusion of External Circuits

The circuit makes use of the `poseidon` circuit from the `circomlib` library.

```circom
include "../../node_modules/circomlib/circuits/poseidon.circom";
```

### Main Component

The main component of this circuit file is the `HashApprover` template.

```circom
component main = HashApprover();
```

This circuit is straightforward and primarily used for hashing a key-value pair using the Poseidon hash function and passing through the key. The output hash can be used for further data verification processes, while the output key can be used for mapping and data storage purposes.


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.notcentralised.com/circuits/hashapprover.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
