Noir Circuit Development Skills
Comprehensive patterns and best practices for Noir zero-knowledge circuit development.
Subskills
Navigate to the appropriate section based on your task:
- •Circuit Development - Writing Noir circuits: structure, types, generics, traits, oracles
- •Standard Library - Cryptographic primitives, collections, field operations
- •Workspace Setup - Project initialization, Nargo.toml, dependencies
Quick Reference
Writing Circuits
Start with Circuit Structure for the basic template, then explore:
- •Data Types - Field, integers, arrays, structs, BoundedVec
- •Generics - Generic functions, numeric generics, turbofish
- •Traits - Trait definitions, built-in traits, derive macros
- •Modules and Imports - Code organization and visibility
- •Oracles - Foreign function interface with JavaScript
- •Unconstrained Functions - Non-circuit computation and hints
Using the Standard Library
- •Cryptographic Primitives - Hashing, signatures, curves
- •Collections - BoundedVec, HashMap
- •Field Operations - Byte conversions, radix decomposition
Setting Up a Project
- •Project Setup -
nargo init, directory structure, workflow - •Nargo.toml - Package manifest configuration
- •Dependencies - Git, path, and workspace dependencies
Using Noir MCP Server
For detailed API documentation and code examples beyond what is covered here, use the Noir MCP tools.
Available MCP Tools
| Tool | Purpose |
|---|---|
noir_sync_repos() | Clone/update Noir repos locally. Run first to enable searching. |
noir_status() | Check which repos are synced and their commit hashes |
noir_search_code({ query }) | Search Noir source code with regex patterns |
noir_search_docs({ query }) | Search Noir documentation |
noir_search_stdlib({ query }) | Search the Noir standard library |
noir_list_examples() | List available Noir example circuits |
noir_read_example({ name }) | Read full source code of an example |
noir_read_file({ path }) | Read any file from cloned repos by relative path |
noir_list_libraries() | List available Noir libraries |
Workflow
code
User asks Noir question
|
noir_sync_repos() (if not done)
|
noir_search_code() / noir_search_docs() / noir_search_stdlib()
|
noir_read_example() if needed
|
Respond with VERIFIED current syntax
First, sync the repos (if not already done):
code
noir_sync_repos()
Search for code patterns:
code
noir_search_code({ query: "<pattern>", filePattern: "*.nr" })
Search the standard library:
code
noir_search_stdlib({ query: "poseidon" })
List and read examples:
code
noir_list_examples()
noir_read_example({ name: "<example-name>" })
Search documentation:
code
noir_search_docs({ query: "<question>" })