DkgPublicShares's signed hash skips the PolyCommitment ID proofs and has no length prefixes

Open
#255 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust

Research direction

Find the Signable implementation for DkgPublicShares and the dkg_public_shares_digest encoding introduced in #248. Compare the fields and list encoding, then update the signed hash to cover every PolyCommitment field with length prefixes. Done means the hash matches the digest's field coverage and the wire-breaking change is scheduled for 16.0.0; the issue also suggests auditing other Signable implementations.

Written by the indexing model from the issue text.

Description

Problem

impl Signable for DkgPublicShares hashes dkg_id, signer_id, the kex key and proof, and for each commitment the party_id and the polynomial points. It does not hash comm.id at all (the Schnorr ID scalar and its proof R, s), and none of the lists are length-prefixed. So the packet signature does not cover the proof of knowledge of the constant term, which is exactly the proof the coordinator and signers verify and the whitepaper's security argument relies on. A relay could alter the proof without invalidating the packet signature; the proof itself would then fail verification, so this is a hardening gap rather than an exploit, but it is the one part of a public share the signature leaves open.

This is why the digest introduced in #248 uses its own encoding (every field, length-prefixed) instead of reusing the Signable hash.

Fix

Hash every field of each PolyCommitment, including the ID scalar and proof, with length prefixes on every list, in the same shape as dkg_public_shares_digest. Changes a signed hash, so wire-breaking; 16.0.0. Consider auditing the other Signable impls for the same omission at the same time.

Dominant language
Rust
Stars
34
Forks
19
Avg merge
9h 19m
Merged PRs (30d)
12

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from xoloki/wsts

All issues in xoloki/wsts

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.