BlockstreamResearch / bip-frost-dkg

15 stars 7 forks source link

Make certifying_eq/DKG always return? #16

Closed real-or-random closed 4 months ago

real-or-random commented 4 months ago

Currently, certifying_eq, and thus the DKG, may hang forever. This makes sense in theory, but is not a very suitable model for implementations. (Assume you run this in a thread and the machine dies at some point... What now?)

We could do the following instead:

This interface is a bit nicer, and it's compatible with the idea that the cert can be sent late, e.g., attached to signing requests. If you receive a cert late, you can simply call recpedpop_finalize at that point. (Instead of "feeding" it onto the incoming wire of certifying_eq, which you would have to do right now, so that the while loop can catch it.)

We could also consider returning the shared pubkey early. That may be convenient for callers who know what they're doing, but that's rather bit risky for those who don't... I don't know. I guess it's not necessary. In a singing request, you can use the setup_id to uniquely identify the setup. You don't need the aggregate public key for that.

real-or-random commented 4 months ago

I like the changes on master. I think this is solved.