Skip to content

Add hash-based commitment scheme to generic-ec-zkp#62

Closed
sridhar-panigrahi wants to merge 1 commit intoLFDT-Lockness:mfrom
sridhar-panigrahi:feat/hash-commitment-zkp
Closed

Add hash-based commitment scheme to generic-ec-zkp#62
sridhar-panigrahi wants to merge 1 commit intoLFDT-Lockness:mfrom
sridhar-panigrahi:feat/hash-commitment-zkp

Conversation

@sridhar-panigrahi
Copy link
Copy Markdown
Contributor

Hey Denis and
Maurges,

This adds a hash_commitment module to generic-ec-zkp — a statistically
hiding, computationally binding commitment scheme generic over any
Digest and Digestable message type.

The scheme computes H(domain_tag || nonce || msg) where the 32-byte
nonce is sampled fresh each time. Verification uses
subtle::ConstantTimeEq throughout. It fits naturally alongside the
existing Schnorr PoK and dlog-equality proofs in the crate.

The immediate motivation is threshold protocols like DKLs23, where each
party needs to commit to its key-share contribution before the reveal
round — without it a rushing adversary can bias the combined key. The
primitive is generic enough to be useful anywhere a commit-reveal round
appears.

Happy to adjust the API shape or feature gating based on your
preferences.

@sridhar-panigrahi
Copy link
Copy Markdown
Contributor Author

@survived , @maurges , please let me know your thoughts on this !

Adds `hash_commitment` module implementing F_com: a statistically hiding,
computationally binding commitment scheme generic over any `digest::Digest`
and any `udigest::Digestable` message type.

The scheme commits as `H(domain_tag || nonce || msg)` where the nonce is 32
bytes of fresh randomness. Verification is constant-time via `subtle::ConstantTimeEq`.

This primitive is required by threshold protocols like DKLs23, where each
party commits to its key-share contribution before revealing it, preventing
a rushing adversary from biasing the combined public key.

Signed-off-by: Shridhar Panigrahi <sridharpanigrahi2006@gmail.com>
@sridhar-panigrahi sridhar-panigrahi force-pushed the feat/hash-commitment-zkp branch from 9faa776 to b457f32 Compare April 11, 2026 19:12
@maurges
Copy link
Copy Markdown
Contributor

maurges commented Apr 21, 2026

Hello @sridhar-panigrahi. I don't think this protocol currently has a place in generic-ec. Note that in contribution guidelines we ask all contributors to contact us before doing any work. It's usually a good reflex to talk to the maintainers before engaging into any development, at least to make sure your views are aligned.

Currently we're unsure about the direction of generic-ec-zkp, what primitives should be included in it. Maybe in the future we will revisit the idea of this patch.

@maurges maurges closed this Apr 21, 2026
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.

2 participants