r/NervosNetwork • • 5h ago

Community CKBA Presents: Question Time with Xiaomao, Creator of Noir CKB.

Post image
12 Upvotes

Noir CKB is a developer toolchain that connects the Noir programming language (for writing zero-knowledge proofs) with the Nervos CKB blockchain.

In simple terms:

Imagine you want to keep a secret number (like a private score or balance) stored on a blockchain, where only you should be able to update it, without ever revealing the number itself. 

Noir CKB is an experimental way to write private logic in the relatively friendly Noir language, and safely enforce it on CKB. The Private Tally is the current live demo, you can try it on testnet if you want to experiment. 

  • Noir is a programming language made for zero-knowledge (ZK) proofs. ZK proofs let you prove “I followed the rules correctly” (e.g., “I added 5 to my secret number”) without showing the secret. Noir has a clean, Rust-like syntax, so it’s more approachable than older ZK languages. Noir was created by Aztec Network.
  • CKB (Common Knowledge Base) is the Layer 1 blockchain of the Nervos Network. It is Bitcoin-inspired (Proof-of-Work, UTXO-style) but flexible and highly programmable. Data lives in “cells,” and small programs called scripts decide how those cells can be updated. Scripts run in CKB-VM (a RISC-V virtual machine).

Noir CKB lets you:

  • Write the rule in Noir (e.g. “new secret = old secret + amount I add”).
  • Generate a ZK proof on your own computer.
  • Submit a transaction on CKB. A Type Script on-chain verifies the proof and checks that the proof is specifically about this cell and this exact state change (right network, right old commitment, right new commitment, etc.).

The key idea of the project is: 

“A proof that verifies is not the same as a proof that authorizes this cell transition.” 

Xiaomao.

A mathematically perfect proof could still be about the wrong cell or update. Noir CKB binds the proof tightly to the actual transaction so it can’t be reused incorrectly.

The Private Tally is a cell that holds a hidden number.

  • Only the person with the secret key can add to it.
  • Every update is authorized by a zero-knowledge proof generated on their machine.
  • The cell stores only a commitment (a fingerprint of the number + fresh randomness), so the real value stays private.
  • You can add any amount, including 0.
  • There is no normal signature lock; the proof itself is the authority.

On-chain the updates look the same whether you added something or nothing. What stays private is the actual value and the amounts added. Transaction metadata (existence of the tally, timing, who paid fees) is still visible.

It is research / experimental software (pre-audit, testnet only). Not for production or mainnet use yet.

Below is a set of questions targeting the core design trade-offs (binding correctness, performance, trust, tooling, and privacy limits) rather than surface-level features.

We want to pick Xiaomao’s brain on Noir CKB so here it goes:

Hello hello Xiaomao, how’s things? Let’s start with a personal statement, shall we? Who are you, and what is your background?

“My name is Xiaomao, and I’m a ZK and privacy engineer.” 

“Most of my work sits in the zero-knowledge and privacy space, what pulls me in is the idea that you can prove something is true without revealing the data behind it. I think privacy is one of the most important problems in this industry. As more of our lives move on-chain, everything being public by default stops being acceptable, and I want to build the tooling that lets people keep private what should stay private, while still proving they followed the rules.”

“For about a year, I worked with Base as a developer in East Africa, where I helped developers get started, ran workshops, and supported the local builder community. These days my focus has gone deeper into the ZK and cryptography side, and I’m building on CKB. If I had to put my focus in one line, it’s privacy, and the practical side of it: bridging the gap between what protocols can do and what builders can actually ship. A lot of powerful cryptography never reaches developers because the distance between the research and a working build is too wide, and closing that gap is the work I care about most.”

“Outside of engineering, community is a big part of what I do. I co-founded LedgerLady, a women-led developer community that trains and equips women to become strong Web3 developers, and we run cohorts and university workshops across East Africa. I’m also an open-source enthusiast and contributor, so a lot of what I build and learn happens in the open.”

Wonderful, I can see you’ve been busy. How did you find out about CKBuilders and what is it like working around other CKBuilders? What interests you about CKB?

“I found CKB through a friend, to be honest. We were just chatting and he told me about a protocol called CKB, which had a builders program, and they asked if I wanted to join. I said sure, and he referred me to Neon, who leads CKBuilders. After talking with Neon I was onboarded, and that's really when I started learning what CKB is. I hadn't come across it on my own before that.”

