> For the complete documentation index, see [llms.txt](https://docs.nearby.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nearby.finance/protocol-layers/proof-of-location-location-layer/zero-knowledge-proof-generation.md).

# Zero-Knowledge Proof Generation

### Introduction

Zero-knowledge proofs are the core privacy mechanism of the Proof of Location Layer.

They allow users to prove that a location-related statement is true without revealing the underlying location data.

Instead of sharing coordinates, users generate proofs that verify geographic conditions while keeping sensitive information private.

This enables trust without disclosure.

### What Is Being Proven

The system does not prove exact coordinates.

Instead, it proves statements about location.

Examples include:

* The user is within a specific city
* The user is inside an event venue
* The user is located within a country
* The user is present inside a reward zone
* The user satisfies a geographic eligibility requirement

Only the validity of the statement is revealed.

The location itself remains private.

### Proof Construction

Proof generation begins after location signals have been validated and processed within trusted hardware.

The protocol converts these validated inputs into cryptographic witnesses that are consumed by a zkSNARK circuit.

The circuit evaluates predefined geographic conditions and generates a proof when those conditions are satisfied.

### Recursive Proof Architecture

Nearby utilizes recursive proof techniques to improve scalability.

Multiple location proofs can be aggregated into a single compact proof.

This enables:

* Reduced verification costs
* Lower on-chain storage requirements
* Efficient long-term proof histories
* Improved scalability across large user populations

Proof recursion allows the network to verify more activity while consuming fewer resources.

### Verification Keys

Each proof is generated against a publicly verifiable circuit.

Applications and smart contracts use verification keys to validate proofs without accessing private inputs.

Verification confirms that:

* The proof was generated correctly
* The required location condition was satisfied
* Circuit rules were properly executed

No sensitive location information is revealed during verification.

### Performance Considerations

The Proof of Location Layer is designed to balance:

* Privacy
* Verification speed
* Scalability
* Device efficiency

Proof generation occurs on user devices, while verification can occur both off-chain and on-chain.

### Privacy Through Mathematics

Zero-knowledge proofs allow location to become verifiable without becoming visible.

By replacing disclosure with cryptographic proof, Nearby creates a system where users maintain control over their geographic information while applications retain the ability to verify location-dependent conditions.


---

# 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://docs.nearby.finance/protocol-layers/proof-of-location-location-layer/zero-knowledge-proof-generation.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.
