mirror of
https://github.com/saymrwulf/proof-aware-crypto-tooling-agent.git
synced 2026-09-03 19:53:43 +00:00
The notebooks now carry the same didactic contract as the companion book
(the "ratchet rule", stated in the course map): every load-bearing idea
runs twice - napkin scale, then real scale - and every pair is EXECUTABLE
in the notebook, not narrated.
- Lecture 1: the truth boundary updated to the proven four-tier apex,
with the what-is-still-NOT-proven list (SHA-512, parsers, signing,
wallets) given equal weight.
- Lecture 2: napkin/real scoring pair - a two-certificate toy card
scored in your head, then the shipped sixteen-certificate R4 fixture
through the same function, residual blockers and per-tier boundary
axioms printed.
- Lecture 6: new split-view section. A runnable equivocation drill:
pin a two-leaf view, grow it honestly with a consistency proof, then
present a forged same-size root and watch the pin store name the
attack. Real-scale pointers to --sth-store, log-consistency,
log-audit, and the freshness policy; a new exercise asks students to
construct the lie a size-only anchor check would miss.
- Lecture 7: the wallet gate now swings BOTH ways on real evidence -
a partial card denied at R3, the shipped R4 card allowed - both
runnable.
- Lecture 8 capstone: "design R4" became "audit R4": read the shipped
card like an auditor, then design the R5 discharge plan (parser
specs, verified SHA-512, signing-side, per-fork production-path
mapping).
- NEW Lecture 9, "Eat Your Own Dogfood": the honest coverage ledger of
the proven-path verifier; a napkin PEM decode (the fixed 12-byte
Ed25519 SPKI prefix, read with your eyes) paired with the mechanical
extraction; live backend dispatch; the fail-closed
--require-verified-verifier policy; and the hybrid-PQC section -
proven-classical Ed25519 plus a required-but-honest ML-DSA slot
("blockers get fixed; placeholders get trusted").
Every code cell of the changed notebooks was executed end-to-end before
committing (outputs stripped per house rules). 49/49 tests green with
the notebook inventory updated.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
159 lines
7.1 KiB
Text
159 lines
7.1 KiB
Text
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"# PACTA Curriculum: From Zero to Hero\n",
|
|
"\n",
|
|
"This curriculum teaches proof-aware cryptographic tooling from first principles to a research-grade professional workflow. It is designed for undergraduate students who know some programming and discrete math, but have not yet worked with formal verification, Lean, certificate transparency, or autonomous-agent risk gates.\n",
|
|
"\n",
|
|
"The practical anchor is PACTA: Proof-Aware Crypto Tooling Agent. The goal is not to build a trading bot. The goal is to teach an agent, and the engineer supervising it, to ask:\n",
|
|
"\n",
|
|
"> Does this theorem cover the exact code path that will protect funds?\n",
|
|
"\n",
|
|
"The course takes that question seriously. Every notebook connects theory to a runnable artifact in this repository.\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Learning Objectives\n",
|
|
"\n",
|
|
"By the end of the sequence, a strong student should be able to:\n",
|
|
"\n",
|
|
"- Explain why cryptographic implementation proofs have theorem boundaries.\n",
|
|
"- Distinguish formal proof evidence from tests, audits, marketing claims, and operational controls.\n",
|
|
"- Read a PACTA claim card and understand its guarantees, preconditions, exclusions, trusted base, and risk level.\n",
|
|
"- Reproduce a local Lean replay or diagnose why local replay is unavailable.\n",
|
|
"- Perform a proof hygiene scan and explain why `sorry`, local axioms, and trivial theorem targets are dangerous.\n",
|
|
"- Explain how a third-party proof-checking provider changes the trusted base.\n",
|
|
"- Implement and verify RFC 9162-style Merkle inclusion and consistency proofs.\n",
|
|
"- Explain why Signed Tree Heads need accountable signatures, why Ed25519 is useful here, and why ML-DSA requires a real backend.\n",
|
|
"- Design policy gates that convert verification evidence into consequences.\n",
|
|
"- Read R4 four-tier apex evidence, name its residual blockers, and write a research plan toward R5 production assurance.\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Prerequisites\n",
|
|
"\n",
|
|
"Recommended background:\n",
|
|
"\n",
|
|
"- Python basics: functions, dictionaries, lists, files, subprocesses.\n",
|
|
"- Discrete math: modular arithmetic, induction, trees, hashes.\n",
|
|
"- Basic cryptography vocabulary: public keys, signatures, hashes, finite fields.\n",
|
|
"- Basic command-line usage on macOS or Linux.\n",
|
|
"\n",
|
|
"Not required at the start:\n",
|
|
"\n",
|
|
"- Lean.\n",
|
|
"- Rust internals.\n",
|
|
"- Elliptic curve implementation expertise.\n",
|
|
"- Certificate transparency expertise.\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"from pathlib import Path\n",
|
|
"import sys\n",
|
|
"\n",
|
|
"repo_root = Path.cwd()\n",
|
|
"if not (repo_root / \"src\" / \"pacta\").exists():\n",
|
|
" repo_root = repo_root.parent\n",
|
|
"sys.path.insert(0, str(repo_root / \"src\"))\n",
|
|
"\n",
|
|
"print(repo_root)\n",
|
|
"print((repo_root / \"README.md\").exists())\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Course Map\n",
|
|
"\n",
|
|
"1. `01_threat_model_and_truth_boundary.ipynb`\n",
|
|
" Learn the product problem, the security boundary, and the difference between verified arithmetic and verified wallets.\n",
|
|
"\n",
|
|
"2. `02_claim_cards_and_risk_model.ipynb`\n",
|
|
" Study PACTA claim cards, risk levels R0-R5, and how claim serialization supports machine decisions.\n",
|
|
"\n",
|
|
"3. `03_lean_replay_and_axiom_audit.ipynb`\n",
|
|
" Learn how local Lean replay works, why PACTA avoids transpilation, and what an axiom audit proves.\n",
|
|
"\n",
|
|
"4. `04_proof_hygiene_and_boundaries.ipynb`\n",
|
|
" Learn to scan proof artifacts for `sorry`, local `axiom`, trivial theorem statements, and missing manifest coverage.\n",
|
|
"\n",
|
|
"5. `05_third_party_attestation_provider.ipynb`\n",
|
|
" Learn how a proof-checking service can transform hard local verification into provider trust.\n",
|
|
"\n",
|
|
"6. `06_merkle_transparency_logs.ipynb`\n",
|
|
" Build the Merkle accumulator intuition behind inclusion proofs, consistency proofs, and Signed Tree Heads.\n",
|
|
"\n",
|
|
"7. `07_agent_consequences.ipynb`\n",
|
|
" Connect evidence to action: build a lower-layer Rust capsule only when policy gates pass.\n",
|
|
"\n",
|
|
"8. `08_capstone_research_program.ipynb`\n",
|
|
" Design a PhD-level roadmap for closing the gaps from R4 toward R5.\n",
|
|
"\n",
|
|
"9. `09_dogfood_verified_crypto.ipynb`\n",
|
|
"\n",
|
|
" Eat your own dogfood: run the agent's own signature checks through the proven code path, and hold the post-quantum line honestly.\n",
|
|
"\n",
|
|
"## The Ratchet Rule\n",
|
|
"\n",
|
|
"This course follows the same didactic contract as its companion book (*Verifying Cryptography with Lean 4*): **every load-bearing idea is worked at least twice** - once at napkin scale (trees of three leaves, toy claim cards you can score in your head) and once at real scale (the shipped R4 claim cards, real receipts, the real proven-path verifier), with nothing hidden in between. The napkin run teaches the moves; the real-size run proves the moves are the whole story. If a step ever feels like a leap, back up one cell: the smaller rung is there.\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Assessment Model\n",
|
|
"\n",
|
|
"Each notebook contains:\n",
|
|
"\n",
|
|
"- A lecture section for concepts.\n",
|
|
"- A lab section with runnable code.\n",
|
|
"- Checkpoints that force precise answers.\n",
|
|
"- Exercises for mastery.\n",
|
|
"- Research prompts for advanced students.\n",
|
|
"\n",
|
|
"The capstone asks students to produce a defensible assurance case, not a slogan.\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## References\n",
|
|
"\n",
|
|
"- RFC 9162, Certificate Transparency Version 2.0: https://datatracker.ietf.org/doc/html/rfc9162\n",
|
|
"- RFC 8032, Edwards-Curve Digital Signature Algorithm: https://datatracker.ietf.org/doc/html/rfc8032\n",
|
|
"- NIST FIPS 204, Module-Lattice-Based Digital Signature Standard: https://csrc.nist.gov/pubs/fips/204/final\n",
|
|
"- PACTA README: `../README.md`\n"
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "Python 3",
|
|
"language": "python",
|
|
"name": "python3"
|
|
},
|
|
"language_info": {
|
|
"name": "python",
|
|
"pygments_lexer": "ipython3"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 5
|
|
}
|