“It’s been a really good experience. Beyond learning CKB itself, the part I didn’t expect to enjoy so much is watching other builders grow and seeing the range of things people are shipping in the CKB space. One thing I found fascinating is that most of us coming in as new CKB devs, came from somewhere else first. Some came from Ethereum, some from Polkadot, some from Bitcoin. A lot of people wrote about that transition, coming from Ethereum, or from Polkadot, and I wrote one too. Watching people make that shift and document it is genuinely beautiful to see.”

“I’ve learned a lot from people in the community, and the thing I appreciate most is that everyone is rooting for each other. There are channels for technical discussion and for reviews, where people actually give you feedback on your work. Something I’ve realized is that it’s not easy to get someone to sit down, use your product, and tell you what they think. So when another builder takes their time to test what you built and give you a real review, that means a lot, and that kind of support is one of the best things about the community.”

“The cell model, and specifically what it does to the way you think about programs. Coming in, I expected smart contracts on CKB to work more or less the way they do on Ethereum. What CKB taught me instead was to think in verifiers. A type script isn’t a function you call to mutate storage. It looks at the old state, the new state, and the evidence, and decides whether that transition is allowed. So instead of thinking in accounts, balances, and function calls, I started thinking in state transitions that have to be verified rather than executed. That shift connected directly to how I already think. While I was learning CKB, I kept coming back to ZK in my head. The verifier mindset made it easy to plug the ZK knowledge I already had straight into CKB, and that’s actually one of the reasons I’m building what I’m building now. 
The cell model and ZK proofs fit together more naturally than I expected. Putting a zero knowledge proof inside a type script stops feeling exotic once you see that the script is already a verifier, and the proof is just one more thing it checks before it accepts a transition.”

What advice would you give to anyone looking to build on CKB, and what AI tools would you advise to help anyone on their journey to build on the cell model?

“If you’re a beginner, learn the cell model from first principles before you write anything. If you’re coming from another ecosystem, the important thing is to separate what you already know from how CKB actually works, because they aren’t the same. The cell model is the fundamental thing to understand. Get clear on what a cell is, what capacity means, the difference between lock and type scripts, and what a transaction really is, which is a proposed state transition rather than a function call. Once those are solid, everything else builds on top of them.”

“On AI, I lean on it hard, but as a research and review partner, not as an autopilot. I won’t name specific tools, because I don’t want to push anyone toward one in particular, but in general some models are stronger for research and reasoning through a design, and others are better for coding. I use them to move faster and to pressure test my ideas, and I check everything myself, especially anything new or anything that touches correctness or security.”

Regarding binding and replay protection: the type script rebuilds the public statement from the live transaction before verifying the Groth16 proof.

How do you guarantee that this reconstruction is complete and cannot be gamed by clever transaction construction?

Have you formalized the binding predicate, and what is the strongest attacker model you’ve tested against?

“Honestly, I haven’t formally verified the binding predicate, and I wouldn’t claim it’s provably complete. What I’ve done is make it explicit, and then attack it hard.”

“The type script rebuilds a context digest from the live transaction. That includes the network domain, the consumed cell’s outpoint, the old and new commitments, the successor lock, the capacity, and the action. It hashes that and feeds it in as part of the proof’s public inputs, so the proof only verifies if the statement it was made for matches the transaction it’s actually sitting in. A valid proof for one cell, one network, or one transition won’t be verified anywhere else.”

“The strongest attacker model I’ve tested is someone who can build arbitrary transactions and replay proofs they’ve observed. The Private Tally’s type script runs against a 49-case adversarial CKB-VM matrix plus mutation tests, and the cases that matter here are exactly the kind you’d worry about: multiple same-type inputs in a group, a proof replayed on a different outpoint, a proof replayed on a different tally cell, a capacity change on update, a proof made for a different network, and a creation proof reused as an update. All of them are rejected. The mutation tests then remove each check one at a time and confirm that the attack the check exists to stop gets through without it, so I know each check is doing real work and not just sitting there.”

“The honest limits: the binding is per state transition, not per whole transaction. Fee inputs and change are deliberately left open, which means a third party can pay the fee or relay the exact transition the key holder authorized. They can’t change what it does, but that’s a real property people should know about. And testing against a set of adversarial transactions is not the same as proving no adversarial transaction exists. It’s pre-audit software. Part of why I’m building the generator, which is the next question, is to make the binding predicate come from a small, reviewable spec instead of hand-written script logic, so that the thing you’d formally verify is small and explicit.”

