Skip to content

Commit 1b2ad23

Browse files
authored
Merge pull request #1 from erigontech/docs/docusaurus-migration
docs: initial migration — Docusaurus 3 site (moved from erigontech/zilkworm#8)
2 parents 9ade18c + a551da4 commit 1b2ad23

51 files changed

Lines changed: 24253 additions & 2 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Dependencies
2+
node_modules/
3+
4+
# Production build
5+
build/
6+
.docusaurus/
7+
.cache-loader/
8+
9+
# Misc
10+
.DS_Store
11+
.env.local
12+
.env.development.local
13+
.env.test.local
14+
.env.production.local
15+
16+
npm-debug.log*
17+
yarn-debug.log*
18+
yarn-error.log*

README.md

Lines changed: 100 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,100 @@
1-
# zilkworm-docs
2-
Public documentation site for zilkworm
1+
# Zilkworm Docusaurus Site
2+
3+
Source for **https://zilkworm.erigon.tech** — the public documentation for Zilkworm, built with [Docusaurus 3](https://docusaurus.io/).
4+
5+
This repo is the entire site: configuration, theme overrides, the React landing page, and the markdown content under `docs/`. The Docusaurus build emits a static site that is published via GitHub Pages.
6+
7+
## How it works
8+
9+
- **Pages**: every `.md` file under [`docs/`](docs/) becomes a page. The sidebar is autogenerated from the directory tree; ordering comes from `sidebar_position` frontmatter and `_category_.json` in each subfolder.
10+
- **Landing page**: [`src/pages/index.tsx`](src/pages/index.tsx) is a custom React page served at `/` (hero, mission pillars, capability cards, CTAs). It bypasses the markdown pipeline.
11+
- **Navbar / footer**: configured in [`docusaurus.config.ts`](docusaurus.config.ts) and the swizzled [`src/theme/Footer/index.tsx`](src/theme/Footer/index.tsx). The footer cross-links sibling sites (Cocoon, Erigon docs) per the shared design spec.
12+
- **Theme tokens**: brand colors (Erigon orange `#EF7716`), Quantify / Montserrat / Nunito Sans fonts, light + dark surfaces, navbar buttons — all in [`src/css/custom.css`](src/css/custom.css). Fonts are self-hosted under [`static/fonts/`](static/fonts/).
13+
- **Diagrams**: Mermaid is enabled (`@docusaurus/theme-mermaid`); fenced ` ```mermaid ` blocks render inline.
14+
- **Search**: client-side via `@easyops-cn/docusaurus-search-local`, indexed at build time.
15+
- **Analytics**: Plausible script is injected via `headTags` in the config.
16+
- **Custom domain**: [`static/CNAME`](static/CNAME) pins the site to `zilkworm.erigon.tech` when published from GitHub Pages.
17+
- **SEO**: Each page has `title` + `description` frontmatter that becomes `<meta name="description">` and `og:description`. Global `og:image`, Twitter card, and site metadata are set in `docusaurus.config.ts`. `sitemap.xml` is generated at build time by `@docusaurus/preset-classic`; `static/robots.txt` references it.
18+
- **LLM-friendly**: [`scripts/generate-llms.py`](scripts/generate-llms.py) walks `docs/` and writes `static/llms.txt` (page index with descriptions) and `static/llms-full.txt` (full corpus). Regenerate after any docs change:
19+
```bash
20+
python3 scripts/generate-llms.py
21+
```
22+
23+
## Render it locally
24+
25+
Requirements: **Node ≥ 20** (Docusaurus 3 requirement).
26+
27+
```bash
28+
npm install # one-time
29+
npm run start # dev server with hot reload on http://localhost:3000
30+
```
31+
32+
Other useful scripts (all defined in [`package.json`](package.json)):
33+
34+
```bash
35+
npm run build # production build into ./build (static HTML/CSS/JS)
36+
npm run serve # serve the production build locally
37+
npm run typecheck # tsc — verifies docusaurus.config.ts, sidebars.ts, components
38+
npm run clear # clear the .docusaurus cache
39+
```
40+
41+
## Authoring content
42+
43+
Add a new doc:
44+
45+
1. Create `docs/<section>/<page>.md` (or a new section with its own `_category_.json`).
46+
2. Add Docusaurus frontmatter:
47+
48+
```yaml
49+
---
50+
title: Page Title
51+
description: One-line meta description used for SEO + cards.
52+
sidebar_position: 3
53+
---
54+
```
55+
56+
3. Save — the dev server hot-reloads.
57+
58+
Notes:
59+
60+
- If the title contains a colon, **quote it** (`title: "Foo: Bar"`) — otherwise YAML parsing fails.
61+
- MDX rejects raw `<` outside code fences. Use `&lt;` or rephrase. Email/URL autolinks (`<a@b.com>`, `<https://…>`) need to be markdown links.
62+
- Inline JSX is allowed in `.md` files (Docusaurus treats them as MDX). The Welcome page (`docs/index.md`) imports the [`HomeCards`](src/components/HomeCards.tsx) component this way.
63+
64+
## Layout
65+
66+
```
67+
zilkworm-docs/
68+
├── docs/ # markdown content (sidebar autogenerated)
69+
│ ├── index.md # Welcome — served at /documentation
70+
│ ├── basics/ # _category_.json sets label + sidebar position
71+
│ ├── use-cases/
72+
│ └── testing/
73+
├── src/
74+
│ ├── pages/
75+
│ │ ├── index.tsx # custom landing at /
76+
│ │ └── index.module.css
77+
│ ├── components/
78+
│ │ ├── HomeCards.tsx # 3-card grid used on the Welcome page
79+
│ │ └── HomeCards.module.css
80+
│ ├── css/custom.css # all theme tokens (colors, fonts, buttons, etc.)
81+
│ └── theme/
82+
│ ├── Footer/index.tsx # swizzled footer (matches sibling sites)
83+
│ └── NotFound/ # swizzled 404
84+
├── static/
85+
│ ├── CNAME # zilkworm.erigon.tech
86+
│ ├── fonts/ # self-hosted woff2 — Quantify/Montserrat/NunitoSans
87+
│ └── img/ # logos, favicon, OG image
88+
├── docusaurus.config.ts # site identity, plugins, navbar, themeConfig
89+
├── sidebars.ts # autogenerated sidebar from `docs/`
90+
└── package.json
91+
```
92+
93+
## Design spec
94+
95+
This site has two source-of-truth specs in `erigontech/erigon-documents`:
96+
97+
- **[public-docs/docusaurus-design-spec.md](https://github.com/erigontech/erigon-documents/blob/master/public-docs/docusaurus-design-spec.md)** — Shared design across all Erigon docs sites (theme, fonts, footer pattern, NotFound shape, broken-link policy, gotchas). Read this first.
98+
- **[public-docs/zilkworm-docs-spec.md](https://github.com/erigontech/erigon-documents/blob/master/public-docs/zilkworm-docs-spec.md)** — Zilkworm-specific deltas: site identity, the custom React landing, MDX-conversion map from the GitBook migration, page content goals, tradenames, open questions.
99+
100+
When something visual feels ambiguous or you need to add a new chrome element (navbar button, footer column, color token), check the design spec first — it's the source of truth across all sibling sites. Anything Zilkworm-specific (content structure, page intent, the landing page, the llms generator) belongs in `zilkworm-docs-spec.md`.

docs/basics/_category_.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"label": "Basics",
3+
"position": 2,
4+
"collapsible": true,
5+
"collapsed": false
6+
}

docs/basics/background.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
title: Background
3+
description: Why Zilkworm exists — Ethereum scaling, ZK proofs, and the case for a native C++ ZKEVM core.
4+
sidebar_position: 3
5+
---
6+
7+
8+
There are several factors to take into account when thinking about the ZK future of EVMs and blockchains.
9+
10+
Firstly, today's validators on Ethereum-like chains are limited by the speed with which data can be transmitted across the network and then how fast a block can be re-executed. Verifying zero-knowledge proofs of blocks are much more efficient at achieving scaling than on the low end of the infrastructure spectrum. Following a successful rollout of this vision, consensus can progress without needing execute whole blocks. The end goal is then to provide a streamlined end to end application that can generate EVM + State Transition proofs for Ethereum or a similar blockchain.
11+
12+
Secondly, the ZK flow de-facto enables transaction privacy, as the exact nature or contents of the transactions are no longer needed to verify their correctness. This separates EVM itself from the consensus game and enables possibilities like private blockchains. This is not dissimilar to ZK-rollups themselves, but only more native to Ethereum itself with Zilkworm (and similar).
13+
14+
Thirdly, ZK prover backends have never been so performant and easy to work with. There has been an immense jump in prover performance over the past 2 years that makes real-time proving a reality today.
15+
16+
### RISC and no risk
17+
18+
Software technology cannot evolve in isolation and it thrives when the stars of various software domains align. RISC-V's open source minimal ISA has seen massive growth of interest and innovation both in interesting high-performance low-power use cases as well as with provable computation sphere.
19+
20+
The current generation of provers target minimal general purpose ISAs like RISC-V. That means existing client code and EVM code execution can be directly proved. Of course, this is a fairly new domain and it makes a ton more sense for a C++ or Rust software that has mature toolchains for this niche.
21+
22+
For zero-knowledge proofs based EVM/blockchains the proof systems and the overall stacks used to be hand-crafted before and it used to take a while. Whereas now it means feature iterations aren't dependent on heavy developer turnaround time. Additionally, existing (native compilable) projects like EVMOne fits right into become.
23+
24+
### EVM x zkVM = zkEVM
25+
26+
Zilkworm aims to make it easy to integrate different prover backends (zkVMs) that act on a similar ISA (currently only riscv32im and riscv64im). That means it integrates with prover solutions like Succinct's SP1, RISC0, Pico GPU Prover and so on.
27+
28+
Essentially, it's a stateless execution engine that takes the pre-state of a block from an existing execution trace and generates a proof of the state transition function.

docs/basics/faqs.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: FAQs
3+
description: Frequently asked questions about Zilkworm — benchmarks, team, timeline, integration plans, and prover backends.
4+
sidebar_position: 5
5+
---
6+
7+
8+
### Can we see some Benchmarks?
9+
10+
Yes, find Zilkworm's proofs by going to [EthProofs](https://ethproofs.org/)
11+
12+
We are rapidly working to publish continuous results on [EthProofs](https://ethproofs.org/) and they will be published soon.\
13+
Case by case benchmarks and Tests-Matrix would be released in a couple of weeks.
14+
15+
### Who's working on it?
16+
17+
At the moment the work is being led by Erigon developers. This is a short term "experiment" and we are looking to partner with other organisations to further the efforts. (reach out to [som@erigon.tech](mailto:som@erigon.tech) or [pawel.bylica@erigon.tech](mailto:pawel.bylica@erigon.tech) for developer queries)
18+
19+
### What are the timelines?
20+
21+
We're actively working to deliver real-time Ethereum block proofs on 2 GPUs - follow progress on [EthProofs](https://ethproofs.org/).
22+
23+
### Challenges of C++ work in a Rust world?
24+
25+
There are quite a few challenges especially with the provided gcc toolkit on a limited `rv32im` target. We have ironed out most of them. It's not easy though as there is a "first-mover" advantage of some of the prover libraries initially being written in Rust.\
26+
Having said that, RUST ↔ CPP bridge has zero bottlenecks and works perfectly within Zilkworm.
27+
28+
### Do you have it integrated in Erigon?
29+
30+
We have plans for this integration in two ways
31+
32+
* As a replacement for the current Erigon core for faster performance on x86 and ARM hardware
33+
* As a prover through JSON-RPC integration
34+
35+
We will publish such plans in a later iteration of Zilkworm
36+
37+
### Can I use Zilkworm with another Execution Layer (EL) client like Nethermind or Besu?
38+
39+
Yes, the integration into other clients for prover would be the same way - over RPC. But in order to use the core directly as an executor, it would need closer collaboration with these other EL clients.
40+
41+
### Prover Killer Performance
42+
43+
For the proof generation itself the performance of intensive crypto operation would be dictated by the underlying prover backend (for instance SP1 or RISC0 or something else). We will publish more results on it in future.
44+
45+
### Plans for integration with other zkVMs/Prover backends
46+
47+
The first rollout will have SP1 as the prover. We will rollout with others in due course of time.

docs/basics/getting-started.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
title: Getting Started
3+
description: Run the Zilkworm prover via the pre-built Docker image — setup, block fetch, dry-run execute, prove, and CUDA acceleration.
4+
sidebar_position: 1
5+
---
6+
7+
8+
### How to Run
9+
10+
At the moment the building from source requires elaborate setup with Conan, Linux packages and SP1 Turbo SDK pre-requisites. It's recommended to use the pre-built Docker image.
11+
12+
To run with pre-built Docker
13+
14+
```bash
15+
$ docker run somnergy/z6m_prover --help
16+
```
17+
18+
```text
19+
Usage: z6m_prover [OPTIONS] [COMMAND]
20+
21+
Commands:
22+
setup Run setup to generate proving and verifying keys
23+
fetch Fetch block and witness from RPC
24+
execute Execute the guest program without proving
25+
prove Generate a proof for a block
26+
verify Verify a proof using a verification key
27+
help Print this message or the help of the given subcommand(s)
28+
29+
Options:
30+
--service
31+
--rpc-url <RPC_URL>
32+
--data-dir <DATA_DIR> [default: temp]
33+
--save-all-responses
34+
--prove-every <PROVE_EVERY>
35+
--execute-every <EXECUTE_EVERY>
36+
--post-every <POST_EVERY>
37+
--start-block <START_BLOCK>
38+
--end-block <END_BLOCK>
39+
--pk-path <PK_PATH> [default: pk.bin]
40+
--proof-type <PROOF_TYPE> [default: compressed]
41+
--ethproofs-endpoint <ETHPROOFS_ENDPOINT>
42+
--ethproofs-token <ETHPROOFS_TOKEN>
43+
--ethproofs-cluster-id <ETHPROOFS_CLUSTER_ID>
44+
-h, --help
45+
```
46+
47+
#### First Fetch the block
48+
49+
```text
50+
Usage: z6m_prover fetch [OPTIONS]
51+
52+
Options:
53+
--rpc-url <RPC_URL> RPC endpoint URL
54+
--block-number <BLOCK_NUMBER> Block number to fetch
55+
--data-dir <DATA_DIR> Output directory
56+
--save-all-responses Whether to save all the json files to disk after download
57+
--build-eth-test Whether to create an ethereum/tests format json file too
58+
-h, --help Print help
59+
60+
```
61+
62+
#### Dry run execute - just use --block-number for this
63+
64+
```text
65+
Usage: z6m_prover execute [OPTIONS]
66+
67+
Options:
68+
--block-number <BLOCK_NUMBER> Block number to execute [default: 0]
69+
--file-name <FILE_NAME> Whether the input file is an Ethereum/tests file
70+
--is-test
71+
--data-dir <DATA_DIR> Data directory
72+
-h, --help Print help
73+
74+
```
75+
76+
#### Fire up the prover
77+
78+
```text
79+
Usage: z6m_prover prove [OPTIONS]
80+
Options:
81+
--block-number <BLOCK_NUMBER> JSON file to load ethereum/tests format test from [default: 0]
82+
--file-name <FILE_NAME> Whether the input file is an Ethereum/tests file
83+
--is-test
84+
--data-dir <DATA_DIR> Data directory
85+
--pk-path <PK_PATH> Proving key path [default: pk.bin]
86+
--proof-path <PROOF_PATH> Proof output path
87+
--proof-type <PROOF_TYPE> Proof type: core, compressed, groth16, plonk [default: compressed]
88+
-h, --help Print help
89+
90+
```
91+
92+
### NVIDIA CUDA Accelerated proving
93+
94+
First make sure to install NVIDIA drivers and the NVIDIA Container Toolkit https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html
95+
96+
```bash
97+
$ user@machine-with-gpu
98+
docker run --gpus all --rm --network host -v "$PWD:/work:rw" -v /var/run/docker.sock:/var/run/docker.sock -w /work -it --entrypoint bash somnergy/z6m_prover
99+
100+
root@instance-20250919-091229:/work#
101+
SP1_PROVER=cuda RUST_BACKTRACE=full RUST_LOG=info z6m_prover prove --n 1 --file-name test.json
102+
```

docs/basics/how-it-works.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: How it works
3+
description: Technical details of the Zilkworm prover.
4+
sidebar_position: 4
5+
---
6+
7+
8+
The actual code of Zilkworm acts as the guest program for a zkVM. In reality though, it's optimized for one or more provers and the minimal riscv32im ISA. The thing about integrating with a certain zkVM prover backend though is that one needs to be careful about its memory boundaries, hardware and environment limitations and provisions.
9+
10+
The zkVM internally generates an execution trace of the underlying riscv32im simulated machine and stitches the lines of execution, memory mutations and storage maps into a proof using the fabric of the constraints of each machine operation.
11+
12+
Nothing in the default pipeline actually assumes a particular proving system. The backend is a plugin. Today you might choose SP1; tomorrow you might test an alternative curve or commitment scheme. Zilkworm doesn’t change; only the witness packing and the backend library do.
13+
14+
In the following sections we will dive deeper into its details assuming the SP1-Prover backend.
15+
16+
```mermaid
17+
flowchart LR
18+
Z["Zilkworm-st"]
19+
subgraph SIM["Simulator"]
20+
RV["RISC-V<br/>(No-OS)"]
21+
end
22+
SP["SP1 Prover"]
23+
PROOF["STARK<br/>Proof"]
24+
25+
Z -->|Firmware| SIM
26+
SIM -->|Traces| SP
27+
SP --> PROOF
28+
29+
style SIM stroke-dasharray: 2 3
30+
style PROOF stroke-dasharray: 5 5
31+
```
32+
33+
### rv32im compilation
34+
35+
The target ISA such as rv32im is dictated by the underlying prover. In the description used here, SP1 backend for prover uses rv32im. This means the execution trace generation happens with a simulated CPU + memory + ROM in a bare-metal context. That is, the code for Zilkworm-state-transition function wholly runs as a "firmware" without any convenient OS system calls.
36+
37+
The target system of RV32IM means certain compiler and program constraints has to be kept in careful consideration. Thirty-two-bit integer math has predictable behavior across compilers and is friendlier to constraint systems than ad-hoc 64-bit code paths. The build uses a standard cross-compiler (riscv32-unknown-elf-g++), with flags that keep the binary small and link-time GC aggressive.
38+
39+
### Rust–C++ bridge
40+
41+
A lot of prover code lives in Rust. Zilkworm keeps the execution engine and trace generation in C++ and crosses the boundary through a narrow FFI. There are two practical ways to do this. The first uses a C-compatible ABI: the Rust crate exposes extern "C" functions that accept raw pointers and lengths, and C++ wraps those in RAII helpers. The second uses a binding layer (such as cxx) to generate type-safe shims.
42+
43+
CMake invokes cargo and links the resulting library into the Zilkworm binary. Ownership and lifetimes are spelled out: the side that allocates returns a destructor; all buffers are length-delimited; no globals leak between language runtimes.
44+
45+
### EVMone core
46+
47+
Rather than reinvent EVM semantics, Zilkworm embeds EVMone. The tracing code does not introspect EVMone internals; it observes inputs and outputs at opcode boundaries and normalizes them into records with stable layouts. This matters when you later compare traces across compilers or machines: the format is always the same, and there is no hidden bookkeeping. When precompiles are involved, Zilkworm treats them as explicit events rather than a black box. The trace records the precompile id, inputs, and outputs so the witness either contains enough to re-derive the result or delegates to a host primitive through a well-defined channel.
48+
49+
### Precompiles provided by The Prover SDK via ECALL
50+
51+
Cryptographic operations are heavy, and the RV32IM guest has no business carrying entire big-number libraries if it can avoid it. For those, Zilkworm issues an ECALL with a service id that names the primitive (for example, a Keccak permutation or a BN254 group operation). Arguments are passed as pointers and lengths into guest memory. This pattern keeps the guest compact and also keeps the trace witness small. If the backend knows the primitive, it can treat the event as a constraint.

0 commit comments

Comments
 (0)