diff --git a/applications/index.md b/applications/index.md index 0b61007f124..612dbdc08a6 100644 --- a/applications/index.md +++ b/applications/index.md @@ -61,6 +61,7 @@ Besides, **there is a clear difference between an application being accepted and | [NP Labs](https://np.engineering/) | [Nullifier Prime: Compliant and Programmable Privacy](./np-compliant_and_programmable_privacy.md) | [GitHub](https://github.com/NP-Eng) | ☐ | ☐ | ☐ | | [Jake Hemmerle](https://github.com/jakehemmerle) | [Substrate MCP Server](./mcp-polkadot.md) | [GitHub](https://github.com/jakehemmerle) | ☐ | ☐ | ☐ | | [Esscrypt Ltd.](https://esscrypt.com/) | [Polkadot ElizaOS Plugin](./ElizaPluginPolkadot.md) | [GitHub](https://github.com/Esscrypt) | ☐ | ☐ | ☐ | +| [Elastic Labs](https://elasticlabs.org/) | [Polkadot Agent Kit](./polkadot_agent_kit.md) | [GitHub](https://github.com/elasticlabs-org/polkadot-agent-kit) | ☐ | ☐ | ☐ | [🔝](#top) diff --git a/applications/polkadot_agent_kit.md b/applications/polkadot_agent_kit.md new file mode 100644 index 00000000000..dc13ff0c443 --- /dev/null +++ b/applications/polkadot_agent_kit.md @@ -0,0 +1,388 @@ +# Polkadot Agent Kit + +- **Team Name:** Elastic Labs (https://elasticlabs.org/) - Core contributors of [OpenGuild Community](https://openguild.wtf). +- **Payment Address:** + - **DOT**: 15NL11ZoE9KUY54VWUzC3mawgzsQ2UcniXKSAFUa1hC8vnKd (Elastic Labs Multisig) +- **[Level](https://github.com/w3f/Grants-Program/tree/master#level_slider-levels):** 2 + +## Project Overview + +### Overview + +[Polkadot Agent Kit](https://github.com/elasticlabs-org/polkadot-agent-kit) is an open-source library provides developers with a set of tools to build AI Agents that interact autonomously with the Polkadot SDK-based networks. + +- Main repository: https://github.com/elasticlabs-org/polkadot-agent-kit +- Telegram Chatbot Polkadot Agent: https://github.com/elasticlabs-org/polkadot-agent-kit/tree/main/examples/telegram-bot + +### Motivation & Ecosystem Fit + +Polkadot is widely recognized for its powerful cross-chain capabilities and secure transaction infrastructure. However, interacting with these features—especially through XCM and cross-chain asset transfers—often requires navigating a complex and fragmented developer experience. + +Executing a simple asset transfer across parachains or from Polkadot to another chain can involve multiple intricate steps, making it difficult for developers and users to integrate these capabilities into their applications smoothly. + +Not only that, with its complexity in different runtime architecture & network configuration, each Polkadot SDK-based networks requires a different way to interact with. + +With these challenges in mind, the Polkadot Agent Kit was created to simplify development and reduce the complexity of interacting with Polkadot SDK-based networks through autonomous, agent-driven capabilities. + +### Key Features + +Below are the high-level overview of the library features, a detailed breakdown of each feature and the plan for development is listed in the later sections: + +- **_Secure wallet management_**: Mnemonic-derived wallets or Proxy-based, Multisig-based. + +- **_Cross-chain interactions and queries_**: Primarily built on top of the two protocols XCM & ISMP. Below are common use cases of agent kits: + - Seamlessly multi-hop transfer across parachains and the relaychain. + - Interact with different DeFi protocols in the Polkadot ecosystem. +- **_Basic local chain transactions_** + - (e.g. Query balances, mint new asset & NFTs). +- **_Third-party integrations including:_** + + - **_Social clients_**: Seamlessly integrates with third-party social clients to distribute the agentic feature easier. + - Telegram, Discord, Twitter. + - **_Agent Interoperability_**: Expand the features of AI agents by integrating with External Context Providers (ECP), enrichs the knowledge base of the agent built with this library. + - MCP Server, Langchain Actions, Google A2A. + +## Project Details + +Our team has successfully finished the initial phase of the Polkadot Agent Kit, which can be found and used in the repository: https://github.com/elasticlabs-org/polkadot-agent-kit + +### Installation Guide + +Ensure your NodeJS environment is at least v23.9.0: + +``` +pnpm i @polkadot-agent-kit/sdk +``` + +### Features + +#### Multiple Substrate Network Connections + +Polkadot Agent Kit uses [Polkadot API](https://github.com/polkadot-api/polkadot-api) as the core client library to set up the connection with Substrate-based chains. You can discover [the list of supported chains in the library codebase](https://github.com/elasticlabs-org/polkadot-agent-kit/blob/main/packages/common/src/chains/supported-chains.ts). + +```typescript +// By importing the SDK, Polkadot API descriptors are automatically initalized. +import { PolkadotAgentKit } from "@polkadot-agent-kit/sdk"; + +// Create an agent - no initialization needed. +const agent = new PolkadotAgentKit({ + privateKey: process.env.PRIVATE_KEY, + chains: [ + { name: "westend", url: "wss://westend-rpc.polkadot.io" }, + { + name: "polkadot_assethub", + url: "wss://statemint.api.onfinality.io/public-ws", + }, + { + name: "paseo_hydradx", + url: "wss://pas-rpc.stakeworld.io", + }, + ], +}); + +// Initialize the specific single connection in the list of chains. +const connection = await agent.getConnection("westend"); +``` + +#### Key Types and Mnemonic Support + +The Polkadot AI Agent Kit now supports both Sr25519 and Ed25519 key types with dynamic configuration, as well as mnemonic phrase key generation. + +#### Key Type Configuration + +You can specify which key type to use when creating your agent: + +```typescript +// Create an agent with Sr25519 keys +const agent = new PolkadotAgentKit({ + privateKey: process.env.PRIVATE_KEY, + keyType: "Sr25519", // Use Sr25519 for signing (default is Ed25519) + chains: [{ name: "westend", url: "wss://westend-rpc.polkadot.io" }], +}); +``` + +#### Mnemonic Phrase Support + +You can now create an agent using a mnemonic phrase instead of a raw private key: + +```typescript +// Create an agent from a mnemonic phrase +const agent = new PolkadotAgentKit({ + mnemonic: "word1 word2 word3 ... word12", // Your 12 or 24 word mnemonic + derivationPath: "", // Optional derivation path (default: '') + keyType: "Sr25519", // Optional key type (default: Ed25519) + chains: [{ name: "westend", url: "wss://westend-rpc.polkadot.io" }], +}); +``` + +#### Using Both Key Types and Delegation + +You can mix key types and use both private keys and mnemonics with delegation: + +```typescript +// Advanced configuration with different key types +const agent = new PolkadotAgentKit({ + // Main account with mnemonic + mnemonic: "word1 word2 word3 ... word12", + derivationPath: "//0", + keyType: "Sr25519", + + // Delegate account with private key + delegatePrivateKey: "0x1234...", + delegateKeyType: "Ed25519", + + // Or delegate with mnemonic + // delegateMnemonic: 'word1 word2 word3 ... word12', + // delegateDerivationPath: '//1', + // delegateKeyType: 'Sr25519', + + chains: [{ name: "westend", url: "wss://westend-rpc.polkadot.io" }], +}); +``` + +#### Using the agent to execute with onchain actions + +The Polkadot Agent Kit abstracts complex blockchain interactions into simple prompts. Instead of manually constructing transactions and handling network-specific logic, developers can trigger powerful on-chain actions with a single line of code: + +```typescript +await agent.prompt("Vote Proposal #123 on OpenGov"); +await agent.prompt("Transfer 10 DOT from Asset Hub to Coretime Chain"); +await agent.prompt("Mint an NFT on Asset Hub"); +await agent.prompt("Stake 100 DOT on a DeFi protocol"); +``` + +Under the hood, the agent parses natural-language instructions, identifies the correct transaction type, constructs the necessary extrinsics, handles signature authorization (via Proxy/Multisig if needed), and submits the transaction to the network — all autonomously. + +Without the Polkadot Agent Kit, developers must manually interact with the Polkadot.js API, construct extrinsics, manage wallets, and handle network-specific encoding. + +Here’s an example of how you'd implement the same actions manually: + +```typescript +import { ApiPromise, WsProvider, Keyring } from "@polkadot/api"; + +// Connect to a Hydradx node on Polkadot Relaychain. +const provider = new WsProvider("wss://statemint.api.onfinality.io/public-ws"); +const api = await ApiPromise.create({ provider }); + +// Create a wallet from mnemonic phrase. +const keyring = new Keyring({ type: "sr25519" }); +const account = keyring.addFromUri("your mnemonic here"); + +// Transfer 10 DOT from Asset Hub to Coretime Chain (requires XCM call) +await api.tx.xcmPallet.limitedReserveTransferAssets( + { + V3: { + parents: 0, + interior: { + X1: { + Parachain: , + }, + }, + }, + }, + { + V3: { + fun: { + Fungible: , + }, + id: { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + }, + }, + { + V3: { + parents: 0, + interior: { + X1: { + AccountId32: { + id: , + network: 'Any', + }, + }, + }, + }, + }, + 0, + { + Unlimited: null, + } +).signAndSend(account); +``` + +Now imagine how many lines of code needed to replicate the same functionalities of the below agent prompt: + +```typescript +await agent.prompt( + "Transfer 10 DOT from Asset Hub to Hydration, swap to USDT with + Omnipool and deposit USDT to Bifrost to provide liquid staking." +); +``` + +Polkadot Agent Kit is all about developer experience! + +## Architecture + +| Package | Path | Description | +| :--------- | :----------------- | :-------------------------------------------------------------------------------------------- | +| **Common** | `packages/common*` | Defines RPC endpoints, chain configurations, API interfaces, and types shared across the SDK. | +| **Core** | `packages/core` | Implements on-chain and off-chain functions used internally by the LLM package. | +| **LLM** | `packages/llm` | Provides tools and action calls for integrating with large language models (LLMs). | +| **SDK** | `packages/sdk` | Main developer-facing SDK. Exposes APIs from Common, Core, and LLM for external use. | + +## Technology Stack + +1. **_Blockchain Interaction:_** Using Polkadot API (PAPI) for querying Polkadot SDK-based chains and submitting transactions. +2. **_Cross-chain protocols integrations:_** [XCM](http://docs.polkadot.com/develop/interoperability/intro-to-xcm/), [ISMP](https://github.com/polytope-labs/ismp), [PVQ](https://github.com/open-web3-stack/PVQ). To avoid reinventing the wheels, we plan to work with [`ParaSpell`](https://paraspell.github.io/) team to provide a seamless integrations. +3. **AI Layer & External Context Provides (ECPs):** Leverage the existing LangChain framework for natural language processing, enhanced with a custom tools to expand agent's capabilities. On the other hand, provide an option to integrate with ECPs (MCP Client/Server, A2A-compliant agents, Langchain actions). +4. **DevOps:** Docker for containerized deployment, GitHub Actions for CI, and Vitest for unit testing and e2e testing. This stack ensures compatibility with the Polkadot ecosystem while providing a robust foundation for new features. + +## Team :busts_in_silhouette: + +### Team Members + +- Tin Chung ([Github](https://github.com/chungquantin) / [Website](https://www.chungquantin.com)): + - **Project Role**: General Manager +- Dustin Ho ([Github](https://github.com/CocDap)) + - **Project Role**: Lead Engineer +- Andrew Chau ([Github](https://github.com/chauanhtuan185)): + - **Project Role**: Engineer + +### Contact 📞 + +- **Contact Name:** Tin Chung +- **Contact Email:** [tin@openguild.wtf](mailto:tin@openguild.wtf) + +### Legal Structure + +- **Registered Address:** No legal structure yet. +- **Registered Legal Entity:** No legal structure yet. + +### Team’s Experience + +- Tin Chung ([Github](https://github.com/chungquantin) / [Website](https://www.chungquantin.com)): + - **Background**: + - Polkadot Blockchain Academy Wave 5 Graduate. + - Core blockchain engineer of a parachain team on Polkadot. + - Currently leading developer relation function of the OpenGuild (Polkadot SEA) community. + - 3+ years experience working with blockchain technology: Bitcoin Lightning Network, Solana, Ethereum & Polkadot. + - Experienced with contribution to OSS in Polkadot ecosystem: `ink!`, `pop-cli`, `polkadot-sdk` and more. +- Dustin Ho ([Github](https://github.com/CocDap)) + - **Background**: + - PBA-X Graduate 2025 + - Core engineer at blockchain layer-1 using Polkadot SDK + - 4+ years experiences with blockchain technology: Polkadot, Near, Solana, Ethereum, ... +- Andrew Chau ([Github](https://github.com/chauanhtuan185)): + - **Background**: + - PBA-X graduate + - Ex Backend Engineer at Walless | Open-source wallet on multi-chain + - 2+ years experience working with blockchain technology: Solana, Ethereum + - 2+ years experience working with LLM and AI: LangChain, Tensorflow, PyTorch + +### Team Code Repo + +- https://github.com/elasticlabs-org/polkadot-agent-kit + +### Team github accounts 🧑‍💻 + +- [Tin Chung](https://github.com/chungquantin) +- [Dustin Ho](https://github.com/CocDap) +- [Andrew Chau](https://github.com/chauanhtuan185) + +### Team LinkedIn Profiles 🧑‍🎓 + +- [Tin Chung](https://www.linkedin.com/in/chungquantin/) +- [Dustin Ho](https://www.linkedin.com/in/dung-dinh-880bb0219/) + +## Development Status :open_book: + +- Core Functionality: A command-line interface (CLI) for creating agents that interact with Polkadot Ecosystem via the Polkadot API, leveraging LangChain for natural language processing. +- Integration: Connection to Polkadot testnets (e.g., Westend) and mainnets +- Status: As of March 31, 2025, the repository has been tested with ~100 daily transactions on testnets, demonstrating stability for basic use cases. +- Version: 1.0.0-alpha . Available on npm package . Link: https://www.npmjs.com/package/@polkadot-agent-kit/sdk + +- Codebase: https://github.com/elasticlabs-org/polkadot-agent-kit + +## Development Roadmap :nut_and_bolt: + +### Overview + +- **Total Estimated Duration:** 3 months +- **Full-Time Equivalent (FTE):** 2 +- **Total Costs:** 30,000 USD +- **DOT %:** 60% + +### Milestone 1 — Core SDK with XCM Capabilities + +- **Estimated duration:** 1 month +- **FTE:** 2 +- **Costs:** 9,000 USD + +| Number | Deliverable | Specification | +| ------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| **0a.** | License | MIT | +| **0b.** | Documentation | Documentation Page + Quickstart tutorial. | +| **0c.** | Testing and Testing Guide | Unit tests + E2E tests guide + CI pipeline. | +| 1a. | Migrate to ParaSpell | Migrate from raw XCM implementation to use ParaSpell as the underlying XCM library. | +| 1b. | Multi-hop XCM Transferring | Support multi-hop asset transferring via XCM between parachains (reserve transfers) and parachain to relaychain (teleport). | +| 1c. | Transact | Support XCM transact to allow agent sending runtime calls cross-chain. | +| 2. | Agentic XCM integration-texts codebase | Thorough test coverage for XCM functionalities | + +### Milestone 2 — DeFi Integrations & External Context Providers + +- **Estimated duration:** 1 month +- **FTE:** 2 +- **Costs:** 10,000 USD + +| Number | Deliverable | Specification | +| ------: | ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| **0a.** | License | MIT | +| **0b.** | Documentation | API reference + advanced guide | +| **0c.** | Testing and Testing Guide | Integration/stress tests + guide | +| 1a. | Agentic DeFi Tools: Hydration | Support swapping on Hydration | +| 1b. | Agentic DeFi Tools: Bifrost | Support minting vDOT | +| 1c. | Agentic DeFi Tools: Relaychain Nomination Pools | Support Nomination Pool staking on Relaychain | +| 2a. | Host a Model Context Protocol (MCP) server | Compatible with the structure required of MCP protocol to easily set up a MCP server on top of the library. | +| 2b. | Convertible to Lanchain tools | Easily convert the langchain tools | + +### Milestone 3 — Agent Kit Playground & Examples + +- **Estimated duration:** 1 month +- **FTE:** 2 +- **Costs:** 10,000 USD + +| Number | Deliverable | Specification | +| ------: | ------------------------- | ---------------------------------------------------------------- | +| **0a.** | License | MIT | +| **0b.** | Documentation | Full API reference site + SDK docs | +| **0c.** | Testing and Testing Guide | Extended test suite + user guide | +| 1. | Playground App | Browser application allows developers to play with the agent kit | +| 2. | Replit Examples | Add examples to run the agent kit on Replit | + +## Future Plans + +Polkadot Agent Kit aims to become the go-to open-source toolkit for developers building agentic applications on Polkadot SDK-based networks. After completing milestones, we intend to have a follow-up proposal to Web3Foundation for: + +### Expand Functionality: + +- Auditting & Security Analysis. + +- Pop Agent Kit CLI - Allows developers to initialize the agent kit starter code base easily. +- Support multiple LLM models - Consider migrating the codebase to LiteLLM to support more LLM models. +- Eliza OS compabitibility - Allows developers to integrate the Polkadot Agent Kit as Eliza OS plugin. +- Options to deploy AI agents: Vercel AI SDK Deployment & PHALA TEE Deployment (This will need to be reconsidered in the future). + +### Potential Ecosystem Integrations: + +- Hydration +- Apillon +- PolkaAssembly + +### Developer onboarding and distribution (additional scope - voluntary): + +- Launch comprehensive documentation, quick-start guides, and interactive demos to lower the barrier to entry for new developers. +- Utilize OpenGuild as a distribution platform through online/offlines workshop, collaborate with Polkadot’s flagship events to distribute/promote the kit. +- Introduce open-source bounties at OpenGuild’s meetups to incentivize developers to build agentic applications using the kit, increase mindshare. diff --git a/applications/zk-ink.md b/applications/zk-ink.md new file mode 100644 index 00000000000..5894d1ec789 --- /dev/null +++ b/applications/zk-ink.md @@ -0,0 +1,268 @@ +# zk‑ink Toolkit - Web3 Foundation Grant Application + +* **Team Name:** HashCloak +* **Payment Address:** Fiat (details to be shared upon approval) +* **Level:** 3 + +--- + +## Project Overview + +### Overview + +`zk‑ink` is a developer‑friendly toolkit that unlocks verifiers for **two complementary zero‑knowledge tool‑chains**: + +* **Circom / Noir workflow** – translate circuits written in Circom or Noir into compact **ink!** verifier smart‑contracts for **Groth16, Plonk, FFLonk, and Ultrahonk** (all share an R1CS‑ or Plonkish‑style constraint system). +* **Plonky3 workflow** – compile circuits written in Plonky3’s native Rust DSL (FRI‑based, STARK‑style constraints and **incompatible with Circom/Noir**) into equally‑efficient **ink!** Plonky3 verifiers. + +> This dual‑path design lets Substrate builders pick the circuit language that best fits their needs while always ending with a production‑ready verifier on‑chain. + +#### Why this particular mix of proving systems? + +| System | Setup | Proof size / verify cost | Distinct strength | Polkadot relevance | +| ------------- | ------------------------------ | ---------------------------- | ------------------------------- | ------------------------------------------------------------------------------------------------------------------- | +| **Groth16** | Circuit‑specific trusted setup | \~192 B / single pairing | Smallest proofs, battle‑tested | Ideal for **privacy‑preserving fungible assets** on resource‑constrained parachains (e.g., Shielded DOT transfers). | +| **Plonk** | Universal & updatable | \~1 KB / \~2 pairings | No per‑circuit ceremony | Lowers barrier for many **parathreads** to add ZK gadgets without running a setup each time. | +| **FFLonk** | Universal; FF‑friendly | \~0.8 KB / 1 multi‑exp | Field‑agnostic variant of Plonk | Serves **runtime modules** that already rely on Grumpkin or other exotic curves. | +| **Ultrahonk** | Universal; recursion‑optimized | \~1.5 KB / hash‑based verify | Fast recursive aggregation | Enables **roll‑up style parachains** and light clients that compress thousands of proofs into one. | +| **Plonky3** | Transparent (no setup) | \~2–5 KB / hashing only | STARK‑like, Turbo‑recursive | Perfect for **fast‑finality bridges** and **decentralised sequencer roll‑ups** where recursion depth matters. | + +Including all five gives Polkadot builders a menu that spans **low‑cost static circuits (Groth16)** to **massively‑recursive roll‑ups (Plonky3/Ultrahonk)**—crucial for heterogeneous parachain architectures. + +### Project Details + +#### 1. Mock‑ups / UX Sketches + +`zk-ink` is a **CLI‑first** tool; the primary “UI” is the command‑line plus generated artifacts. A minimal interactive workflow is: + +```bash +# install zk‑ink CLI (one‑time) +cargo install --git https://github.com/hashcloak/zk-ink --locked + +# initialise a new project (Circom or Noir template) +zk-ink new my_circuit --template noir + +# compile and prove the circuit +zk-ink build circuits/transfer.circom --prover plonk --target ink + +# deploy the generated verifier contract to Rococo +cargo contract upload --suri "//Alice" --code target/transfer_verifier.wasm +``` + +The CLI prints a TUI progress bar and writes: + +* `transfer_verifier.wasm` — ready‑to‑deploy ink! contract +* `transfer_verifier.json` — metadata/vk in JSON +* `prove.rs` — Rust helper to generate proofs programmatically +* `transfer_proof.json` — proof file containing field elements serialized in JSON (uniform across all backends) + +A future VS Code extension will surface the same commands via an action palette, but it is **not** part of this grant’s scope. + +#### 2. Data Models / API Specifications + +| Artifact | Format | Purpose | +| ---------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| **Verifying Key (vk)** | JSON file | Consumed by the verifier contract at deploy‑time. | +| **Proof Object** | JSON across all backends | Passed directly to `verify_proof`; contains serialized field elements and public inputs. | +| **Contract ABI** | ink! metadata JSON (generated by `cargo-contract`) | Enables any front‑end to call `verify_proof(bytes proof, bytes public_inputs) -> bool`. | + +A full Rust trait shared by all verifier crates: + +```rust +pub trait InkVerifier { + /// Returns `true` if the proof is valid for the given public inputs. + fn verify_proof(proof: Vec, public_inputs: Vec) -> bool; +} +``` + +#### 3. Technology Stack + +* **Rust `no_std`** for verifier crates (ink! compiles to WASM‑32). +* **Arkworks** for BN254 & BLS12‑381 algebra, **Plonky3** native library for Goldilocks. +* **circom‑compat (arkworks‑rs)** for Rust‑native Circom proof generation. +* **noir‑rs (zkmopro/bb backend)** for compiling Noir circuits and generating proofs. +* **Cargo‑contract** & **ink! 5.0** for contracts. +* **Typescript** (Node >=18) for the SDK & CLI. +* **GitHub Actions** CI: unit tests + Rococo integration. + +#### 4. Architecture & Components + +Developers author circuits in their language of choice; **all subsequent steps are carried out through the single entry‑point `zk‑ink` CLI**, which internally wraps existing compilers/provers (no need to invoke them directly). + +``` + Developer Circuit (Circom / Noir / Plonky3) + | + v + +------------------+ + | zk‑ink CLI | <— compile, prove, deploy + +--------+---------+ + | leverages + +---------------+----------------+ + | circom‑compat │ noir‑rs │ plonky3‑prove | + +---------------+----------------+ + | + +---------------+----------------+ + | Generated Artifacts | + | • ink! verifier (.wasm) | + | • metadata/vk (.json/.ron) | + | • proof file (.json) | + +---------------+----------------+ + | + | ABI + v + +--------------+ + | On‑chain ink! | + | Contract | + +--------------+ + | + v + +------------------+ + | SDK (TS / Rust) | + +------------------+ +``` + +* **CLI commands**: `zk‑ink build` (compile + vk export), `zk‑ink prove` (generate proof), `zk‑ink deploy` (upload verifier), `zk‑ink verify` (local check). +* **Internal wrappers** keep up with upstream tool changes, shielding end‑users from version hell. +* The **SDK** consumes the same proof blob format, making dApp integration uniform across proving systems. + +#### 5. Out‑of‑Scope / Limitations Out‑of‑Scope / Limitations + +* **Front‑end GUIs** (VS Code extension, web dashboards) are NOT part of this grant. +* **Proof generation back‑ends** beyond Circom, Noir, and Plonky3 (e.g., Risc Zero) are future work. +* **Hosting / deployment** costs, **maintained dev‑ops**, and **tokenomics** are explicitly excluded per W3F guidelines. + +### Ecosystem Fit + +Below is a non‑exhaustive snapshot of Web3 Foundation grants touching privacy/ZK and how **zk‑ink** differentiates or complements them: + +| Past Grant | Focus & Deliverable | Gap Filled / Relation to `zk‑ink` | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| **Nullifier Prime** – Compliant & Programmable Privacy 【turn1view0†L1-L6】 | EVM‑fork parachain with automatic shielding/unshielding & wallet UX. | Needs efficient on‑chain verifiers; `zk‑ink` can supply Groth16/Plonk verifiers for its shielded pools. | | | +| **Zkverse** – zkPallet suite 【turn1view1†L1-L6】 | Generic pallets integrating bellman & Plonk libraries; dev‑oriented examples. | `zk‑ink` offers ink! **contracts** rather than pallets and adds Ultrahonk & Plonky3 plus a language‑agnostic SDK. | | | +| **ZK‑Snarks Tutorial** 【turn1view2†L1-L5】 | Educational blog + sample Groth16 verifier pallet. | Tutorial only; our project is production‑grade tooling with five proving systems. | | | +| **zk‑Plonk pallet** 【turn2view0†L1-L4】 | Single pallet implementing Plonk. | `zk‑ink` supports **four additional provers**, ink! WASM targets, and turnkey CLI. | | | +| **Ruby Protocol** – Functional encryption 【turn2view1†L2-L7】 | Middleware for encrypted data monetization (uses FE, not SNARKs). | Could leverage `zk‑ink` verifiers for zero‑knowledge policy proofs. | | | +| **pallet‑MACI** 【turn2view2†L0-L4】 | Anti‑collusion quadratic funding pallet. | MACI on Polkadot will need Plonk‑style verifiers—`zk‑ink` provides drop‑in contracts + SDK. | | | +| **Webb Mixer** 【turn3view0†L1-L5】 | Bulletproofs‑based mixer pallets. | We extend options with Groth16/Plonk mixers and recursive proofs via Ultrahonk. | | | +| **ZeroPool** 【turn3view1†L1-L4】 | Optimistic rollup–style anonymity pool. | Could migrate verifier to ink! through our SDK for better composability with parachains. | | | +| **Evanesco Network** 【turn3view2†L2-L7】 | Privacy DeFi parachain layer. | Needs multi‑prover support for different dApps; `zk‑ink` offers lightweight verifier contracts. | | | +| **ZK Rollups pallet** 【turn4view0†L2-L7】 | Layer‑2 scalability pallet targeting Plasm. | Recursive aggregation via Ultrahonk/Plonky3 in `zk‑ink` can compress rollup proofs. | | | +| **Manta Network** – Privacy DEX/Payments 【turn4view1†L2-L4】 | zkSNARK‑based shielded payments & AMM DEX. | Our multi‑prover verifiers give Manta flexibility to iterate on proof systems without rewriting contracts. | | | +| **KILT Anonymous Credentials** (speculative) | Credential issuance with selective disclosure proofs. | Could embed lightweight Groth16/Plonk verifiers from `zk‑ink`. | | | +| **Aleph Zero** – Liminal privacy chain | Substrate L1 using ink! contracts and zk‑SNARK–based asset mixer (Liminal). | `zk‑ink` can standardize multi‑prover verifiers (Groth16→Plonky3) for Aleph Zero’s mixers and recursive bridges, eliminating bespoke implementations. | | | +| **zkMega** – Zero‑knowledge tool‑set (Patract Labs) | Early Groth16‑based verifier library & modified ink! for ZK Rollups ([github.com](https://github.com/patractlabs/zkmega?utm_source=chatgpt.com)) | Laid groundwork but limited to Groth16; `zk‑ink` delivers multi‑prover (Plonk→Plonky3) support and a polished SDK. | | | +| **Zerochain** (speculative) | Privacy‑first parachain concept. | Toolkit accelerates dev speed by abstracting verifier generation.\*\* (speculative) | Privacy‑first parachain concept. | Toolkit accelerates dev speed by abstracting verifier generation. | + +**Contrast in one sentence:** Whereas prior grants mostly deliver **single‑purpose pallets, dApps, or tutorials**, **zk‑ink** is core **tooling infrastructure**—a reusable SDK and suite of ink! verifier crates spanning **five modern proving systems**, closing the integration gap for every future privacy‑oriented parachain or contract on Polkadot. + +--- + +## Team + +| Name | Role | +| ---------------- | ---------------------------- | +| **Manish Kumar** | Cryptography Engineer (lead) | +| **Alex Liao** | Cryptography Engineer | +| **Teresa Li** | Project Manager | + +**Legal structure:** HashCloak Inc., 34 Minowan Miikan Lane, Toronto, Canada. + +**Contact Name:** Pankaj Persaud - Operations Manager + +**Contact Email:** pankaj@hashcloak.com + +**Team website:** hashcloak.com + +### Team’s experience + +HashCloak Inc. is a cryptography R&D lab and consultancy helping teams build secure, scalable, and privacy-preserving blockchain infrastructure. From advancing privacy tools to strengthening cryptographic security and optimizing blockchain performance, we bridge research and real-world deployment. Our expertise spans protocol design, secure computation, and cryptographic audits, ensuring teams can confidently integrate cutting-edge cryptography into their systems. + +We've worked across different ecosystems to build core cryptography and integrate ZK tooling. Some of our recent work includes: +- Implemented proof verifiers in Sway for the Fuel ecosystem: https://github.com/hashcloak/sway-zkp-verifiers + - We wrote a complementary tutorial: https://github.com/hashcloak/sway_zkp_tutorial +- Implemented privacy-preserving logistic regression using Noir and Co-noir: https://github.com/hashcloak/noir-mpc-ml +- Implemented BLS signatures and the ED25519 signature scheme along with their underlying primitives in Sway for the Fuel ecosystem: https://github.com/hashcloak/fuel-crypto +- Designed and implemented a pairing-friendly curve that uses the Starknet curve as the basefield: https://github.com/hashcloak/starkjub +- +An overview of our publicly available work is at https://github.com/hashcloak. + +--- + +## Development Roadmap + +### Overview + +* **Total estimated duration:** 12 weeks +* **Full‑Time Equivalent (FTE):** 2.2 +* **Total costs:** **62 000 USD** + + +### Milestone 1 – Groth16 Verifier & CLI Skeleton + +* **Estimated duration:** 3 weeks +* **FTE:** 2.2 +* **Costs:** **17 000 USD** + +| No | Deliverable | Specification | +| -- | ---------------------- | ----------------------------------------------------- | +| 0a | License | Apache‑2.0 | +| 0b | Documentation | Inline Rust docs + quick‑start guide | +| 0c | Testing | ≥ 90 % unit‑test coverage; basic ink! integration | +| 1 | `ink_zk_groth16` crate | Pairings on BN254 & BLS12‑381, `verify_proof()` ABI | +| 2 | CLI scaffold | `zk‑ink build` & `zk‑ink prove` for Groth16 | +| 3 | Benchmarks | Gas report: Groth16 verifier execution on ink! | + +### Milestone 2 – Plonk & FFLonk + Unified ABI + +* **Estimated duration:** 3 weeks +* **FTE:** 2.2 +* **Costs:** **18 000 USD** + +| No | Deliverable | Specification | +| -- | --------------------- | --------------------------------------------------------------------- | +| 0a | `ink_zk_plonk` crate | Plonk (BN254 & BLS12‑381) | +| 0b | `ink_zk_fflonk` crate | FFLonk (BN254 & BLS12‑381) | +| 0c | Testing | Unit & integration tests for Plonk/FFLonk verifiers; CI pass required | +| 1 | Unified ABI | Same `verify_proof()` signature across crates | +| 2 | CLI upgrade | Support `--prover plonk` flag | +| 3 | Benchmarks | Gas report: Plonk and FFLonk verifier execution on ink! | + +### Milestone 3 – Plonky3 & Ultrahonk + +* **Estimated duration:** 3 weeks +* **FTE:** 2.2 +* **Costs:** **19 000 USD** + +| No | Deliverable | Specification | +| -- | ------------------------ | ---------------------------------------------------------------------------- | +| 0a | `ink_zk_plonky3` crate | Native Plonky3 field support (Goldilocks or others) | +| 0b | `ink_zk_ultrahonk` crate | Ultrahonk (BN254 only) – Halo‑style recursion stub | +| 0c | Testing | Unit & integration tests for Plonky3 & Ultrahonk verifiers; CI pass required | +| 1 | CLI upgrade | Support `--prover plonky3` & `ultrahonk` | +| 2 | Benchmarks | Gas/weight report: Plonky3 and Ultrahonk verifier execution on ink! | + +### Milestone 4 – SDK & Documentation + +* **Estimated duration:** 3 weeks +* **FTE:** 2.2 +* **Costs:** **8 000 USD** + +| No | Deliverable | Specification | +| -- | --------------------- | ---------------------------------------------------------------------- | +| 0a | Typescript & Rust SDK | Helper functions for proof generation & verification | +| 0b | Documentation site | mdBook-based docs.rs site with API reference and getting‑started guide | +| 0c | Testing | End-to-end tests covering SDK interactions with all verifier contracts | + +--- + +## Future Plans + +In terms of features, +* Add STARK‑based verifiers (RiscZero‑style) and recursive aggregation. +* Publish `ink!` privacy primitives library and maintain long‑term support. + +As for sustainability, we have prospective clients who are interested in building in the Polkadot/Kusama ecosystem. Through our work with those clients, we aim to maintain and upgrade this tool. If this project is a good fit for other funding in the Polkadot/Kusama ecosystem, then we are open to applying for extra funding through those venues as well. + +## Additional Information + +We first learned about the Web3 Foundation Grants Program through a personal recommendation from a grants‑committee member several years ago; after iterating on ideas, we now have a conviction‑driven proposal that we are eager to build for the Polkadot community.