ZhePang / Python_Specification_for_Schnorr_Adaptor

5 stars 4 forks source link

Should `extract_adaptor` API return `None` instead of `False`? #15

Closed siv2r closed 1 month ago

siv2r commented 3 months ago

The extract_adaptor API returns False when it’s unable to generate a valid adaptor point. In one of our calls, we decided on using False because None is used to represent an infinity point.

Wouldn’t it be more pragmatic to use None instead?

Here are my reasons:

jonasnick commented 3 months ago

Agree that the return type should be Optional[PlainPk]. Since None is not not a plain public key, I don't see how a user could confuse this.

I think the function returns False now because it used to return Point at some point in the past and not PlainPk.