-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Improve documentation
- Loading branch information
Showing
29 changed files
with
686 additions
and
349 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Documentation | ||
|
||
## Generating Zisk documentation | ||
The Zisk project is documented to help users and developers. | ||
|
||
In order to generate the Zisk documentation, execute the cargo doc command. We recommend using the | ||
`--no-deps` flag to avoid generating documentation for all its external dependencies. | ||
|
||
```sh | ||
$ cargo doc --no-deps | ||
``` | ||
|
||
This will generate a set of HTML files under the `target/doc` diretory. | ||
|
||
## Viewing Zisk documentation | ||
|
||
The Zisk documentation can be visualized using a web browser and navigating to | ||
`target/doc/cargo_zisk/`. | ||
|
||
If you are working with Zisk in a remote server (typical setup during development) then first you | ||
must export the local files through HTTP, for example using an HTTP proxy: | ||
|
||
```sh | ||
$ python3 -m http.server --bind 0.0.0.0 8000 | ||
``` | ||
|
||
Now, you can browse to the server: | ||
|
||
http://<IP>:8000/target/doc/cargo_zisk/ | ||
|
||
## Adding content | ||
|
||
Some basic hints: | ||
* Only public modules and public elements will appear in the cargo documentation | ||
* In particular, remember to make documented modules public in lib.rs (`pub mod <module>;`) | ||
* Documentation for a public module must start in the first line in the module file, starting with | ||
`//! ...` | ||
* Documentation for a public element must be placed right before it, starting with `/// ...` | ||
* Wrap code with triple spike: `//! \`\`\`` | ||
* To avoid cargo doc to compile the code, use ignore after the priple spike: `//! \`\`\` ignore` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,80 @@ | ||
mod elf2rom; | ||
mod inst_context; | ||
mod mem; | ||
mod mem_section; | ||
mod riscv2zisk; | ||
//! # Zero-Knowledge Proving | ||
//! | ||
//! * Proving a program execution using zero-knowledge has the following phases: | ||
//! * Witness Computation | ||
//! * Executes the program | ||
//! * Plans the number and size of the secondary state machines instances required to contain | ||
//! all the operations | ||
//! * Generates field element traces of the execution for all the required state machine | ||
//! instances | ||
//! * Proof Generation | ||
//! * Generates individual proofs for every state machine instance | ||
//! * Aggregates individual proofs into aggregated proofs, recursively | ||
//! * Generates final proof | ||
//! * Proof Verification | ||
//! * Authenticates the final proof | ||
//! | ||
//! # Proof Delegation | ||
//! | ||
//! * The Zisk main state machine processes the input data using the Zisk program and generates the | ||
//! output data. | ||
//! * This process performs some simple operations that can be proven by the main state machine | ||
//! itself, and also some more complex operations that must be delegated to other specialized | ||
//! state machines that can prove them more efficiently. | ||
//! * These secondary state machines can be composed of several inner state machines that are more | ||
//! specialized in proving some specific operations, again for efficiency reasons. | ||
//! * The proof delegation between the different state machines requires that the client state | ||
//! machines provide the required data to the server state machines to proof their operations. | ||
//! * The required data depends on the type of proof delegation. | ||
//! * Some secondary machines that are made of several, more specialized state machines, include a | ||
//! state machine proxy to dispatch incoming required data and distribute it among the rest. | ||
//! * The executor is the component in charge of calling the different state machines, in the right | ||
//! order, collecting the required data from ones and providing it to the others, parallelizing | ||
//! when possible. | ||
//! * In order to parallelize this process as much and as soon as possible, a first execution of the | ||
//! program is done, collecting the minimum trace required to split the execution in smaller parts | ||
//! that can be re-executed again in parallel, and this time generating more information that will | ||
//! feed the secondary state machines. | ||
//! | ||
//! # State machines map | ||
//! | ||
//! * Main | ||
//! * Binary Proxy | ||
//! * Binary Basic --> Binary Basic Table | ||
//! * Binary Extension --> Binary Extension Table | ||
//! * Rom | ||
//! * Arith | ||
//! * Memory Proxy | ||
//! * Memory Aligned | ||
//! * Memory Unaligned | ||
//! * Memory Input | ||
//! | ||
//! The zisk_core crate contains basic structures and functionality used by several other modules: | ||
//! opcodes, instructions and transpilation | ||
pub mod elf2rom; | ||
pub mod inst_context; | ||
pub mod mem; | ||
pub mod riscv2zisk; | ||
pub mod riscv2zisk_context; | ||
mod utils; | ||
mod zisk_definitions; | ||
mod zisk_inst; | ||
mod zisk_inst_builder; | ||
mod zisk_required_operation; | ||
mod zisk_rom; | ||
mod zv2zisk; | ||
pub mod zisk_definitions; | ||
pub mod zisk_inst; | ||
pub mod zisk_inst_builder; | ||
pub mod zisk_registers; | ||
pub mod zisk_required_operation; | ||
pub mod zisk_rom; | ||
|
||
pub mod zisk_ops; | ||
|
||
pub use elf2rom::*; | ||
pub use inst_context::*; | ||
pub use mem::*; | ||
pub use mem_section::*; | ||
pub use riscv2zisk::*; | ||
pub use riscv2zisk_context::*; | ||
pub use utils::*; | ||
pub use zisk_definitions::*; | ||
pub use zisk_inst::*; | ||
pub use zisk_inst_builder::*; | ||
pub use zisk_registers::*; | ||
pub use zisk_required_operation::*; | ||
pub use zisk_rom::*; | ||
pub use zv2zisk::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.