There are CKB-VM cycle costs and practical limits, right? 

Groth16 verification is currently landing in the ~100–120 million cycle range on CKB-VM. 

What is the realistic upper bound on circuit size / public inputs before a proof becomes uneconomical or hits the cycle limit, and have you profiled the dominant costs (pairing, multi-scalar multiplication, Molecule decoding)? 

Are there planned optimizations (precompiles, different curves, batching, or a switch away from Groth16) that could bring this down by an order of magnitude?

“The accepted transaction lands around 100 to 120 million cycles, and the pairing check dominates by a wide margin. Multi-scalar multiplication comes next, and Molecule decoding is small next to those two.”

“Public inputs are the cost you scale directly. It’s roughly 0.28 million cycles for a small input, up to about 2.8 million for a full-width one, and there’s a practical ceiling around six public inputs that comes from the 512-byte witness buffers. Against the 3.5 billion block cycle limit, one verification at around 115 million means you fit on the order of 30 proofs in a block before anything else runs. So the real constraint is throughput, not a single proof hitting the limit.”

“On optimizations, I’ve been de-risking three. The first is batch verification, checking many proofs under one key in a single run with a randomized check. In the research spike it comes out to roughly a 79 million fixed cost plus about 19.9 million per proof, which moves you toward around 170 proofs in a block instead of 30. The second is a single-product rewrite of the on-chain verifier that saves a flat 20 million cycles or so per verification. The third is moving, proving fully into the browser, so the expensive part runs on the user’s machine instead of on-chain. The tally circuit proves in about a tenth of a second on a laptop and under two seconds on an entry-level Android phone.”

“An honest order-of-magnitude drop probably needs batching together with a cheaper verifier, and past that you’re into curve-level precompiles in CKB-VM, which is an ecosystem decision rather than something I can do alone. I’m on Groth16 largely because a working CKB verifier already exists. A different proof system is on the table long term, but it’s a bigger move.”

Trusted setup and authority model

The Private Tally treats the proof as the sole authority (no additional signature lock). You also ran a multi-party phase-2 ceremony and sealed it to a mainnet block.

What is the exact trust assumption today (how many honest contributors are required), and what is the migration path if you later want to remove the trusted setup entirely (e.g., switching to a transparent or universal SNARK that Noir can target)?

“Groth16 needs a trusted setup per circuit. For the Private Tally I ran a phase-2 ceremony with four contributors and sealed it to a public beacon, the hash of a specific CKB mainnet block (number 20,870,000) that didn’t exist when the ceremony started. The trust assumption is the standard one. The setup is sound as long as at least one of those four contributors actually discarded their secret. One honest participant is enough. I want to be clear that it’s sound if one is honest, and it isn’t an audited production ceremony.”

“Removing the trusted setup entirely means moving off per-circuit Groth16 to either a universal or updatable setup, or a fully transparent system with no setup at all. The catch cuts both ways. You need a system that Noir can target, and you need a verifier for it that’s efficient inside CKB-VM. The transparent systems tend to have larger proofs or heavier verifiers, which runs straight back into the cycle costs from the last question.”

“So it’s a real research direction rather than a committed next step. The per-circuit ceremony is the honest cost of the current design, and I’d rather be upfront that removing it isn’t free.”

Tooling direction and generated Type Scripts

What is the current scope of the generator for the type scripts (which public inputs and ell patterns are supported), and how do you plan to keep the generated binding logic auditable rather than becoming an opaque compiler output?

“That last decision is the whole auditability answer. The moment you let a spec drop into arbitrary code, the generated script becomes an opaque compiler output, and you’re back to auditing generated code line by line. By keeping the binding to a few declarative primitives, the thing a reviewer actually reads is the spec, which is short and explicit, and the generated type script follows directly from it. A linter checks the spec for unsafe patterns before anything is generated, and the generated test matrix is there to catch a binding that’s missing a check.”

“However, this is still at the research stage and the prototype has rough edges. An outside review of the spec and the linter turned up gaps that I’m fixing, which is exactly why it’s being reviewed before anything gets built on top of it. The goal isn’t to trust the generator. It’s to make the part you do have to trust small enough to actually read.”

