Simplex version
0
What happened?
The method with_pub_key is actually the public key used for the taproot tweak, which a user may mistake for another public key referenced in the simplicity program, especially when there is only one public key in the program or if there is a parameter named param::PUBLIC_KEY.
I suggest naming it something more descriptive so that errors can be picked up at a quick glance during code reviews.
Possibly with_taproot_tweak_key. Preferrably not with_internal_key which is also not very descriptive in it's use.
For completeness, I'd suggest adding a builder method with_unspendable_taproot_key() which resets it back to tr_unspendable_key, but this is not as important.
Minimal reproduction steps
Design bug
Simplex version
0
What happened?
The method
with_pub_keyis actually the public key used for the taproot tweak, which a user may mistake for another public key referenced in the simplicity program, especially when there is only one public key in the program or if there is a parameter namedparam::PUBLIC_KEY.I suggest naming it something more descriptive so that errors can be picked up at a quick glance during code reviews.
Possibly
with_taproot_tweak_key. Preferrably notwith_internal_keywhich is also not very descriptive in it's use.For completeness, I'd suggest adding a builder method
with_unspendable_taproot_key()which resets it back totr_unspendable_key, but this is not as important.Minimal reproduction steps
Design bug