Noir vs Other zk Languages

What are the key benefits of learning Noir as opposed to other zk languages ​​like Cairo for someone new to zk-SNARKs?

1 Like

The main benefit is that you get privacy with Noir. You can’t do private, client-side proof generation with Cairo, that’s not what it’s designed for. But creating client side proofs with private information is what Noir has been designed to do.

I am not sure how Noir and Cairo compare when just using the succinctness properties of snarks.

2 Likes

Are there any recommendations for building test scenarios for complex circuits in Noir?

To build test scenarios for complex circuits in Noir, start by understanding the circuit logic, breaking it into components, and defining inputs and outputs. List test cases, including normal, edge, invalid, and complex scenarios that simulate real-world usage. Use Noir’s built-in testing framework by writing tests in the tests directory and verifying results with assert_eq! or assert!. Generate inputs automatically to cover all possible cases, and test intermediate steps by adding temporary debug outputs. For reliability, use scenarios that mimic real-world conditions and measure performance with large datasets. Document test cases to simplify maintenance and analysis.
I just decided to ask AI. :stuck_out_tongue:

Noir offers a high-level language specifically designed for writing zk-SNARKs, with a focus on simplicity and security. For newcomers, it provides a straightforward way to interact with zk-SNARKs without deep cryptographic knowledge, compared to more complex languages like Cairo. Noir emphasizes developer-friendly features, making it an accessible starting point for learning zk-SNARKs while still supporting advanced privacy use cases.

This is helpful, thanks! I’m curious, how does Noir handle proving key generation and verification? Is it all integrated, or do you use separate tools?

Noir leaves it up to the proving system to do this. Aztec is working on barretenberg, which can do this.

1 Like

Cairo itself doesn’t handle private inputs or outputs, it primarily execution efficiency and verification on-chain. To actually implement privacy features, you need an additional layer that can manage confidential data through zk-SNARKs. That’s where Noir is designed for, specifically to create and verify zk proofs around private inputs. When you use Noir alongside a smart contract, you can generate proofs off-chain and only reveal the required information on-chain. Example image from @franklyteddy