feat(spec): independent JavaScript verifier for korg-ledger@v1#5
Merged
Conversation
Add spec/korg-ledger-v1/js/ — a dependency-free, isomorphic (Node + browser via Web Crypto) verifier plus a conformance harness mirroring conformance.py. It reproduces every frozen tip hash byte-for-byte (including the non-ASCII and astral surrogate-pair canonicalization edge cases) and cross-validates against the Rust korg-verify crate on a real Ed25519-signed receipt: Python mints the signature, Rust and JavaScript both re-verify it. This makes the 'three genuinely independent implementations' claim TRUE rather than aspirational — Python (conformance.py) + JavaScript (js/verify.mjs) + Rust (korg-verify): three languages, three codepaths, one shared frozen oracle. Update the spec README/SPEC to state that honestly: drop the folded 'thumper' impl and the ad-hoc launch-site JS, list the three tested/reproducible implementations with their one-command conformance checks. npm-ready as @korgg/ledger-verify (npx korg-verify-js <receipt>).
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.
Makes the "three genuinely independent implementations" claim true rather than aspirational.
What
Adds
spec/korg-ledger-v1/js/— a dependency-free, isomorphic (Node ≥18 + browser, via the Web Crypto standard) verifier forkorg-ledger@v1, plus a conformance harness mirroringconformance.py.verify.mjsverify_chain/verify_dag/ Ed25519 tip-signature / receipt+journal autodetect + CLIconformance.mjstip_entry_hash, flags every tampered vectorbin.mjsverify.mjsstays browser-importable whilenpxstill workspackage.json@korgg/ledger-verify(npx korg-verify-js <receipt>)README.mdWhy it matters
Before this PR there were two genuinely independent, conformance-tested implementations (Python
conformance.py, Rustkorg-verify) and an ad-hoc in-browser JS snippet on the launch site. The spec README claimed four implementations, two of which were stale (thumper, since folded) or untested (the launch-site JS). This replaces that with three rigorous, reproducible implementations — Python, JavaScript, Rust — each a one-command conformance check.Verification
node spec/korg-ledger-v1/js/conformance.mjs→ PASS — reproduces7418b910…(basic) and1b371102…(HMAC) byte-for-byte, plus non-ASCII (é→é) and astral surrogate-pair (𝄞→𝄞) canonicalization edge cases.verify.mjsandkorg-verify(Rust) return the same VALID verdict and same signer on the real signedkorg-proof/deliverable.korgreceipt.json(6 events) — Python minted the Ed25519 signature, Rust and JS both re-verify it.--pubkeypin → rejected; HMAC journal without key → rejected.cargo test -p korg-verifyunchanged and green.Notes
spec/korg-ledger-v1/{README,SPEC}.md; no Rust/Python code touched.verify.mjshas zero dependencies (Web Crypto only). Ed25519 incrypto.subtleneeds a recent runtime (Node ≥18.4 / current browsers); chain + DAG checks work everywhere.@korgg/ledger-verifyis left as a separate step (needs registry auth).