Debugging zero-knowledge proof blockchains

The Noir Debugger makes executing and inspecting code easier and more reliable

Sep 2023 - Mar 2025
7 min
1 /6

Partner

Aztec is building a groundbreaking blockchain platform that prioritizes privacy by design. Their goal is to enable secure, private transactions without exposing user identities or transaction details. To achieve this, Aztec employs Zero-Knowledge Proofs (ZKPs), a cryptographic technique that proves a transaction's validity without revealing its content.

2 /6

Requirements & Context

To simplify the creation of ZKP systems, Aztec developed Noir, a custom programming language that makes writing these mathematical proofs significantly easier.

While Aztec had successfully built the Noir compiler, developers still lacked a way to debug their ZKP code efficiently. Writing ZKPs is inherently complex, and the absence of debugging tools made development slower, more error-prone, and harder to scale.

They then reached out to Manas.Tech to build a debugger, to allow developers to execute and inspect code step-by-step.

Aztec needed:

3 /6

Approach

The project posed unique challenges, due to the intricate nature of ZKP systems. We built a tailored solution to ensure developers could debug Noir with precision and ease.


Step 1: Designing the Debugger Engine

We developed the debugger engine entirely from scratch using Rust, a language known for its speed and reliability. The debugger interacts with Aztec’s existing virtual machine (VM), which executes Noir code.

Our first task was modifying parts of the VM to allow for code introspection: enabling the debugger to observe code execution at every stage.


Step 2: Mapping High-Level Code to Execution

The Noir compiler transforms high-level Noir code into binary bytecode, optimized for the VM to execute. To enable debugging, we created a system that maps text-level variables to low-level code, allowing developers to track variables in their original, human-readable form.


Step 3: Instrumentation for Tracking

We adopted an instrumentation approach, injecting instructions into the compiled program to facilitate variable tracking. This makes it possible for the debugger to report values and execution flow accurately.


Step 4: Building Developer Interfaces

To provide a seamless debugging experience, we developed two interfaces:

The combination of these tools enables developers to:

[x, y] 0 pedersen_commitment args Id (debug.res) value (debug.res) debug_var_assign args call debug.res = [x, y] 0 pedersen_commitment Instrumentation code to track variable state args call res = fn main ... ... let block res = let return value (debug.res) oracle call fn main ... ... let Boilerplate introduced to re-write original assignment statement so that it can be instrumented Original right hand side of assignement statement
4 /6

Results

In just 6 months, we delivered a fully functional debugger that empowers Aztec’s team to develop Noir-based ZKP systems faster and with greater accuracy. Key outcomes include:

Technologies Used:

VS Code Noir Debugger

Noir developers can now debug and inspect their programs using VS Code or a terminal via Nargo.

VS Code Noir Debugger
5 /6

Impact

By building a robust debugging tool, we helped Aztec remove a significant bottleneck in the ZKP development process. With the Noir debugger, developers can now focus on creating groundbreaking private blockchain solutions without the burden of undetectable bugs or cumbersome workflows.

6 /6

Next steps

With the debugger fully operational, Aztec’s team can continue to innovate in the ZKP and blockchain space. We remain a committed partner, providing ongoing support to ensure the debugger evolves alongside Noir and Aztec’s ambitious goals.

Open source

This project is Open Source, we invite you to collaborate and join us in the development of a better world through the use of technology.

https://github.com/noir-lang/noir

Let’s work together

Start your project