boltlabs-inc / tss-ecdsa

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

Design and implement updated error types for the ZKP module #487

Open marsella opened 1 year ago

marsella commented 1 year ago

The zero-knowledge proof module is pretty independent of the protocol implementations. It doesn't encode any basic knowledge of protocol-level entities like participants or participant IDs. I think there are only a few types of failures across the proofs:

Someone else should think about this more carefully, but I think the top two map to InternalInvariantFailed and the bottom three to ProtocolError. However, since the proofs themselves don't know the participant ID of the verifier, they can't throw a useful protocol error; that field has to be filled in by the caller.

Proposed solution

I thought of a few potential ways to address this:

This issue so far only addresses the ZKP module, but since that module calls into lots of other crypto-generic methods (e.g. sampling methods in utils.rs, curve point methods), if we decide to make a ZKP-specific error type we might want to actually have that be the error type for all the generic-crypto modules. In that case we might want to block this issue on #145.

Completion criteria