Zero now means zero: ZK run attestation + enforced no-recursion#1
Open
Solizardking wants to merge 1 commit into
Open
Zero now means zero: ZK run attestation + enforced no-recursion#1Solizardking wants to merge 1 commit into
Solizardking wants to merge 1 commit into
Conversation
Add internal/attest — a stdlib-only package that makes "Zero" literal: - Hash-chained transcripts: every run event folds into a SHA-256 chain whose head is a 32-byte payload commitment; JSONL export re-verifies offline with VerifyJSONL, and any tampering is detected. - Nullifiers bit-compatible with clawd-zk (@clawd/zk-client computeNullifier): SHA-256(secret ‖ context ‖ nonce_u64le), giving one-shot replay protection when published on Solana via publish_attestation (~$0.005/run via compressed PDAs). - Attestation artifact carrying exactly the four public inputs the clawd-zk program verifies: attester, modelHash, payloadCommitment, nullifier. The chain learns that a run happened, which model set produced it, and that it happened exactly once — never prompts, tool calls, or outputs. - Static no-recursion gate: norecursion_test.go builds the package's intra-package call graph on every go test and fails on any direct or mutual recursion. Announce the capability at the top of the README and link docs/ATTESTATION.md from the documentation index. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
5 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
📣 Announcement
Zero can now prove an agent run happened — exactly once, produced by a specific model set — without revealing a single token of it.
This PR lands
internal/attest, a stdlib-only package (zero new dependencies) that turns the name "Zero" into two verifiable properties:1. Zero knowledge — attestable runs
head_i = SHA-256(head_{i-1} ‖ canonicalJSON(record_i)). The final head is a 32-byte payload commitment.SHA-256(secret ‖ context ‖ nonce_u64le), bit-compatible with clawd-zk's@clawd/zk-clientcomputeNullifier(verified against an independent reference computation) — gives one-shot replay protection.Attest()emits exactly the four public inputs the clawd-zk Solana program verifies inpublish_attestation: attester, modelHash, payloadCommitment, nullifier. On-chain cost ≈ $0.005/run via compressed PDAs (15k lamports vs 890k for a regular PDA).WriteJSONL/VerifyJSONLlet anyone holding the file replay the chain and check the commitment offline; tampering with any byte is detected.What the chain learns: a run happened, which model set produced it, exactly once. What it never learns: prompts, tool calls, outputs.
2. Zero recursion — enforced, not asserted
norecursion_test.goparses the package on everygo test, builds the intra-package static call graph (closures attributed to their enclosing function), and fails the build on any direct or mutual recursion. Planting a recursive function turns CI red.Changes
internal/attest/attest.go— Transcript hash chain, JSONL export/verify, Nullifier, Attestation, ModelSetIDinternal/attest/attest_test.go— round-trip, tamper detection, determinism, zk-client compatibility vectorsinternal/attest/norecursion_test.go— static call-graph recursion gatedocs/ATTESTATION.md— privacy model and integration flowREADME.md— announcement at the top + documentation index entryVerification
go vet ./internal/attest/cleango test ./internal/attest/— 6/6 pass (ok github.com/Gitlawb/zero/internal/attest)Notes
The full flat-scheduler engine this was distilled from — queued (never nested) subagents, ZK God Mode multi-model racing with winner-set attestation, and deterministic NL intent routing — lives in ClawdBot's
pkg/zero. This package is the portable core Zero can adopt incrementally; wiring it intointernal/agent's loop andzero execis a natural follow-up.🤖 Generated with Claude Code