Repository navigation
feat(zone-sdk): build and prove the program steps of an inscription - #18
Merged
Merged
Conversation
pradovic
marked this pull request as draft
November 19, 2026 17:18
pradovic
force-pushed
the
pr/zone-sdk-program-notes
branch
from
November 19, 2026 17:27
2b28a0f to
cfcaca8
Compare
pradovic
force-pushed
the
pr/zone-sdk-proofs
branch
3 times, most recently
from
November 19, 2026 20:47
6daa1b7 to
ff4bc17
Compare
Base automatically changed from
pr/zone-sdk-program-notes
to
offsite/private-utxos
November 20, 2026 08:33
pradovic
force-pushed
the
pr/zone-sdk-proofs
branch
from
November 20, 2026 08:38
ff4bc17 to
23c4d25
Compare
pradovic
marked this pull request as ready for review
November 20, 2026 11:15
hansieodendaal
left a comment
Contributor
There was a problem hiding this comment.
Looking good - one possible code guard to add.
bacv
approved these changes
Nov 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The sequencer builds and proves the program steps of an inscription. The zone describes each mini-block as a list of steps: a holder's step with the proof its node produced, or a ProgramStepSpec naming the program, the tracked program notes it consumes, the program notes it creates as value, stake key and data, the user notes it pays, and its message. prepare_program_inscription, on the sequencer, handle and client, walks the steps as the ledger does, builds each program step at its buffer position, derives nonces, commitments, nullifiers and the step id, picks the root, and returns a ProgramInscription: the op and, per program step, the spend witness bound to the op id, the openings of the created program notes and the three public inputs of the program proof.
A program step spends the set four blocks below the tip, PROGRAM_SPEND_ROOT_DEPTH, so a short reorg of the tip leaves the named root among the set's recent ones, and never a note a pending inscription already spends. A step consuming a note derives its output nonces from its first input, as the circuit enforces; one consuming nothing derives them from the publish parent and its index through the same rule. Everything the ledger would reject is refused before proving: an unknown or foreign input, a note consumed twice, unbalanced values, a deposit to another program, a deposit left unconsumed, too many inputs or outputs, a proof of the wrong kind.
Proving runs off the drive loop. prove_program_step proves a spend with Rapidsnark, and ProgramInscription::step_proofs interleaves the holders' proofs with the assembled program step proofs for the existing submit_prepared_inscription. The zone proves its program itself on the inputs the draft lists.
Tests cover the buffer position, deposits, later mini-blocks, each rejection, proof assembly, and one real spend proof verified against the public inputs the ledger derives from the op. An actor test prepares and submits on tracked notes. The cucumber scenario registers the groth16 crate's toy circuit as the program, publishes a program step creating a note, then one consuming it, and checks the sequencer tracks exactly the notes each block created, with paths valid against the channel's root.
The note-to-field conversions in program_steps.rs, the step id over notes and the spend witness layout, duplicate what core's test helper prove_program_spend does. A follow-up nomos PR moves them into core, and this file drops about a hundred lines on the next pin bump.