Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 9 additions & 18 deletions content/docs/zkfetch/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,19 @@ title: zkFetch SDK
description: fetch, but with a zkproof
---

zkFetch allows you to securely fetch remote resources over HTTPS endpoints, providing a proof of correct execution that can be verified by third parties. This ensures that sensitive operations, such as using private API keys, are performed correctly without exposing confidential information.
This is like a regular `fetch` call, but also generates a zkProof of the request and its corresponding response.

## Overview
You can think of this as a tuple `(request, response, zkproof)`.
The `zkproof` tightly couples the request and response, so it becomes impossible to fake the response - secured by cryptography.

You can integrate Reclaim into your backend using zkFetch SDK
In some cases, it might not be possible to reveal the entire request or response. That is because the request or response might contain some sensitive information like api-keys, username/passwords, PII etc.

### Flows
Using zero knowledge proofs, you can redact parts of the request and response without compromising the security of the cryptographic authenticity. So, the tuple that is really generated is
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Correct hyphenation: "zero knowledge proofs" → "zero-knowledge proofs".

Line 13 uses "zero knowledge proofs" (two words), but the standard English term in cryptography and blockchain contexts is "zero-knowledge proofs" (hyphenated).

Apply this diff:

- Using zero knowledge proofs, you can redact parts of the request and response without compromising the security of the cryptographic authenticity. So, the tuple that is really generated is 
+ Using zero-knowledge proofs, you can redact parts of the request and response without compromising the security of the cryptographic authenticity. So, the tuple that is really generated is 
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Using zero knowledge proofs, you can redact parts of the request and response without compromising the security of the cryptographic authenticity. So, the tuple that is really generated is
Using zero-knowledge proofs, you can redact parts of the request and response without compromising the security of the cryptographic authenticity. So, the tuple that is really generated is
🧰 Tools
🪛 LanguageTool

[grammar] ~13-~13: Use a hyphen to join words.
Context: ...username/passwords, PII etc. Using zero knowledge proofs, you can redact parts o...

(QB_NEW_EN_HYPHEN)

🤖 Prompt for AI Agents
In content/docs/zkfetch/index.mdx around line 13, the phrase "zero knowledge
proofs" is missing the standard hyphenation; update it to "zero-knowledge
proofs" so the term follows conventional cryptography/blokchain usage by
replacing the two-word form with the hyphenated form at that location.

```
(redacted-request, redacted-response, zkproof)
```

#### Integrating zkFetch
You can use this library just like you would use a `fetch` call in javascript.

The workflow is as follows:

1. **Initiate Request:** The user calls zkFetch, providing options such as URL, method, and headers.
2. **Fetch and Generate Proof:** zkFetch performs the fetch operation and generates a proof
3. **Verify and Transform Proof:** The proof is verified using `verifySignedProof` and transformed with the `transform` method


## When to Use zkFetch

zkFetch is recommended for fetching public data where the integrity and authenticity of the data need to be verified without exposing any sensitive information. Use zkFetch in scenarios such as:

- Ideal when data is publicly available
- Perfect when you have the auth token and endpoint


42 changes: 42 additions & 0 deletions content/docs/zkfetch/installation.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: Installation
description: Flutter SDK for Reclaim Protocol
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

description is incorrect

---
Comment on lines +1 to +4
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix incorrect SDK description in front matter.

Line 3 states description: "Flutter SDK for Reclaim Protocol" but this is a JavaScript SDK installation guide. This appears to be a copy-paste error from another document.

Apply this diff to correct the description:

- description: Flutter SDK for Reclaim Protocol
+ description: JavaScript SDK for Reclaim Protocol
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
---
title: Installation
description: Flutter SDK for Reclaim Protocol
---
---
title: Installation
description: JavaScript SDK for Reclaim Protocol
---
🤖 Prompt for AI Agents
In content/docs/zkfetch/installation.mdx around lines 1 to 4, the front-matter
description is incorrect ("Flutter SDK for Reclaim Protocol"); update the
description to reflect this is the JavaScript SDK installation guide by changing
the description line to "JavaScript SDK for Reclaim Protocol" in the front
matter.


## Prerequisites
- NodeJS 18 or later

## Get an API Key
Setup your project using the [Get API Key guide](/api-key).

## Enable zkFetch
Make sure zkFetch is turned on for your application from the [Dev Tool](https://dev.reclaimprotocol.org). You can do so by navigating to the application, and looking for zkFetch in the Integration tab.

## Installation

```bash copy
npm i @reclaimprotocol/zk-fetch
```

Please download zk files using this command:
```bash copy
node node_modules/@reclaimprotocol/zk-symmetric-crypto/lib/scripts/download-files
```

### Additional NextJS Configuration

zkFetch uses native modules that need to be externalized in Next.js. Add this to your `next.config.ts`:

```typescript
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
serverExternalPackages: ['koffi', '@reclaimprotocol/zk-fetch'],
};

export default nextConfig;
```




2 changes: 1 addition & 1 deletion content/docs/zkfetch/meta.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"title": "ZK Fetch",
"pages": ["quickstart", "cardano", "stellar"]
"pages": ["installation", "usage", "cardano", "stellar"]
}
257 changes: 0 additions & 257 deletions content/docs/zkfetch/quickstart.mdx

This file was deleted.

Loading