siv2r / bip-frost-signing

A BIP draft for BIP340-compatible FROST threshold signing protocol
8 stars 3 forks source link

The signer’s pubkey present in the pubkey list check #8

Open siv2r opened 1 month ago

siv2r commented 1 month ago

I am referring to the following check: https://github.com/siv2r/bip-frost-signing/blob/65ceeda83a0bf0b0653b65cdba05651619e09e67/reference/reference.py#L438-L440

This check isn't useful during verification because when PartialSigVerify calls ParialSigVerifyInternal, it always chooses the signer’s pubshare from the list. Hence, this check would always pass. The only useful scenario is when test_det_sign_vectors calls partial_sig_verify_internal explicitly.

Removing this check would not cause any problem because partial_sig_verify_internal will fail anyway, even without this check, when the signer’s pubkey is not on the list.

I am fine with either removing or keeping this check.

siv2r commented 1 month ago

Hence, this check would always pass

Surprisingly, this property is helpful in the case of BIP327.

BIP327 performs this check in the get_session_key_agg_coeff function, where it throws a ValueError if the check fails. As a result, partial_sig_verify_internal can also throw an exception (it doesn't always return a boolean). However, this exception is never thrown because the check always passes when verify_internal is called through verify.