All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Recovered the seven ignored IVC prover input preparation tests, which no CI tier ran because no job passes
--run-ignored, and retired the two of them that no longer matched the API after the genesis step was simplified. - Narrowed
IvcProverInput::prepareand its helpers to a verification context holding only the verifying keys, their fixed bases and the KZG verifier parameters, so that preparing a prover input no longer requires the IVC proving key. - Rebuilt the preparation tests on the committed assets and removed their inert
OnceLockfixtures, so that the module needs no key generation, no SRS and no cache and its tests now run in the fast tier.
- Consolidated the recursive circuit
MockProvernegative tests into one case per transition context, so that the public-statement bindings of a context are covered by a single circuit synthesis instead of one per tampered field. - Replaced the rejection-only assertions of the recursive circuit negative tests with exact failure signatures, so that each case now requires the circuit to reject through the expected failure class and to implicate exactly the expected public-statement rows.
- Rebuilt the non-genesis
MockProverfixtures from the committed assets, which makes the same-epoch and next-epoch cases satisfiable when untampered and gives each of them an untampered canary.
- Extended the on-disk test cache to the recursive circuit fixtures, so the recursive verifying key, the certificate golden circuit keys and the deterministic signer fixture are derived once and shared across test processes instead of being rebuilt by each one.
- Shared the unsafe SRS cache between the circuit test generators and the prover setup, so the SRS is generated once per degree across the whole test suite.
- Removed the
StmCircuitError::CircuitKeysCacheLockPoisonedvariant, which became unreachable once the in-process circuit key cache was replaced by the on-disk cache.
- Updated the slow certificate proof tests to verify the committed golden proof instead of each generating its own, which removes eight proof generations from the test suite.
- Moved the golden certificate proof tests out of the slow test tier so that they run on every pull request.
- Updated the
verifyfunction ofIvcProofto combine its two pairing checks into one. The MSMs are combined by drawing a random scalar from the transcript and using it to scale the accumulator values.
- Updated the test handling of the unsafe srs. It is now shared across more tests.
- Updated the cache of the test circuit keys so they can be shared more broadly.
- Removed most of the srs downsizing used in the tests.
- Encoded the proof bytes of the aggregate signature, the SNARK proof and the IVC proof as CBOR byte strings instead of arrays of integers, which halves their encoded size at each nesting level (the previous encoding remains decodable)
- The
future_snarkfeature no longer enables therustlsfeature: the TLS backend of the SRS download is now selected by the caller, which makes thenative-tlsfeature usable.
- Added a
ProtocolErrorenum with aPhiFValueOutOfRangevariant for invalidphi_fvalues
- Updated the
from_bytes_legacyfunctions forMerkleTreeBatchCommitment,MerkleTree,ConcatenationProofandSingleSignature - Updated the validation of the
phi_fvalue in the lottery/eligibility computations - Updated the visibility of
ClosedKeyRegistration,RegistrationEntryandClosedRegistrationEntryto ensure proper verification of the proof of possession - Updated
RegisterError::EntryAlreadyRegisteredto no longer carry the conflictingRegistrationEntry, since the type is now crate-private - Updated
ClosedKeyRegistration::number_of_registered_partiesto be available only when thefuture_snarkfeature is enabled - Updated
ConcatenationProofSigner::check_lotteryto returnStmResult<Vec<u64>>instead ofVec<u64>
- Removed the unused
to_bytesandfrom_bytesmethods fromMerkleTree
- Added benchmarks for the recursive IVC (SNARK) circuit covering proving (Poseidon and Blake2b transcripts), verification, and off-circuit accumulator folding across the genesis, same-epoch, and next-epoch transition paths, plus cold/warm setup measurements for the SRS and circuit keys, all driven through a
benchmark-internalsfaçade over the production proof system. - Added a
mithril-stm/benches/README.mddocumenting the recursive IVC and non-recursive certificate benchmarks and the IVC harness's fail-closed CLI.
- Updated the
from_bytes_legacyfunctions forMerklePath,MerkleBatchPathandAggregateVerificationKeyForConcatenation - Updated the
KeyRegistrationto track the registered key independently from theregistration_entries
- Typed the non-recursive (certificate) circuit's
Relationerror boundary:StmCertificateCircuit::Erroris nowStmCircuitError(with aBackend(String)catch-all and aFrom<plonk::Error>conversion) instead ofplonk::Error, removing theto_synthesis_errorflattening adapter so domain-guard errors stay typed end-to-end
- Updated the transcript hash function for the recursive circuit from
Blake2b512to the Plutus friendlyBlake2b256 - Removed
blake2b_simddependency to use theBlake2b256transcript hash frommidnight-proofs
- Upgraded
midnight-circuitsto7.2.2,midnight-curvesto0.3.1,midnight-proofsto0.8.1, andmidnight-zk-stdlibto2.3.3 - Adapted the IVC circuit configuration to the
midnight-circuits 7.2.2API: replacedForeignEccChip/ForeignEccConfigwithForeignWeierstrassEccChip/ForeignWeierstrassEccConfig - Removed the
com_instancedummy fixed-base entry from the IVC circuit's fixed-base map, which is no longer present in themidnight-circuits 7.2.2verifying key - Renamed the internal constants
CERTIFICATE_VERIFICATION_KEY_NAMEandIVC_VERIFICATION_KEY_NAMEtoCERTIFICATE_FIXED_BASES_PREFIXandIVC_FIXED_BASES_PREFIXto better reflect their role as MSM name prefixes - Added
check_dual_msm_matches_fixed_basespre-flight check in the accumulator module to return an error instead of panicking when the MSM fixed-base names do not match the provided map - Regenerate the recursive and non-recursive circuit keys
- Moved the non-recursive (certificate) SNARK circuit verification key out of
SnarkProofinto the certificate's ancillary verifier data (newAncillaryVerifierData::Snarkcarrying aSnarkVerifierData); it is sourced from there at verification, making the proof slimmer
- Refactored the recursive (IVC) circuit for modularity: extracted reusable gadgets (genesis Schnorr, byte-combination) into a new
gadgetsmodule, moved the witness/public-input assignment and off-circuit accumulator helpers into dedicated modules, and decomposed the state transition into named helpers - Renamed the circuit's
IvcGadgettoIvcConstraintBuilder - Documented the recursive circuit's constraint builder, gadgets, and instance columns
- Decoupled the recursive (IVC) circuit from Midnight proving-library types: single-sourced the backend aliases into a dedicated module, adopted the shared
CircuitCurve, and isolatedValue<T>behind a localCircuitValue<T>alias - Single-sourced the non-recursive verifying-key serde through its byte codec
- Documented the recursive circuit module, its intentional Midnight couplings, and the serialized accumulator/MSM wire format
- Tests to verify that the degree of the circuits is unchanged
- Renamed the recursive (IVC) circuit's Midnight backend type aliases to meaningful names
- Refactors
IvcProverInput::preparefor readability using helper functions - Reworked the way the
Genesiscase is handled: now happens when no rolling state is given to theprovefunction - Renamed variables to clarify which proof or epoch they correspond to
- Added tests for the helper functions
- Separated the production trusted setup from the deterministic unsafe setup used in tests, so the production SNARK setup no longer relies on any unsafe-setup code path.
- Restructured the certificate and IVC key management around a trusted setup provider and an on-disk key provider, with per-circuit key types and clearer naming.
- Better context for the
IvcCircuitError::CertificateProofRejectederror - Better handling of the
GenesisMessagePreimagein tests - Name change for the
AncillaryProverDatavariant
GenesisVerificationKeyBundle, carrying the trusted genesis verification key supplied to aggregate signature verification.
AggregateSignature::verifyandAggregateSignature::batch_verifynow take a genesis verification key bundle and source the genesis Schnorr verification key from it (instead of the certificate-carriedIvcVerifierData), returningAggregateSignatureError::MissingGenesisVerificationKeyBundlewhen it is absent.
- The
genesis_schnorr_verification_keyfield fromIvcVerifierData. - The unused
AggregationError::MissingRollingStateForNextCertificatevariant.
- Added wiring of the IVC prover and verifier in the
ClerkandAggregateSignature.
Clerk::aggregate_signatures_with_typeIVC variant is completed.AggregateSignature::verifyIVC variant is completed.IvcProof::verifynow also checks that the input message is the same as the one used to create the proof.- More fixes: downsizing the srs properly for the ivc keys, proper deserialization of
VerifyingKey, carrying theAncillaryVerifierDatain the certificate.
- Added
AncillaryProofOutput, carrying the optional prover and verifier data produced during aggregate signature creation.
Clerk::aggregate_signatures_with_typenow returns the aggregate signature together with anAncillaryProofOutputinstead of the optionalAncillaryVerifierData.AncillaryGenesisDatanow also carries the genesis Schnorr verification key, gated behind thefuture_snarkfeature.AncillaryProofInputnow also carries the rigid preimage of the protocol message being aggregated, gated behind thefuture_snarkfeature.
- Added
IvcProver::provefor IVC SNARK proof generation with genesis bootstrap and incremental step transitions.
- Renamed the
AncillaryGenesisDatagenesis_messagefield togenesis_message_preimageand gated it, with its getter, behind thefuture_snarkfeature.
- Added proof-system-agnostic ancillary data carriers (
AncillaryProverData,AncillaryVerifierData,AncillaryGenesisData, andAncillaryProofInput) with versioned CBORto_bytes/from_bytes. - Added the
AggregateSignatureType::certifies_full_certificate_chainpredicate.
Clerk::aggregate_signatures_with_typenow takes anAncillaryProofInputand returns the aggregate signature together with the optionalAncillaryVerifierData.AggregateSignature::verifyandAggregateSignature::batch_verifynow accept the optionalAncillaryVerifierData.
- Added
IvcVerifierSetupstructure to bundle the embedded KZG verifier parameters,tau_g2, IVC verifying key, and combined fixed-base map needed to verify IVC proofs without loading the full SRS. - Added
IvcProof::verifyfor off-circuit IVC proof verification using a Blake2b transcript. - Added
IvcProofError::ProofGenerationFailederror variant for the IVC prove path.
- Added Ivc prover input preparation
IvcProverInput::prepare().
- Aligned
halo2_ivcAPIs with STM and domain-specific types, including typed state and witness fields, certificate and recursive proof byte wrappers, and aggregate verification key protocol-message handling. - Aligned
halo2_ivcnaming with STM and certificate-circuit terminology across circuit data, state, witness, protocol-message, proof-system callers, and test/generator identifiers.
- Fixed flakiness in the unit test of the SNARK prover due to race condition on SRS generation.
- Update the signature of the
SnarkProof::verifyto take the SRS verifier parametes as input.
- Replaced
helpers/module inhalo2_ivcwith STM equivalents and removed it entirely. - Moved
MerklePathandTryFrom<&StmMerklePath<D>>adapter to a new sharedcircuits/common/merklemodule. - Added
SchnorrVerificationKey::as_jubjub_subgroup()crate-private accessor for circuit witness encoding. - Enriched
MerklePathAdapterError::InvalidDigestLengthwithexpectedandactualbyte-length fields.
- Added constructors for
IvcSetup,EpochData, andIvcRollingState.
- Replaced infallible
IvcCircuit::newwith fallibletry_newandunknownreturningStmResultwith typedIvcCircuitErrorvariants. - Added
validate_self_vk_degreeandvalidate_column_countspre-flight guards in thehalo2_ivccircuit. - Added unit tests for
IvcCircuitErrorvariants in thehalo2_ivcoff-circuit test suite.
- Added a
SnarkVerifierSetupstructure to hold the SNARK verifier setup parameters (relies on unsafe helpers).
- Added Criterion benchmarks for
StmCertificateCircuitcovering VK/PK setup, proof generation, and verification across small, medium, large, and production parameter tiers. - Added CI parameter benchmarks comparing
MockProverand real prover across a range ofkvalues, with E2E extrapolation formula and reference results table documented in the README.
- Corrected production tier
kfrom2093to1944in benchmarks and README. - Unified
setup,prove, andverifybenchmarks into a single Criterion group with consistent flat sampling configuration.
- IVC prover input preparation helper structures defined.
- A SNARK proof verification function that exposes
DualMsmand will be used by IVC prover is added.
- Replaced the temporary
Certificatecircuit with the realStmCertificateCircuitin thehalo2_ivctest infrastructure. - Renamed
StmCircuittoStmCertificateCircuitfor consistency with the STM naming convention.
- Added Layer C2 off-circuit accumulator and verification mechanics tests, covering accumulator construction, fixed-base extraction, collapse, folding pipeline, and combined proof verification.
- Removed
ivc_e2e.rstest file whose coverage is fully replaced by the golden tests and Layer C2.
- Rigid slot bytes creation for SNARK aggregate verification key and parameters.
- Added a system to handle the downloading and verification of the SRS and to store it locally.
- Replaced Layer C1 real-prover slow tests with off-circuit accumulator checks and MockProver-based constraint tests.
- Reduced CI test time by splitting combined test loops into individual tests to enable nextest parallelism.
- Switched MockProver-only tests to load verifying keys from committed binary assets, eliminating redundant SRS generation.
- Added standard Schnorr signature implementation.
- Added golden test to detect when a change in any of the circuits happens.
- Added functions to compute the verification keys for recursive and non-recursive circuits.
- Added a runbook explaining the steps to follow to update the verification keys when a change happens.
- Fixed the flakiness in some of the circuit tests by making the generation of the srs more stable for access by multiple threads.
- Added Layer B state transition tests for the
halo2_ivcprototype, covering positive and negative transition checks for genesis, same-epoch, and next-epoch steps, including fast asset-based verifier rejections and slow MockProver constraint checks for linkage and hash consistency rules.
- Moved some tests in slow modules and changed some parameters to make the SNARK tests faster
- Split slow
MockProvertests intomod slowsubmodules in thehalo2_ivctest suite and registeredcircuits::halo2_ivcin the CI slow-test filter, preventing slow tests from triggering on unrelated file changes.
- Added Layer A encoding and transition tests for the
halo2_ivcprototype, covering preimage byte-range extraction, state public input ordering, genesis state initialisation, accumulator and verifying key serialisation round-trips, tampered-public-input rejection, and MockProver constraint checks for wrong preimage bytes.
- Updated the creation of merkle path during witness generation to use a constant length for the path by completing it with
0padding. - Updated the non-recursive circuit to ignore
0values during the check of the merkle path to exclude the padding from the computation of the root.
- Added Layer D golden tests for the
halo2_ivcprototype, covering committed asset readers, deterministic asset generators, and a positive golden suite validating stored recursive proofs, the genesis base case, same-epoch and next-epoch recursive steps, and a chained-flow replay check.
- Enhanced the index selection mechanism of snark proof system.
- Reduced the
lower_thanconstraint bit-length from 32 bits to 16 bits in the non-recursive circuit implementation.
- Refactored the bytes codec for all types with cbor bytes encoding and decoding, and added support for backward/forward compatibility.
- Added a feature-gated Halo2 IVC prototype module.
- Added a fix for the encoded message received not matching the expected length
- Added a way to save and load the srs and to cache the circuit verification key (only for testing purposes)
- Added support for SNARK in aggregate signature proof systems.
- Changed proptest range for
phi_fto not use floats anymore as it was cause severe slowdowns in the computations.
- Added a verify functionnality to the SnarkProof and a wrapper for MidnightVK to make handling the circuit verification key easier.
- Switched the Halo2 SNARK transcript from Blake2b to Poseidon in STM proof generation and circuit tests.
- Created a
SnarkProverandSnarkProofstructures inproof_system/halo2_snark/proof.rsthat are responsible for creating a snark proof. - Created a
unsafe_helpers.rsfile that handles the unsafe snark setup (srs,circuitverification_key,proving_key) that will be replaced later.
- Refactored the Halo2 STM circuit to clarify module boundaries, keep
circuit.rsfocused on orchestration, split gadget logic into dedicated modules, introduce explicit witness/instance types, and add focused unit tests for adapters and gadgets.
- Added preparation of SNARK prover input.
- Completed the Halo2 STM naming alignment across circuit types, gadgets, and golden tests, including clearer circuit witness naming and constraint-oriented lottery gadget semantics.
- Replaced the default lottery target value used to create
ClosedRegistrationEntryby the actual computation.
- Introduced circuit-local Halo2 types in
circuits/halo2/types.rswith sharedCircuitBaseField,CircuitBase, andCircuitCurve. - Replaced duplicated local
F/Caliases with shared circuit types across Halo2 circuit, gadgets, and golden helper code. - Standardized Halo2 conversion paths using
From/Intoimplementations for circuit/domain field wrappers. - Added
circuits/halo2/adapters.rsto convert STM Merkle paths into Halo2 witness paths for circuit consumption. - Removed
circuits/halo2/utils/mod.rsand inlined field-limb split logic intocircuits/halo2/gadgets.rs. - Unified synthesis error mapping through
to_synthesis_errorincircuits/halo2/errors.rs.
- Updated the circuit creation function to ensure the types coming from the STM protocol are compatible with the circuit types.
- Removed panic-based failure paths from the Halo2 SNARK circuit prototype and switched to structured
Result-based error handling. - Replaced
assert!(self.quorum < self.num_lotteries)with explicit validation returning a typed circuit error. - Added pre-validation guards to reject malformed witnesses and inconsistent Merkle path shapes before Midnight stdlib panics.
- Reworked remaining failure paths in
circuits/halo2/circuit.rsandcircuits/halo2/gadgets.rsto return structured errors. - Updated Halo2 negative tests to assert structured errors rather than using
#[should_panic].
- Added SNARK compatibility for signer and single signature.
- Renamed
DST_SIGNATUREtoDOMAIN_SEPARATION_TAG_SIGNATUREin STM signature scheme exports and usage chain. - Updated Halo2 circuit code to use STM-level
DOMAIN_SEPARATION_TAG_LOTTERYandDOMAIN_SEPARATION_TAG_SIGNATUREdirectly.
- Removed
circuits/halo2/constants.rsas DST constants are now sourced from STM signature scheme constants.
- Added Halo2 DST alignment unit tests for:
- collision guard (
signature DST != lottery DST), - reference signature DST formula check vs STM computation,
- reference lottery DST formula check vs STM computation.
- collision guard (
- Added negative tests for
SingleSignature::verifyto reject invalid inputs (wrong verification key, out-of-bounds index, wrong message, and mismatched registration).
- Changed the number of iterations of the Taylor expansions used to compute the lottery target value.
- Flakiness in the CI due to non deterministic test SRS generation.
- Added a
from_rawconversion function forBaseFieldElementthat applies modulus reduction to the input.
- Added the computation of the lottery target value for SNARK.
- Switched back-end for computation from rug to num-integer.
- Switched Halo2 circuit and golden helpers to reuse existing STM types and implementations.
- Applied internal refactoring and cleanup in Halo2 witness and helper layers.
- Removed the
circuits/halo2/off-circuitmodule.
- Added SNARK compatibility for key registration.
- Fixed
hash_to_projective_pointfunction and Schnorr signature implementation to match the circuit.
- Added golden tests for the Halo2 STM circuit.
- Added
halo2_snarkmodule forproof_systemand updatedtree.rswith new leaf type.
- Removed
Ok()wrapper during conversion fromKeyRegistrationtoMerkleTree.
MerkleTreeSnarkLeafis added.
- Refactored
AggregateVerificationKeyfor better SNARK support.
KeyRegistrationfunctionality is updated to support different types of registrations.
- Implemented
Digesttrait for the Poseidon hash in a newhashmodule.
- Integrated the Halo2 certificate circuit prototype behind the
future_snarkfeature.
- Changed backend for Jubjub and Poseidon to Midnight ZK in
unique_schnorr_signature.
- Renamed
schnorr_signaturemodule tounique_schnorr_signature.
- Golden test for
avkis added.
- Golden test for closed key registration is added.
SingleSignatureForConcatenationis added.
- Removed the deprecated structures and functions in version
0.5.0.
- Golden tests added for
SingleSignature.
- The
MerkleTreeLeafstruct is converted to a trait to support multiple leaf types.
- Golden tests added for
MerkleTreeBatchCommitment.
- Jubjub wrapper is added for
schnorr_signaturemodule.
- The
D: Digestgeneric is changed with aD: MembershipDigesttrait supporting multiple hash functions for different proof systems.
- Basic verifier functionality is removed.
- Error types in the Stm library moved to corresponding sub-modules.
- Stm library re-organized for SNARK-friendliness.
- Added Schnorr signature modules.
- Stm error handling is done with
anyhow.
- Fixed compilation issues with
rugwhen targetingmuslenvironment.
- Added golden tests for JSON (de)serialization.
- Added support for multiple aggregate signature proof systems.
- Bumped new minor version for release following deprecations of structure names and functions.
- Function names are changed.
- Old struct names are deprecated.
- Struct names are changed.
genwill become a keyword of the language with Rust 2024 so,SigningKey::genis renamed asSigningKey::generate.
- Deprecated
batch-verify-aggregatesfeature is removed.
- Fixed the
from_bytesimplementations to avoid panics with safe slice range gets. - Fixed the
to_bytes/from_bytesimplementations of theStmAggrSigto support variable length signatures.
- Integration tests for to ensure correct serialization and deserialization to bytes.
- Added a
parametermodule andStmParametersfunctionality covered by that.
- Moved doc test to
lib.rs.
- Added a
aggregate_signaturemodule andStmAggrSig,StmAggrVerificationKey,StmClerkandCoreVerifierfunctionality covered by its submodules.
- Added a
single_signaturemodule andStmSigandStmSigRegPartyfunctionality covered by its submodules.
- Added a
participantmodule andStmInitializerandStmSignerfunctionality covered by its submodules.
- STM module visibilities are changed.
- Removed the build script and deprecated
batch-verify-aggregatefeature as the code behind this feature is now compatible with WASM.
- Added a
bls_multi_signaturemodule and multi-signature functionality covered by its submodules.
- Added a
merkle_treemodule and Merkle tree functionality covered by its submodules:- Module
leaf: Includes structureMTLeafand its implementation. - Module
path: Includes structuresPathandBatchPathand their implementations. - Module
commitment: Includes structuresMerkleTreeCommitmentandMerkleTreeCommitmentBatchCompatand their implementations. - Module
tree: Includes structureMerkleTreeand its implementation.
- Module
- Moved implementation blocks under their respective structures.
- Ordered property tests.
- Deprecate
portablefeature:- Instead, always enable BLST
portablefeature for runtime check of intel ADX instruction set. portablefeature now has no effect and should be removed from crate dependencies.
- Instead, always enable BLST
- Implemented a build script that automatically detects that WASM is not targeted, and automatically activates the feature
batch-verify-aggregates(which enables batch verification of signatures).
- Added
Coreverifierstruct and its functionalities to cover signature procedure for a full node. - Adapted existing functionality to inherit from a more generic structure
Coreverifier. - Added tests for core verification.
- Included helper functions for unsafe code
- Added tests for batch verification
- Batch verification for
StmAggrSig.
- Adapted the
Signaturestruct, so that it does not contain the verification key and the stake, as these values are not required.
Initial release.