Privacy boundaries and application surface

Which additional privacy properties are realistically achievable on CKB with the current architecture (e.g., unlinkable updates, private ownership transfer, or shielded multi-party state), and which ones would require fundamental changes to the cell model or the proof system? 

“What the tally hides today is the value and every amount added, including whether an update added anything at all. What leaks is the existence of the tally, the timing of the updates, who pays the fee, and the fact that one cell’s updates are linkable to each other.”

“Taking it beyond the tally, to what the full Noir CKB architecture could realistically support once it’s built out: the core capability is private, proof-authorized state on CKB. A developer writes their rule in Noir, and the chain enforces a hidden state transition with no signature, just a proof bound to that exact transition. On top of that, the realistic next property is unlinkable updates. That needs a shielded pool, a commitment tree plus nullifiers, instead of a single cell you keep respending, so that a series of updates can’t be tied together through the cell’s history. That’s the direction I’ve been researching, and it’s also what a private ballot box needs. From there, things like private ownership transfer and shielded multi-party state become reachable on the same machinery, though they’re meaningfully harder, and I’d want the pool solid first.”

“What needs fundamental change, rather than just more circuits, is the L1 metadata. Fee payment, timing, and the existence of a transaction are visible at the chain level, and no amount of script logic hides that. You’d need network level changes, not cell  model changes. So full transaction graph privacy is the wrong thing to promise on this architecture.”

“The sweet spot, for the whole thing, is any application where you want to hide a value or a state but you’re fine with the existence of the activity being public. Private counters and tallies, ballot boxes, private membership and allow lists, confidential state that a specific party updates under proof, those all fit CKB well. What I’d build elsewhere is anything that needs a large and cheap anonymity set, very high-frequency activity, or full metadata privacy. The cycle costs and the public L1 metadata make CKB the wrong tool for those, at least today. The way I think about it is that Noir CKB is for making specific pieces of state private and provably correct, not for making an entire system invisible.”

Great answers, Xiaomao! Thank you for taking the time to answer these questions. What are your next steps or plans for continued development on CKB?

“In the short term, I’m finishing the research that de-risks the hard parts, so the next things I build stand on tested ground rather than hope. The first real application I want to ship on top of that is a private ballot box, where each vote is a hidden update that the chain can count and verify without ever seeing who voted for what. Alongside that, I’m hardening the proof-to-transition binding with the generator and its test matrix.”

“I’m also contributing improvements back upstream to the Groth16 verifier that Cecilia Mulandi built, which is the on-chain verifier my whole project depends on. The main improvement is a single-product rewrite of the pairing check that cuts a flat 20 million cycles or so off every verification, along with the tighter checks that came out of reviewing it. The reason that matters is that it isn’t only my project that gets cheaper. Anyone doing Groth16 verification on CKB uses less of the block’s cycle budget, so the whole ZK stack on CKB gets a little more practical, not just Noir CKB.”

“The bigger vision is this. Right now, building a private, proof-authorized application on CKB means being both a ZK engineer and a CKB script engineer, and hand-writing the binding logic that ties a proof to an exact state transition, which is the part that’s easiest to get subtly wrong. I want to collapse that. The goal is a toolkit where a developer brings their own Noir circuit and a small, readable spec, and gets back a correct, auditable CKB type script, the artifacts, and the adversarial tests, generated for them. If that works, privacy on CKB stops being something only a handful of specialists can build, and becomes something any capable developer can reach for. That’s the thread running through everything I do, closing the gap between what the cryptography can do and what builders can actually ship. The Nervos community DAO grant work I gained after, is me building that bridge for privacy on CKB. Longer term, I want this to grow into a broader base of open privacy and ZK infrastructure and research on CKB that other people build on, not a single app that stops with me.”

Thank you, Xiaomao, for all your answers and your work among the CKB community and through the CKBuilders initiative. These interviews and projects are vital for ecosystem growth, and to help others understand CKB and the possibilities around ZK proofs.
The Common Knowledge Base Association (CKBA) does not endorse, recommend, or promote any projects mentioned. We simply highlight them for informational, educational, and awareness purposes only. Coverage does not imply partnership, affiliation, approval, or any form of endorsement. Always do your own research and exercise independent judgment.

Main project:

Developer: