IntersectMBO / IntersectMBO/mithril
Refactoring and enhancements for SNARK-friendly STM
- Dominant language
- Rust
- Stars
- 154
- Forks
- 51
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 38
Description
## Why
The STM library has accumulated structural debt as SNARK support was introduced alongside the existing concatenation proof system.
## What
Perform targeted refactorings and enhancements across the STM library to improve separation of concerns, test efficiency, API readiness for SNARK signing, and overall code hygiene.
## How
## Current iteration
- [ ] Better RNG support for RNG in STM protocol signer (https://github.com/input-output-hk/mithril/blob/main/mithril-stm/src/protocol/participant/signer.rs#L61-L62)
## Following iteration
- [ ] Enhance error handling with Midnight zk library (need new version of Midnight zk released)
- [ ] Refactor `RegistrationEntry` into struct with fields
- [ ] Refactoring `ClosedRegistrationEntry` (To avoid having double options for vk and stake/lottery target value, use a `ClosedRegistrationEntryForConcatenation` and a `Option`)
- [ ] Refactor tests for CPU/circuit compatibility (Create a dedicated module for CPU/non-recursive circuit compatibility tests)
## Later
- [ ] Get rid of Options for SNARK verification keys and signatures
- [ ] Optimize computation of Lottery Target Value with [Binomial Series](https://en.wikipedia.org/wiki/Binomial_series)?
> (1-phi_f)^w = 1 - w * phi_f + w(w-1) * (phi_f^2) / 2! - w(w-1)(w-2) * (phi_f^3) / 3! + ...
Contributor guide
Assessment
This issue has not been assessed yet.