1 /4

Partner

Aztec Labs is building the Aztec Network, a fairer, more open financial ecosystem with encryption at its core. This network is a fully programmable private ZK-rollup built on Ethereum.

In alignment with that vision, Aztec Labs developed Noir, a domain specific language for SNARK proving systems that allows developers to generate complex Zero-Knowledge Programs (ZKP) by using simple and flexible syntax, requiring no previous knowledge on the underlying mathematics or cryptography. Zero-Knowledge programs can generate short proofs of a certain statement without revealing some details about it.

2 /4

Requirements & Context

Aztec's vision for Noir has Development Experience as one of its core tenets, so not only do they invest a lot of care and dedication on language design, but they also foster the development of a rich ecosystem of developer tools.

In the context of that effort, they entrusted Manas with developing a debugger for Noir programs.

Given that Noir is an open source project, all of our development is open source in the Noir's Github repository, adopting Noir's standard contributor guidelines.

3 /4

Approach

In order to achieve our goal, we needed to introduce a number of enhancements to Noir's compiler, particularly to allow managed step by step execution at runtime.

We also introduced an instrumentation layer which can be enabled when compiling in debug mode. This instrumentation layer operates on the program's AST to keep track of runtime state and make it externally observable by the debugger.

Finally, we implemented the DAP protocol for the debugger, necessary for IDE based debugger UIs to interact with the language runtime.

[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 /4

Results

In less than 4 months of work, we succeeded in delivering a first feature-rich version of the debugger. The debugger is made available to Noir programmers in two functionally equivalent forms: as a REPL based debugger, and in VS Code as part of the official Noir VS Code extension.

The debugger ships with Noir since version 0.26. You can read its documentation (which will ship as part of v0.28.0) here.

Once the documentation is officially published, we will help the Noir team at Aztec Labs collect user feedback from the community, from which we expect to identify potential improvements and new features to help make the experience of debugging Noir programs even better!

VS Code Noir Debugger

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

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