-
Notifications
You must be signed in to change notification settings - Fork 8
docs(site): IA restructure — Diátaxis sidebar, split pages, new explainers #1909
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
8eade32
docs(site): IA restructure — Diátaxis sidebar, split pages, new expla…
f2cc710
docs(site): remove research log
892197a
docs(site): aggressive pruning — Da Vinci/Saint-Exupéry pass
bf9c08f
docs(site): tighten accuracy against source — Vault, ERC721, full Con…
947cc87
docs(site): macro features cross-link + rewritten llms.txt
7d4684a
docs(site): unify "six persistent storage spaces" across architecture…
a949fa9
docs(site): use canonical lfglabs-dev/verity-benchmark URL
db26580
docs(site): fix wrong code in solidity-to-verity walkthrough
39bba4a
docs(site): fill in missing guide frontmatter, fix See-also titles
cb44c0d
docs(site): rename core.mdx spec-helpers section to stable anchor
540d9a0
docs(site): update CryptoHash path — it moved from Verity/Examples/ t…
0a11804
docs(site): modernize examples to verity_contract macro syntax
53993cd
docs(site): modernize Ledger and SimpleToken examples to verity_contr…
b0fd970
docs(site): correct trust-model — zero project-level Lean axioms
e2ee20c
docs(site): align faq + llms.txt with the zero-Lean-axioms reality
d4f0a1c
docs(site): complete the --deny-* flag inventory
012bd52
docs(site): add --deny-unsafe catch-all to the deny table
1d86cd4
docs(site): restore CI-required boundary phrases after the prune
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,12 +1,26 @@ | ||
| export default { | ||
| index: 'Home', | ||
|
|
||
| '-- introduction': { type: 'separator', title: 'Introduction' }, | ||
| architecture: 'Architecture Overview', | ||
| 'trust-model': 'Trust Model', | ||
|
|
||
| '-- tutorials': { type: 'separator', title: 'Tutorials' }, | ||
| 'getting-started': 'Getting Started', | ||
| examples: 'Example Contracts', | ||
| core: 'Core Architecture', | ||
| 'edsl-api-reference': 'EDSL API Reference', | ||
| 'first-contract': 'Your First Contract', | ||
|
|
||
| '-- howto': { type: 'separator', title: 'How-To Guides' }, | ||
| guides: 'Guides', | ||
| 'add-contract': 'Add a Contract', | ||
| compiler: 'Compiler', | ||
| verification: 'Formal Verification', | ||
| research: 'Research', | ||
|
|
||
| '-- reference': { type: 'separator', title: 'Reference' }, | ||
| examples: 'Examples Gallery', | ||
| core: 'Core', | ||
| 'edsl-api-reference': 'EDSL API', | ||
| compiler: 'Compiler & CLI', | ||
| verification: 'Verification Status', | ||
| glossary: 'Glossary', | ||
|
|
||
| '-- explanation': { type: 'separator', title: 'Explanation' }, | ||
| 'proof-techniques': 'Proof Techniques', | ||
| faq: 'FAQ', | ||
|
cursor[bot] marked this conversation as resolved.
|
||
| }; | ||
This file contains hidden or 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,90 @@ | ||
| --- | ||
| title: Architecture Overview | ||
| description: A single-page map of the Verity system, from EDSL source down to EVM bytecode. | ||
| --- | ||
|
|
||
| # Architecture Overview | ||
|
|
||
| Verity is a Lean-4 embedded DSL for writing smart contracts that compile to EVM | ||
| bytecode and come with machine-checked correctness proofs. Each layer of the | ||
| system has a specific responsibility: the **EDSL** is where humans write | ||
| contracts and theorems; the **CompilationModel** is the declarative typed | ||
| specification the compiler consumes; the **IR** is the intermediate form the | ||
| proofs target; **Yul** is the textual EVM dialect emitted to disk; and the | ||
| deployable **EVM** bytecode is produced by `solc` from Yul. Every transition is | ||
| either proved in Lean or recorded as an explicit assumption in the trust report. | ||
|
|
||
| ## Pipeline | ||
|
|
||
| ``` | ||
| EDSL --> CompilationModel --> IR --> Yul --> EVM | ||
| ``` | ||
|
|
||
| **EDSL.** The source layer. Contracts are written using `verity_contract` (or | ||
| the lower-level `Contract` monad) against `Verity/Core.lean`. Specs, invariants, | ||
| and proofs live next to the implementation in `Contracts/<Name>/`. Read by the | ||
| human author; consumed by the elaborator to build a `CompilationModel`. Layer 1 | ||
| proves the EDSL implementation refines its `CompilationModel`. | ||
|
|
||
| **CompilationModel.** The declarative typed-IR layer (`Compiler/CompilationModel.lean`). | ||
| A `CompilationModel` carries fields, events, errors, the constructor, function | ||
| bodies as `Expr`/`Stmt`, externals, and local obligations. Written by the | ||
| compiler (or by hand for legacy specs); read by the IR generator. Layer 2 | ||
| proves that the IR generated from any `CompilationModel` in the supported | ||
| fragment preserves its semantics. | ||
|
|
||
| **IR.** The typed intermediate representation that sits between | ||
| `CompilationModel` and Yul (`Compiler/Proofs/IRGeneration/`). Generated | ||
| automatically; read by the Yul code generator and by the Layer 2 / Layer 3 | ||
| proofs. The end-to-end correctness theorem is stated at this level. | ||
|
|
||
| **Yul.** The textual EVM dialect emitted by `Compiler/Codegen.lean` and the Yul | ||
| pretty-printer in `Compiler/Yul/*.lean`. Written to `artifacts/yul/*.yul`; read | ||
| by `solc --strict-assembly`. Layer 3 proves IR-to-Yul preservation. | ||
|
|
||
| **EVM.** The final deployable bytecode. Produced by `solc` from Yul; deployed by | ||
| `forge create` or any standard toolchain. Not in the proof envelope: `solc`, | ||
| the EVM spec, and the deployment pipeline are explicit trust assumptions. | ||
|
|
||
| ## Source layer (EDSL) | ||
|
|
||
| The EDSL is intentionally small. `Verity/Core.lean` provides `ContractState`, | ||
| `ContractResult` (the success/revert algebra), the `Contract` monad with | ||
| short-circuiting `bind`, six persistent storage spaces (uint256, address, | ||
| address-keyed mapping, uint256-keyed mapping, double mapping, dynamic arrays) | ||
| plus EIP-1153 transient storage, `require`, and a curated set of `@[simp]` | ||
| lemmas for proof automation. The `verity_contract` macro lowers | ||
| human-friendly syntax to both an executable Lean definition and a | ||
| `CompilationModel`, keeping the two in sync. See [`/edsl-api-reference`](/edsl-api-reference) | ||
| for the full surface and [`/first-contract`](/first-contract) for a guided walkthrough. | ||
|
|
||
| ## Pipeline (CompilationModel → Yul) | ||
|
|
||
| The compiler runs a fixed sequence per contract: storage-slot inference, | ||
| selector lookup, IR generation, Yul AST construction, and pretty-printing. The | ||
| same binary emits machine-readable audit artifacts: `--trust-report`, | ||
| `--assumption-report`, `--layout-report`, and `--layout-compat-report`. The | ||
| linker (`Compiler/Linker.lean`) splices external Yul libraries (`--link`) into | ||
| the runtime section after validating that every non-builtin call site is | ||
| satisfied. See [`/compiler`](/compiler) for the pipeline narrative and CLI reference. | ||
|
|
||
| ## Verification layers (1 / 2 / 3) | ||
|
|
||
| Verity organizes its correctness story in three layers. **Layer 1** is the | ||
| frontend bridge: an EDSL implementation is proven equivalent to its | ||
| `CompilationModel`. **Layer 2** is the compiler middle: a generic | ||
| whole-contract theorem in `Compiler/Proofs/IRGeneration/Contract.lean` proves | ||
| that `CompilationModel.compile` produces IR with matching semantics for the | ||
| current supported fragment. **Layer 3** is the backend: `IR → Yul` preserves | ||
| semantics, with the dispatcher bridge exposed as an explicit hypothesis rather | ||
| than a Lean axiom. See [`/trust-model`](/trust-model) for what is verified and | ||
| what is trusted at each layer, and [`/verification`](/verification) for the | ||
| live theorem inventory. | ||
|
|
||
| ## Where to next | ||
|
|
||
| - [Getting Started](/getting-started) — local setup and your first verification run. | ||
| - [First Contract](/first-contract) — guided spec-to-proof walkthrough. | ||
| - [Compiler & CLI](/compiler) — the pipeline in detail, plus CLI flags. | ||
| - [Trust Model](/trust-model) — what you trust when you trust a Verity contract. | ||
| - [EDSL API Reference](/edsl-api-reference) — canonical primitive reference. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.