Merged
Conversation
…-encoding Restore compact share payload encoding (add p= compressed codec, prefer p over r)
## v42.3.0 — Share-Link Compact Proof Bundle (KAS + ZK) + Deflate-Bomb Guardrails ### What changed * **Restored social-shareable VerifyPage links** while still carrying the full public proof bundle (KAS WebAuthn attestation + Groth16/Poseidon ZK proof + public inputs + hashes) fully self-contained in the URL. * **Introduced compact share payload `?p=`** using a versioned codec: * `?p=c1:<base64url(deflateRaw(JCS(JSON)))>` * **Kept full backward compatibility**: * Legacy `?r=` links still decode and verify exactly as before. ### Why it matters * **Short links are postable again** on Twitter/X and other platforms without breaking the “all-proof-in-the-link” offline verification experience. * **Offline-first remains intact**: opening a shared link renders and verifies directly from embedded public proof material—no server lookup required. ### Security / Performance hardening * **Added strict decode limits to prevent DoS / deflate-bomb expansion**: * Caps on encoded param length (`MAX_P_CHARS`) * Caps on compressed bytes (`MAX_COMPRESSED_BYTES`) * Caps on inflated output bytes (`MAX_INFLATED_BYTES`) * Fail-fast decoding with safe abort during inflation * **Legacy `?r=` path also bounded** to prevent accidental oversized payloads. ### Implementation highlights * Added a dedicated codec module (`shareBundleCodec`) with: * `encodeSharePayload()` / `decodeSharePayload()` for `?p=` * `encodeLegacyRParam()` / `decodeLegacyRParam()` for `?r=` * Canonical JSON via **JCS** before compression to maximize determinism + compression ratio. ### Result * VerifyPage share URLs are **compact, deterministic, offline-verifiable**, and **safe against decompression abuse**—without changing any KAS or ZK verification semantics.
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.
v42.3.0 — Share-Link Compact Proof Bundle (KAS + ZK) + Deflate-Bomb Guardrails
What changed
Restored social-shareable VerifyPage links while still carrying the full public proof bundle (KAS WebAuthn attestation + Groth16/Poseidon ZK proof + public inputs + hashes) fully self-contained in the URL.
Introduced compact share payload
?p=using a versioned codec:?p=c1:<base64url(deflateRaw(JCS(JSON)))>Kept full backward compatibility:
?r=links still decode and verify exactly as before.Why it matters
Security / Performance hardening
Added strict decode limits to prevent DoS / deflate-bomb expansion:
MAX_P_CHARS)MAX_COMPRESSED_BYTES)MAX_INFLATED_BYTES)Legacy
?r=path also bounded to prevent accidental oversized payloads.Implementation highlights
Added a dedicated codec module (
shareBundleCodec) with:encodeSharePayload()/decodeSharePayload()for?p=encodeLegacyRParam()/decodeLegacyRParam()for?r=Result