Verify recovery byte for signature#136
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors signature handling to use the structured Signature class instead of raw Uint8Array byte arrays across several files, including UnicitySeal, UnicitySealQuorumSignaturesVerificationRule, and SignaturePredicateVerifier. It also introduces new verification methods in SigningService and adds unit tests for SignaturePredicateVerifier. The review feedback identifies two important issues in SigningService: first, verifyWithPublicKey should explicitly check for a null recovered public key to avoid potential runtime errors or TypeScript compilation issues; second, the instance verify method should delegate to verifyWithPublicKey rather than verify to ensure the recovery byte is properly validated, preventing signature malleability.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
SDK QA sign-off — verified end-to-endFix closes both Finding A (unlockScript recovery byte, Empirical confirmation (2026-07-14)C5 bit-flip fuzz ( Direct PoC (
Unit-level tamper test ( it('rejects a signature whose recovery byte has been flipped (Finding A fix)', async () => {
// ... flip recovery byte, expect verifyWithPublicKey → false ...
});Regression check — zero SDK regressions
API migration note (downstream) Any external consumer that calls verifyWithPublicKey with raw bytes will need Signature.decode(bytes) first. Cheap fix, but flag for release notes. Verdict Ready to merge. Fix is minimal, correct, addresses two independent findings in one code path, adds proper regression coverage, and passes hermetic + live end-to-end verification. |
No description provided.