https://github.com/conduition/zkpreimage
Zero-Knowledge associated-preimage proofs.
https://github.com/conduition/zkpreimage
Last synced: about 1 year ago
JSON representation
Zero-Knowledge associated-preimage proofs.
- Host: GitHub
- URL: https://github.com/conduition/zkpreimage
- Owner: conduition
- License: unlicense
- Created: 2024-02-18T03:08:06.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-18T15:04:57.000Z (over 2 years ago)
- Last Synced: 2025-05-14T16:19:19.627Z (about 1 year ago)
- Language: Rust
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# zkpreimage
This repository is a demonstration using [the RISC0 zkVM](https://dev.risczero.com/api/zkvm) to generate a zero-knowledge key-statement proof, which asserts that for some hash $z$ and secp256k1 point $P$, the prover knows a 32-byte secret key $k$ such that:
- $SHA256(k) = z$
- $kG = P$.
This allows the prover to use bitcoin payment tools like Hash-Time Lock Contracts or the [Lightning Network](https://lightning.network) to pay for $k$. In so doing they discover the preimage of $z$, but also can be certain they will learn the discrete log of the point $P$.
This demonstrates in principle the way in which further claims about $k$ could be proven in advance of a preimage sale, such as:
- $k$ is a signature by a valid signature by a given pubkey.
- $k$ is a share in a given Shamir Secret Sharing group.
- $k$ is a valid decryption key for a certain ciphertext.
- $k$ is a solution to a given sudoku puzzle.
- etc.
This opens up a wealth of previously unexplored possibilities to effectively market the sale of secret information in a safe and secure manner.
## UNFINISHED
This repo is currently not fully functional.
## Running the Proof
To run the proof:
```
$ cargo run .
```