Skip to content

docs(sdk): clarify _client param is not read in encrypt + disclose (#587)#622

Open
aggre wants to merge 1 commit into
mainfrom
docs/sdk-client-param-docstring-crypto-disclose-587
Open

docs(sdk): clarify _client param is not read in encrypt + disclose (#587)#622
aggre wants to merge 1 commit into
mainfrom
docs/sdk-client-param-docstring-crypto-disclose-587

Conversation

@aggre

@aggre aggre commented Jul 3, 2026

Copy link
Copy Markdown
Member

Summary

Follow-up to #587, mirroring merged #609. Aggre's latest comment on #587 explicitly flagged this as a separate follow-up:

Out of scope (separate follow-up): crypto.ts:encrypt and disclose.ts (sign/verify/reveal/verifyProof) carry the same unused-_client pattern — flagged rather than bundled to keep this minimal.

#609 added docstrings to prepare and normalize explaining the unused _client: LemmaClient parameter. This PR applies the same treatment to the remaining 5 functions.

Changes

  • packages/sdk/src/crypto.ts — new docstring on encrypt
  • packages/sdk/src/disclose.ts — extended docstrings on sign, verify, reveal, verifyProof

Each docstring explains:

  • No network I/O (local cryptographic operation)
  • _client accepted for forward-compatibility of the public signature, not read
  • Retained so future versions may add client-bound behavior without a breaking change

Wording adaptation

#609's "pure local operation" phrasing is accurate for prepare/normalize (in-memory Poseidon) but inaccurate for these functions, so the wording is adapted per function:

  • encrypt — non-deterministic (fresh ephemeral keypair + random nonce per call via CSPRNG)
  • sign/verify/reveal/verifyProof — WASM boundary (@docknetwork/crypto-wasm, lazy-initialized via ensureWasmInitialized)
  • reveal — additionally documents the intentional LemmaClient | undefined type (createProof calls reveal(undefined, ...) internally)

Scope

Docs-only. No code, signature, or behavior changes. tsc + eslint clean on both modified files. Whitepaper refs: §2.1/§4.4 (crypto), §2.6/§4.6 (disclose).

Closes #587 (final flagged follow-up item).

)

Follow-up to #609. Aggre flagged these in #587's latest comment:
'Out of scope (separate follow-up): crypto.ts:encrypt and disclose.ts
(sign/verify/reveal/verifyProof) carry the same unused-_client pattern.'

Adds/extends docstrings on all 5 functions explaining:
- no network I/O (local cryptographic operation)
- _client accepted for forward-compatibility of the public signature, not read
- retained so future versions may add client-bound behavior without breaking

Wording adapted from #609 (do not call them 'pure local operation'):
- encrypt: non-deterministic (fresh ephemeral keypair + random nonce per call)
- disclose x4: WASM boundary (@docknetwork/crypto-wasm, lazy-initialized via
  ensureWasmInitialized)
- reveal: documents intentional LemmaClient | undefined (createProof passes
  undefined internally)

Docs-only. No code, signature, or behavior changes. tsc + eslint clean.
Whitepaper refs: §2.1/§4.4 (crypto), §2.6/§4.6 (disclose).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade friction 0.0.14 → 0.0.33: deep-import removal + no offline commitment path

1 participant