Skip to content

upgrade nightstream to 675f2ce (new neo-fold-clean-api)#156

Merged
ecioppettini merged 3 commits into
mainfrom
enzo/upgrade-nightstream-to-675f2ce
Jul 10, 2026
Merged

upgrade nightstream to 675f2ce (new neo-fold-clean-api)#156
ecioppettini merged 3 commits into
mainfrom
enzo/upgrade-nightstream-to-675f2ce

Conversation

@ecioppettini

Copy link
Copy Markdown
Contributor

This PR supersedes #152

That PR was mixed with other previous work I had done before, as mentioned in there. And I thought it was fine, but now I think it requires some extra work/thought, and I didn't want to keep mixing things, so I decided to split it for easier review. I'll do a follow-up PR without those changes done in a more proper way after this. And then a follow-up introducing the tracing crate from the wasm-vm branch.

The second part of the description still applies:

Basically the public API was completely re-written, so this is also basically a re-write of the neo-related parts.

The circuit is basically the same, it's just that I removed the entire twist and shout middleware (since the implementation was actually in nightstream, the code here was just a translation layer), and I restored the code to the partial nebula implementation that I already had before.

I had to re-order some things in the code, because that implementation is a bit more strict (we compute a commitment to the memory events out of circuit and in circuit, and they need to match, so there are two different things that need to happen in the same order), but the logic is the same.

The nebula implementation has the commitment in circuit disabled though, since that's still to expensive, but for now it's mainly a place-holder until there is new memory implementation in Nightstream.

Things that are intentionally out of scope (for now):

1. Sound MCC implementation. The constraints are implemented, but there is the performance issue, plus the challenges are currently not computed (simple change though), and the IVC cross-step state is not bound nor asserted by the verifier.
2. Output binding of the proof to some of the ledger statement. The previous api doesn't exist anymore, and the memory api that I already had doesn't have a replacement yet.

…5f2ce)

Replace the old Twist/Shout proof adapter with the existing Nebula memory
backend, and wire the proof crate through the new flow:
- extract per-batch ark R1CS assignments from the interleaving circuit
- fold them with neo-fold-clean using deterministic preprocessing
- carry the folded audit through ZkTransactionProof
- verify the audit from the interleaving spec/ledger path

Rework circuit synthesis around Nebula's ordered RS/WS commitment model:
- keep tracer and circuit memory-op order aligned
- initialize dynamic ref memories before tracing
- pad traces to scan and folding batch boundaries
- support sparse memory tag ordering in the scan
- zero gated-off write values so tracer and circuit witnesses agree

This intentionally leaves some soundness work for follow-up: the Nebula
Poseidon IC commitment is still disabled, and public binding for memory
tables / host-call roots needs a new (maybe Nightstream-side) API. The
current fold only cross-links the program-state IVC wires.

Signed-off-by: Enzo Cioppettini <48031343+ecioppettini@users.noreply.github.com>
Signed-off-by: Enzo Cioppettini <48031343+ecioppettini@users.noreply.github.com>
Signed-off-by: Enzo Cioppettini <48031343+ecioppettini@users.noreply.github.com>

@SpaceManiac SpaceManiac left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gave the diff a basic read-through. I don't think I know this part of the code well enough yet to really spot subtle mistakes, but I didn't see anything that should prevent this PR from being merged.

@ecioppettini ecioppettini merged commit e5a93ab into main Jul 10, 2026
5 checks passed
@ecioppettini ecioppettini deleted the enzo/upgrade-nightstream-to-675f2ce branch July 10, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants