Please check the build logs for more information.

See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.

If you believe this is docs.rs' fault, open an issue.

# OpenZKP Stark

OpenZKP implementation of STARK zero-knowledge-proofs.

STARKs are a family of protocols developed by Eli Ben-Sasson, Michael Riabzev, Lior Goldberg, et al. and Starkware Ltd. The particular Stark protocol variant implemented is (an approximation of) the one used in Starkdex alpha. This Stark protocol has the optimizations described in the "StarkDEX deep dive" part III (see references).

## Example

```
use ;
```

In the `/examples`

folder there are further examples:

`small_fib`

and`large_fib`

.`mimc_cubic`

by Guild of Weavers (source).`mimc_quadratic`

by Guild of Weavers (source).`vdf`

by Matter Labs (source).`pedersen_merkle`

by Starkware.

## Features and Limitations

### Features

**A simple interface.** The public interface is simple and is considered semver-stable. Future versions are expected to add functionality without breaking this interface.

**Succinct proofs.** For a given security parameter, the proof size is close to minimal. Significant improvements here would require innovations in the way constraint systems are designed or in the underlying cryptography.

**Decent performance.** All steps of the proof are using asymptotically optimal algorithms and all of the major steps are multi-threaded. There are no hard memory requirements. We can expect a good amount of performance improvements by fine-tuning, but we don't expect orders of magnitude improvements.

**Webassembly support.** The verifier can be used in a WebAssembly environment without the Rust `std`

lib. The prover will work too, but has not been a priority.

### Limitations

**No high-level language.** Constraints are specified using their algebraic expressions. This requires complicated and careful design from the library user and is easy to do wrong, leading to insecure systems. A high level language would help make development simpler and safer and facilitate re-use of components.

**No comprehensive security audit.** While development is done with the best security practices in mind, it is still very early stage and has not had the amount of expert peer review required for a production grade system.

**No perfect zero-knowledge.** The current implementation provides succinct proofs but not perfect zero knowledge. While non-trivial, it is theoretically possible to learn something about the secret. Achieving perfect zero-knowledge is possible and can be implemented.

**No side-channel resistance.** The implementation favours performance over side-channel resistance. While this is common in zero-knowledge proof system, you should be aware that his might leak intermediate computations. Side-channel resistance can be implemented.

**Hard-coded field and hash.** The current implementation uses a particular prime field and a particular hash function. These are optimized for verification in the Ethereum Virtual Machine. This can be generalized to other primitives optimized for other use cases.

## References

- Eli Ben-Sasson, Iddo Bentov, Ynon Horesh, Michael Riabzev (2018). "Fast Reed-Solomon Interactive Oracle Proofs of Proximity". eccc.weizmann.ac.il
- Eli Ben-Sasson and Iddo Bentov and Yinon Horesh and Michael Riabzev (2018). "Scalable, transparent, and post-quantum secure computational integrity". eprint.iacr.org
- Eli Ben-Sasson, Lior Goldberg, Swastik Kopparty, Shubhangi Saraf (2019). "DEEP-FRI: Sampling outside the box improves soundness". arxiv.org
- Starkware's stark math and starkdex series.
- Starkware's Starkdex verifier contracts.
- Resource overviews by Starkware and Matter Labs

## Related projects

- Hodor by Matter Labs.
- genSTARK by Guild of Weavers.
- libSTARK by Ben-Sasson et al.
- stark by Computable Labs.
- mimc_stark by Vitalik Buterin.