rust-bitcoin / rust-bech32-bitcoin

Encoding and decoding Segregated Witness addresses in Bech32 format
16 stars 25 forks source link

Cleaning up the network constants #7

Closed clarkmoody closed 3 years ago

clarkmoody commented 6 years ago

The Network enum contains the human-readable constants for a few chains, and there are more that are not included yet.

Since Network is a public enum, and new coins would be breaking changes, requiring a version bump.

There are a couple ways forward:

  1. Break out Network into a new crate / repo, and link against an early version, not caring about newer coins.
  2. Remove the concept entirely, leaving the hrp as a string input for the calling code.
  3. Keep Network, but throw away all the coins except Bitcoin and Testnet. It's tough luck for other chains after this.

Thoughts?

clarkmoody commented 6 years ago

Note: I created a placeholder repo to go down the 1. route above.

sgeisler commented 6 years ago

What do you think about rust-bitcoin/bitcoin-constants#1?

clarkmoody commented 6 years ago

@sgeisler It looks good so far. I guess we can add more fields as we go along: address prefixes, private key version bytes, etc.