Expand description
Time-lock puzzle payloads using Rivest iterated squaring.
A payload is encrypted with a key that can only be derived by performing
T sequential modular squarings. This cannot be parallelised, providing
practical (but not absolute) time-locking.
Security note: a well-resourced adversary with faster hardware can solve the puzzle earlier. This scheme provides practical but not cryptographic time-binding.
Functionsยง
- create_
puzzle - Create a time-lock puzzle for the given payload.
- default_
squarings_ per_ sec - Returns the default squarings-per-second calibration constant.
- solve_
puzzle - Solve a time-lock puzzle by performing sequential squarings and decrypting.
- try_
solve_ puzzle - Non-blocking puzzle check. Returns
Ok(Some(payload))if solvable within a very short time budget,Ok(None)otherwise.