Difficulty: Expert
Type: Security
Recommended labels (if available in this repo): security, crypto, sdk
Background
docs/cryptographic-audit-secp256k1.md documents an audit of the SDK's secp256k1 usage in src/crypto/secp256k1.ts. Audit documents like this typically flag specific findings (e.g. signature malleability, non-constant-time comparisons, insufficient nonce validation) that need remediation.
Problem
Whatever findings are documented in the audit currently remain in the codebase as documentation only — there is no corresponding tracked remediation work applied to src/crypto/secp256k1.ts.
Expected Outcome
Every finding in docs/cryptographic-audit-secp256k1.md is either remediated in code or explicitly documented as accepted risk with justification, and the audit doc is updated to reflect remediation status.
Suggested Implementation
Work through the audit document finding-by-finding. Common secp256k1 pitfalls to check for specifically: signature malleability (ensure s values are in the lower half of the curve order, per EIP-2), timing side-channels in comparison operations, and correct recovery-id handling. Apply fixes with accompanying regression tests, and update the audit doc's status column/section per finding.
Acceptance Criteria
- Every finding in the audit doc has a corresponding code change, test, or explicit documented risk acceptance
- Signature malleability protections verified with a test using a known malleable signature pair
- No regressions in existing signature verification behavior — all existing crypto tests still pass
- Audit doc updated with remediation status per finding
pnpm test:run passes
Likely Affected Files/Directories
docs/cryptographic-audit-secp256k1.md
src/crypto/secp256k1.ts
src/eip712/eip712.helpers.ts
Difficulty: Expert
Type: Security
Recommended labels (if available in this repo):
security,crypto,sdkBackground
docs/cryptographic-audit-secp256k1.mddocuments an audit of the SDK's secp256k1 usage insrc/crypto/secp256k1.ts. Audit documents like this typically flag specific findings (e.g. signature malleability, non-constant-time comparisons, insufficient nonce validation) that need remediation.Problem
Whatever findings are documented in the audit currently remain in the codebase as documentation only — there is no corresponding tracked remediation work applied to
src/crypto/secp256k1.ts.Expected Outcome
Every finding in
docs/cryptographic-audit-secp256k1.mdis either remediated in code or explicitly documented as accepted risk with justification, and the audit doc is updated to reflect remediation status.Suggested Implementation
Work through the audit document finding-by-finding. Common secp256k1 pitfalls to check for specifically: signature malleability (ensure
svalues are in the lower half of the curve order, per EIP-2), timing side-channels in comparison operations, and correct recovery-id handling. Apply fixes with accompanying regression tests, and update the audit doc's status column/section per finding.Acceptance Criteria
pnpm test:runpassesLikely Affected Files/Directories
docs/cryptographic-audit-secp256k1.mdsrc/crypto/secp256k1.tssrc/eip712/eip712.helpers.ts