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

add support for arbitrary version bytes #15

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Kefkius
Copy link

@Kefkius Kefkius commented Oct 30, 2014

Add two classes, CoinPrivateKey and CoinPublicKey, that take a version byte parameter in their constructors.
Also allow WIF version byte to be specified via a parameter.

@shea256
Copy link
Contributor

shea256 commented Nov 3, 2014

Hi @Kefkius thanks for the suggestions and pull request. I have a few questions:

  1. Do you find the method that you've included here to be better than this:
class KefkiusCoinPrivateKey(BitcoinPrivateKey):
    _pubkeyhash_version_byte = 42

kefkius_priv_1 = KefkiusCoinPrivateKey()
kefkius_priv_2 = KefkiusCoinPrivateKey()

Here, one can create a new class for a new coin and then create new instances of the class. This is in contrast to your pull request, where you allow users to create new keys without defining a new class.

  1. In my experience, WIF version numbers are simply equal to 128 plus the pubkeyhash version number. Have you been in a situation where you'd need to explicitly set the WIF version number separate from the the pubkeyhash version number?

@Kefkius
Copy link
Author

Kefkius commented Nov 5, 2014

@rxl You're welcome. I see that the method you described is at least as useful as mine to a user. I made the pull request after seeing that so many coins were on "to-do" implementation status. I figured this would be an easy little hack to use, but yes, the method you described is just as effective, and may be a better option.

As for WIF versions: Yes, I've had to explicitly define a WIF version.

@CLAassistant
Copy link

CLAassistant commented Mar 8, 2020

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Kefkius seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants