Skip to content

Misleading naming on Program::with_pub_key #73

@stringhandler

Description

@stringhandler

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions