Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BTC(Input|Output)ScriptType types are redundant #465

Open
mrnerdhair opened this issue Mar 14, 2022 · 0 comments
Open

BTC(Input|Output)ScriptType types are redundant #465

mrnerdhair opened this issue Mar 14, 2022 · 0 comments
Labels
tech-debt A suboptimality that existed in code when it was written.
Milestone

Comments

@mrnerdhair
Copy link
Contributor

There's only one type of script type, but we've got two different ones. This makes the API harder to use, the library as a whole less extensible and harder to maintain, and gives people the false impression that script type and address format have something to do with each other.

  • Dry out BTC(Input|Output)ScriptType into a single BTCScriptType enum whose members represent the actual BTC script types.
  • Introduce a new type, BTCAddressFormat, to make specifying a specific script type to orthagonal to specifying how an address should be encoded (e.g. cashaddr vs Bech32 vs Base58Check)
  • Add a function defaultAddressFormatForScriptType() to hdwallet-core which returns the standard Bitcoin Mainnet address format used with each script type.

Fixed by #434.

@mrnerdhair mrnerdhair added the tech-debt A suboptimality that existed in code when it was written. label Mar 14, 2022
@mrnerdhair mrnerdhair linked a pull request Mar 17, 2022 that will close this issue
@mrnerdhair mrnerdhair added this to the hdwallet++ milestone Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tech-debt A suboptimality that existed in code when it was written.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant