boltlabs-inc / tss-ecdsa

An implementation of a threshold ECDSA signature scheme
Other
12 stars 5 forks source link

Add unique set type for inputs #483

Open marsella opened 1 year ago

marsella commented 1 year ago

Many of our constructed input / output types need to be unique sets. For example:

Note that the uniqueness property is on the PIDs, not the data itself. Theoretically, it's possible and legal for two parties to randomly select e.g. identical public key shares (although it's incredibly unlikely). On the flip side, if we have a dozen unique pieces of data but they all belong to the same PID, we have a problem.

Currently, these are typed as Vec<_>s and upon construction, we check that the uniqueness properties hold. An alternate approach could define a UniqueSet<T> type that checks the appropriate uniqueness property and maybe can be constructed easily from any iterable.

Completion criteria

If appropriate, this can be broken into multiple issues