SkillAgentSearch skills...

Sevenlayer

A Complete Guide to Zero-Knowledge Proof Systems

Install / Use

/learn @CharlesHoskinson/Sevenlayer
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

The Seven-Layer Magic Trick

A Complete Guide to Zero-Knowledge Proof Systems

Charles Hoskinson -- First Edition, March 2026


Zero-knowledge proofs let you prove a statement is true without revealing why it's true. That one sentence contains a $2 trillion industry, four decades of mathematics, and a problem that most people still can't explain to their friends.

This book tries to fix the last part.

It walks through the entire zero-knowledge stack from the ground up -- seven layers, from the trusted setup ceremony that creates the mathematical stage to the on-chain verifier that renders the final verdict. Each layer introduces a trust assumption. Each assumption is independently testable, independently replaceable, and independently breakable. The book's thesis is simple: ZK proofs don't eliminate trust. They decompose it into seven weaker pieces. That decomposition is the real trick.

What's in the book

Fourteen chapters organized in three parts:

Part I (Chapters 1-2): The magician and the audience. What ZK proofs do, why they matter now, and the first real design decision every system faces -- trusted or transparent setup.

Part II (Chapters 3-8): The craft. One chapter per layer: programming languages (and the under-constrained circuit epidemic that accounts for 67% of real-world ZK vulnerabilities), witness generation, arithmetization, proof systems, cryptographic primitives, and on-chain verification. The technical core of the book.

Part III (Chapters 9-14): Synthesis. Privacy-enhancing technologies beyond ZKPs, a full trust decomposition with seven failure scenarios, a zkVM landscape comparison, a Midnight case study, market analysis across six segments, and seven open research questions.

The book includes a running example (a 4x4 Sudoku proof) that threads from program to witness to constraints to sealed certificate, so the reader can follow one computation through every layer.

Reading paths

45 minutes (executive). Chapters 1, 2 (opening), 8 (opening), the Chapter 11 landscape table, and Chapter 14.

2 hours (engineer). All of Parts I and II, plus Chapters 10 and 13.

4+ hours (researcher). Everything, including the seven open questions in Chapter 14.

Don't skip Chapter 2 (setup) or Chapter 10 (trust decomposition). They are the load-bearing walls.

Formats

| File | What it is | |------|-----------| | the-seven-layer-magic-trick.md | The full manuscript in Markdown (~5,280 lines) | | the-seven-layer-magic-trick.pdf | Pre-built PDF with Midnight dark-mode branding | | the-seven-layer-magic-trick.tex | Intermediate LaTeX generated by Pandoc |

The PDF is designed for screen reading -- dark backgrounds, Outfit headings, STIX Two Text body, blue-to-purple gradient accents, custom syntax highlighting. It is not optimized for printing.

Building the PDF from source

Requirements: Python 3.10+, Pandoc 3.6+, XeLaTeX (MiKTeX or TeX Live). The Outfit font is bundled in assets/.

git clone https://github.com/CharlesHoskinson/sevenlayer.git
cd sevenlayer
python build_pdf.py

The build pipeline:

  1. Pandoc converts the Markdown to standalone LaTeX with the custom preamble, title page, Lua filter, and syntax theme
  2. A Python post-processor patches table headers for dark-mode styling
  3. XeLaTeX compiles in two passes (for TOC and cross-references)

Output: the-seven-layer-magic-trick.pdf

Build files

| File | Role | |------|------| | preamble.tex | Midnight dark-mode design system: colors, fonts, headings, boxes, tables | | titlepage.tex | Branded cover page with gradient rules | | box-filter.lua | Pandoc filter for part dividers, epigraphs, styled boxes, HR suppression | | assets/midnight-syntax.theme | Custom Pandoc syntax highlighting (8 semantic colors, WCAG AA+) | | assets/Outfit-*.ttf | Outfit font (Regular, Medium, SemiBold, Bold) | | assets/midnight-logo.* | Midnight Network logo (SVG + PDF) | | build_pdf.py | Build entry point | | src/zkbook_pdf/ | Python package: CLI, Pandoc invocation, LaTeX patching, validation |

License

This work is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).

You are free to share and adapt this material for any purpose, including commercial use, as long as you give appropriate credit.

Author

Charles Hoskinson

View on GitHub
GitHub Stars48
CategoryDevelopment
Updated2h ago
Forks7

Languages

TeX

Security Score

75/100

Audited on Mar 29, 2026

No findings