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

Support a different prefix #16

Open
PiRK opened this issue Dec 13, 2020 · 4 comments
Open

Support a different prefix #16

PiRK opened this issue Dec 13, 2020 · 4 comments

Comments

@PiRK
Copy link

PiRK commented Dec 13, 2020

Hi, i work with Bitcoin ABC. We plan to keep using the CashAddr format, but obviously we will change the prefix after the recent fork.

Would you accept a pull request to support our new prefix in addition to bitcoincash:? I can do it in such a way that none of the existing API is modified, I would only add a few attributes, methods and functions.

This would avoid duplication of the whole codebase in a new fork, and allow three way conversion (legacy, bitcoincash, new prefix).

@PiRK
Copy link
Author

PiRK commented Dec 13, 2020

The new prefix will be announced very soon as part of the rebranding, btw.

@ghost
Copy link

ghost commented Dec 14, 2020

I imagine we would need to have some kind of API argument that would be BITCOIN_ABC=1 or BITCOIN_CASH_VERSION=(ABC|MAIN), etc?

@PiRK
Copy link
Author

PiRK commented Dec 14, 2020

I was thinking of adding : ABC_MAINNET_PREFIX, ABC_TESTNET_PREFIX, Address.abc_cash_address, to_abc_cash_addr

And make Address.from_string, to_legacy_addr, to_cash_addr all support the 3 type of addresses as input (default to "bitcoincash:" if the prefix is missing).

Maybe also add an Address.from_cashaddr_arbitrary_prefix() method to support stuff like "regtest:", "simpleledger:"...

@PiRK
Copy link
Author

PiRK commented Dec 21, 2020

I see that you already support importing CashAddr strings with any prefix. The only thing that is missing is a simple way to output to any other prefix.
What do you think about an optional prefix argument for the Address.cash_address() method?

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

No branches or pull requests

1 participant