Educational tool. Proving the shortest path through a maze with recursive SNARKs.
NOTE: Updating the README after wrapping up another project this week. If you want to look around before then, all the magic happens in nova/src/main.rs
and nova/circom/traversal.circom
. Hopefully wrote everything so it's easy to follow. Also note that if you clone this repo to run, you have to clone my fork of nova-snark
and nova-scotia
in the parent directory (mainly made a few structs public to dissect).
Meant for learning more about recent proving systems- Nova and Plonky2 in particular- for recursive SNARKs. Verifying shortest paths found via Dijsktra's Algorithm. Ideal for focusing on the basic SNARK mechanics since maze traversal is a familiar problem that doesn't involve many constraint-heavy operations.
Why Dijkstra's insead of a simpler DFS? Because Zijkstra is catchier than Maze Zolver of course.
PUBLIC INPUTS
- H(grid): Hash of the grid / maze
- L1: Location before stepping
- C1: Cost accrued to get to the location
PUBLIC OUTPUTS (symmetric, same as public inputs)
- H(grid): Hash of the same grid / maze
- L2: Location after stepping
- C2: Cost accrued + additional cost for moving to location
PRIVATE INPUTS
- A: Grid that is traversed
- m: Move for this step [dRow, dCol]
LOGIC
- Checks that the proposed move is valid
- Updates location and accrued cost