Repository navigation
feat: verify native and batch settlements with per-row ZK proofs - #38
Merged
Merged
Conversation
The circuits repo bound the parsed header to the statement's witnessBlockHash and block number, which changed the verifying key. The vendored proof still carried the placeholder 0x66... hash and would not verify against a proof from the current circuit.
The committed bytecode predated the ZK collect, so a deployment from it had no verifier and could not accept a Groth16 proof. The ERC-20 runtime now carries the seed-0 verifying key the circuit exports.
forge fmt --check failed on four files, which also broke the bytecode guard: CI formats before building, so its rebuild did not match the committed hex. Verifier.sol is generated by the circuits exporter and copied in verbatim. Formatting it would be undone by the next export and would make the two copies diff against each other, so it is excluded via [fmt] ignore rather than reformatted. The three test files are hand-written and are formatted.
Re-exported from circuits f841958. The previous statement's 180-block lease exceeded BOND_DURATION_BLOCKS, so the proof could only be spent by writing bond storage directly; the new one is reachable through bond(). Test expectations are unchanged, including the 258,354 gas figure: the verifying key did not move, only the witness.
From circuits 8274905. The statement now names an address a CREATE actually produces, so a consumer can deploy the escrow where the proof expects it instead of relocating it -- which bond() cannot survive, since the domain separator is fixed at construction.
The native counterpart to EscrowERC20. EscrowNative publishes expectedRecipient and expectedAmount, so the chain shows who was paid what; here both live in intentCommitment and the escrow never learns them. Embeds NativeVerifier rather than Verifier: the native relation is a separate circuit, so its verifying key differs and a proof from one path does not verify against the other. The test collects against a real native proof, which is what would catch the wrong verifier being wired in -- every other guard runs before the proof logic. Native ZK collect measures 287,445 gas against the ERC-20 ZK path's 258,354, for a contract of 8,665 deployed bytes.
The native relation reads transactionsRoot out of the shared header gadget, which changed the ERC-20 relation's constraint system and so its key. The vendored verifier was from the old one, and this escrow would have rejected every proof the current circuit produces. The proof fixture is regenerated with it, since a proof is bound to the key it was produced under.
ozwaldorf
force-pushed
the
feat/zk-native-eth
branch
from
October 9, 2026 05:55
0d0939f to
fb5c10d
Compare
Copies Verifier.sol, NativeVerifier.sol and the proof fixtures from circuits 52dc4a0 and rebuilds the artifacts.
ozwaldorf
marked this pull request as ready for review
November 16, 2026 17:44
EmperorOrokuSaki
approved these changes
Nov 16, 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.
Adds native ETH ZK settlement and progressive mixed-asset batch settlement with one Groth16 proof per row. Statements bind the row, intent commitment, collector, bond attempt, payout, deadline and witness block. Collection uses a 75-block lease and supports partial/final rows, replay rejection and failed-payout claims.
Verifiers and proof fixtures now use the private beta SGX ceremony recorded in circuits commit
cc59207bef6d59347d82e2f2266df6051f72fa58. The single-transfer fixtures retain the existing lease and statement context; batch libraries are generated from the same verifiers. Deployment/runtime bytecode is regenerated at06ed6cf0796dc669b6cb001c847c66b5fc8b8e64.This changes verification keys: new bytecode must be released together with matching Nomad proving-key pins and the API artifact pin. Existing seeded-key escrows are not compatible with ceremony proofs. There is no recursive aggregation or new settlement nullifier.
Validation on November 4: 173 Foundry tests passed, including real native/ERC20 and mixed batch proofs, partial/final collection, invalid-proof atomicity and lease-boundary checks. No on-chain transaction was submitted for this release.
Related: circuits #3, escrow #38, Nomad #138, API #103, SDK #15, frontend #342.