air-cryptographer
This skill should be used when the user asks about "AIR", "algebraic intermediate representation", "ZK constraints", "trace design", "constraint soundness", "polynomial commitments", "FRI", "STARK", "lookup arguments", "permutation arguments", "memory consistency", "transition constraints", "boundary constraints", "vanishing polynomial", "quotient polynomial", "Fiat-Shamir", or needs expert-level cryptographic review of constraint systems.
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o air-cryptographer.zip https://jpskill.com/download/17927.zip && unzip -o air-cryptographer.zip && rm air-cryptographer.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/17927.zip -OutFile "$d\air-cryptographer.zip"; Expand-Archive "$d\air-cryptographer.zip" -DestinationPath $d -Force; ri "$d\air-cryptographer.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
air-cryptographer.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
air-cryptographerフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 2
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
AIR Cryptographer の専門知識
ゼロ知識証明システムにおける Algebraic Intermediate Representations (AIRs) の設計、実装、監査に関する専門家レベルの知識。
コアとなる考え方
健全性第一の思考: すべての制約レビューは「不正者がどのようにして抜け道を見つけるか?」から始めます。敵対的に考えましょう。手作業で反例トレースを構築します。多項式恒等式の抜け穴を悪用します。
代数的精度: 制約は有限体上の解空間を定義します。制約の欠落は単なるバグではなく、悪意のある証明者にとっての自由度が増すことになります。
有限体の基礎
不可欠な直感:
- 特性と逆元: すべての非ゼロ要素は乗法逆元を持ちます。ゼロ除数はありません。
- 1 の根: 位数 2^k の乗法的部分群は、FFT に適した評価領域を可能にします。
- 拡大体: より多くの代数的構造が必要な場合 (例: Stwo のための M31 → QM31)。
- フロベニウス自己準同型: 写像 x → x^p は体線形です。拡大体演算に不可欠です。
多項式のメカニズム
補間: n 個の点が与えられたとき、次数 < n の一意な多項式がそれらの点を通過します。ラグランジュ基底はこれを明示的にします。
消滅多項式: h ∈ H に対して Z_H(x) = ∏(x - h) は、ドメイン H 上でのみ消滅します。これは制約の強制の基礎です。
次数の振る舞い:
- 乗算: deg(f·g) = deg(f) + deg(g)
- 合成: deg(f∘g) = deg(f) · deg(g)
- 低次テストは、関数が「低次多項式に近い」ことを検証します。
評価ドメイン: 分離のための乗法コセット。ブローアップファクターは、トレース次数とドメインサイズ間のセキュリティマージンを決定します。
トレース設計の原則
列の分類
| タイプ | 定義 | 例 |
|---|---|---|
| 真実の源 | 標準的な証拠データ | PC、レジスタ、メモリの値 |
| 派生 | ソース列から計算 | フラグ、分解 |
| 補助 | 次数を減らすために追加 | 中間積 |
重要なルール: すべての列は制約されなければなりません。制約されていない列は、証明者にとっての自由変数です。
行のセマンティクス
各行が何を表すかを正確に定義します。
- CPU サイクル / 命令
- メモリ操作
- パディング (区別可能でなければなりません!)
行タイプにはセレクターが必要です。セレクターは次の条件を満たす必要があります。
- ブール値:
s(s-1) = 0 - 相互排他的:
Σ s_i = 1(またはカバレッジ証明) - 実際に制約されている (単に文書化されているだけではない)
最小限の列 vs 冗長な列
最小限から始めます。補助列は、次の場合にのみ追加します。
- 次数削減が必要な場合
- 健全性を確保するために明示的な中間値が必要な場合
- 検証コストが支配的な場合
制約のカテゴリ
遷移制約 (ローカル)
行 i と行 i+1 の間の正しいステップ関係を表現します。
next_pc = pc + instruction_size (分岐していない場合)
next_register[k] = f(current_state, opcode)
危険: 関数ではなく関係を書くこと。複数の有効な次の状態 = 不健全。
境界制約
特定の行を特定の値に固定します。
- 初期: 行 0 の状態が予想される開始と一致
- 最終: 最後の行が終了条件を満たす
- I/O: 公開入力/出力が既知の位置にバインドされる
危険: 「最後の行」は一意に定義されている必要があります。可変長のトレースには、明示的な停止処理が必要です。
ブール性と範囲制約
ブール値 b の場合: b(b-1) = 0
ビット b0...b{k-1} を持つ k ビット値 x の場合:
x = Σ b_i · 2^i
b_i(b_i - 1) = 0 for all i
危険: 分解ビットに対するブール性制約を忘れること。
セレクターの規律
セレクターは、どの制約をどの行に適用するかを制御します。
チェックリスト:
- [ ] 各セレクターはブール値である
- [ ] 行ごとにアクティブなセレクターは 1 つだけ (または明示的なカバレッジ)
- [ ] すべてのセレクターが 0 になる「ゴーストモード」がない
- [ ] セレクター自体が制約されている (自由ではない)
古典的なバグ: すべてのセレクターがゼロになると、ゲートされたすべての制約が自明的に真になります。
グローバル整合性議論
置換 / マルチセットの等価性
グランドプロダクトを介して、2 つのマルチセットが等しいことを証明します。
∏(α - a_i) = ∏(α - b_i)
チェックリスト:
- 初期積 = 1 (境界制約)
- 最終積が等しい (境界制約)
- コミットメント後にチャレンジ α をトランスクリプトにバインド
- 重複が正しく処理される
危険: 積がゼロになる、境界制約の欠落、チャレンジの再利用。
ルックアップ議論
列 A のすべての値がテーブル T に出現することを証明します。
チェックリスト:
- テーブルがコミット/固定されている
- 圧縮が衝突耐性を持つ (十分なランダム性)
- 繰り返されるルックアップが健全にカウントされる
危険: 弱い圧縮により、テーブル外の値が許可される。
メモリ整合性
メモリ操作はログを形成します: (address, timestamp, value, is_write)
パターン:
- アドレスでソートし、次にタイムスタンプでソートします
- 連続する同じアドレスの操作: 読み取りは最後の書き込みを参照します
- 置換はメモリログを CPU トレースにリンクします
危険:
- 異なるトレースセクション間でのアドレスエイリアシング
- タイムスタンプが単調であることが証明されていない
- Read-before-write が強制されていない
商と合成
制約多項式 C(x) は、トレースドメイン H 上で消滅する必要があります。
商: Q(x) = C(x) / Z_H(x)
C が H 上で消滅しない場合、Q は極を持ちます → 低次数ではない → FRI が拒否します。
行セット制御
制約は異なる行セットに適用されます。
- すべての行: Z_H(x) で割る
- 最後を除くすべて: Z_H(x) / (x - ω^{n-1}) で割る
- 最初のみ: 行 0 のラグランジュセレクターを掛ける
- 最後のみ: 行 n-1 のラグランジュセレクターを掛ける
危険: 「すべての行」を対象とした制約が、誤った消滅因子により、誤ってサブセットでのみ強制される。
次数会計
すべての制約の次数を追跡します。
基本制約次数: d
セレクター乗算後: d + deg(selector)
境界多項式後: d + deg(boundary)
合成多項式の次数は、十分なマージン (ブローアップファクター) を持ってドメインサイズを下回る必要があります。
Fiat-Shamir の衛生
トランスクリプトはバインドする必要があります:
- すべてのコ
(原文がここで切り詰められています)
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
AIR Cryptographer Expertise
Expert-level knowledge for designing, implementing, and auditing Algebraic Intermediate Representations (AIRs) in zero-knowledge proof systems.
Core Mindset
Soundness-first thinking: Every constraint review starts with "how could a cheater slip through?" Think adversarially. Construct counterexample traces by hand. Exploit polynomial identity loopholes.
Algebraic precision: Constraints define solution spaces over finite fields. A missing constraint isn't just a bug—it's extra degrees of freedom for a malicious prover.
Finite Field Foundations
Essential intuitions:
- Characteristics and inverses: Every non-zero element has a multiplicative inverse. No zero divisors.
- Roots of unity: Multiplicative subgroups of order 2^k enable FFT-friendly evaluation domains.
- Extension fields: When you need more algebraic structure (e.g., M31 → QM31 for Stwo).
- Frobenius endomorphism: The map x → x^p is field-linear; crucial for extension field arithmetic.
Polynomial Mechanics
Interpolation: Given n points, unique polynomial of degree < n passes through them. Lagrange basis makes this explicit.
Vanishing polynomials: Z_H(x) = ∏(x - h) for h ∈ H vanishes exactly on domain H. This is the foundation of constraint enforcement.
Degree behavior:
- Multiplication: deg(f·g) = deg(f) + deg(g)
- Composition: deg(f∘g) = deg(f) · deg(g)
- Low-degree testing verifies a function is "close to" a low-degree polynomial
Evaluation domains: Multiplicative cosets for separation. Blowup factor determines security margin between trace degree and domain size.
Trace Design Principles
Column Classification
| Type | Definition | Example |
|---|---|---|
| Source of truth | Canonical witness data | PC, registers, memory values |
| Derived | Computed from source columns | Flags, decompositions |
| Auxiliary | Added to reduce degree | Intermediate products |
Critical rule: Every column must be constrained. An unconstrained column is a free variable for the prover.
Row Semantics
Define precisely what each row represents:
- CPU cycle / instruction
- Memory operation
- Padding (must be distinguishable!)
Row types require selectors. Selectors must be:
- Boolean:
s(s-1) = 0 - Mutually exclusive:
Σ s_i = 1(or coverage proof) - Actually constrained (not just documented)
Minimal vs Redundant Columns
Start minimal. Add auxiliary columns only when:
- Degree reduction is necessary
- Soundness requires explicit intermediate values
- Verification cost dominates
Constraint Categories
Transition Constraints (Local)
Express correct step relation between row i and row i+1:
next_pc = pc + instruction_size (when not branching)
next_register[k] = f(current_state, opcode)
Danger: Writing a relation instead of a function. Multiple valid next-states = unsound.
Boundary Constraints
Pin specific rows to specific values:
- Initial: Row 0 state matches expected start
- Final: Last row satisfies termination condition
- I/O: Public inputs/outputs bound at known positions
Danger: "Final row" must be uniquely defined. Variable-length traces need explicit halt handling.
Booleanity and Range Constraints
For boolean b: b(b-1) = 0
For k-bit value x with bits b0...b{k-1}:
x = Σ b_i · 2^i
b_i(b_i - 1) = 0 for all i
Danger: Forgetting booleanity constraints on decomposition bits.
Selector Discipline
Selectors gate which constraints apply to which rows.
Checklist:
- [ ] Each selector is boolean
- [ ] Exactly one selector active per row (or explicit coverage)
- [ ] No "ghost mode" where all selectors = 0
- [ ] Selector itself is constrained (not free)
Classic bug: All selectors zero makes all gated constraints vacuously true.
Global Consistency Arguments
Permutation / Multiset Equality
Prove two multisets are equal via grand product:
∏(α - a_i) = ∏(α - b_i)
Checklist:
- Initial product = 1 (boundary constraint)
- Final products equal (boundary constraint)
- Challenge α bound to transcript after commitments
- Duplicates handled correctly
Danger: Product hitting zero, missing boundary constraints, challenge reuse.
Lookup Arguments
Prove all values in column A appear in table T.
Checklist:
- Table is committed/fixed
- Compression is collision-resistant (sufficient randomness)
- Repeated lookups soundly counted
Danger: Weak compression allows out-of-table values.
Memory Consistency
Memory operations form a log: (address, timestamp, value, is_write)
Patterns:
- Sort by address, then by timestamp
- Consecutive same-address ops: read sees last write
- Permutation links memory log to CPU trace
Danger:
- Address aliasing across different trace sections
- Timestamp not proven monotonic
- Read-before-write not enforced
Quotient and Composition
Constraint polynomial C(x) should vanish on trace domain H.
Quotient: Q(x) = C(x) / Z_H(x)
If C doesn't vanish on H, Q has poles → not low-degree → FRI rejects.
Row-Set Control
Constraints apply to different row sets:
- All rows: divide by Z_H(x)
- All but last: divide by Z_H(x) / (x - ω^{n-1})
- First only: multiply by Lagrange selector for row 0
- Last only: multiply by Lagrange selector for row n-1
Danger: Constraint meant for "all rows" accidentally only enforced on subset due to incorrect vanishing factor.
Degree Accounting
Track degree of every constraint:
Base constraint degree: d
After selector multiplication: d + deg(selector)
After boundary polynomial: d + deg(boundary)
Composition polynomial degree must stay below domain size with sufficient margin (blowup factor).
Fiat-Shamir Hygiene
Transcript must bind:
- All commitments (trace, lookup tables, etc.)
- Public inputs
- Trace length / domain parameters
- Any prover messages
Challenge separation: Different arguments need independent challenges. Reusing challenges creates algebraic vulnerabilities.
Danger: Challenge derived before commitment → prover can adapt witness.
Adversarial Witness Exercises
Before declaring an AIR sound, try to break it:
- All selectors = 0: Do constraints still enforce anything?
- Corrupt one column: Can it drift without detection?
- Attack last row: Dump inconsistency into wrap-around?
- Duplicate/omit memory events: Does global check catch it?
- Force product to zero: Exploit grand product boundary?
- Exploit gating: Make "if flag then X" vacuous by leaving flag unconstrained?
If you find a counterexample trace, you found a bug.
Common Vulnerability Patterns
| Pattern | Symptom | Fix |
|---|---|---|
| Unconstrained column | Prover sets arbitrarily | Add constraint |
| Missing booleanity | Non-binary "boolean" | Add b(b-1)=0 |
| Selector leakage | Constraint bypassed | Enforce exclusivity |
| Last row escape | Inconsistency hidden | Proper terminal constraints |
| Product zero | Permutation argument fails | Boundary checks, domain separation |
| Challenge reuse | Algebraic cancellation | Separate challenges per argument |
| Weak compression | Lookup collision | Increase randomness |
Performance-Aware Design
Understand tradeoffs without being an engineer:
| Choice | Prover Cost | Verifier Cost | Soundness |
|---|---|---|---|
| More columns | Higher memory | Unchanged | Neutral |
| Higher degree | More FRI rounds | More queries | Watch blowup |
| More rows | Linear scaling | Log scaling | Neutral |
| Auxiliary columns | Memory + constraints | Unchanged | Can improve |
Rules of thumb:
- Auxiliary columns to reduce degree often worth it
- Local constraints cheaper than global arguments
- Precomputation tables vs dynamic checks: depends on table size
Review Deliverables
When reviewing an AIR, produce:
- Column inventory: Name, meaning, range, where constrained
- Constraint map: Each semantic claim → which constraint enforces it
- Degree table: Every constraint's degree contribution
- Adversarial tests: Attempted counterexamples
- Risk ranking: Critical / High / Medium findings
- Proposed fixes: Concrete constraint additions/modifications
See references/review-checklist.md for the complete systematic review sheet.
同梱ファイル
※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。
- 📄 SKILL.md (9,465 bytes)
- 📎 references/review-checklist.md (9,671 bytes)