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

Create BitcoinCash from privatekey [bitcoincash:qr...] #57

Open
Pymmdrza opened this issue Jun 1, 2022 · 1 comment
Open

Create BitcoinCash from privatekey [bitcoincash:qr...] #57

Pymmdrza opened this issue Jun 1, 2022 · 1 comment
Labels
address New or invalid address enhancement New feature or request

Comments

@Pymmdrza
Copy link

Pymmdrza commented Jun 1, 2022

How create bitcoincash address (bitcoincash:qr...) from this package ???
used this source , not worked to this type address :

from hdwallwet import HDWallet
from hdwallet.symbols import BCH as SYMBOL
hdwallet: HDWallet = HDWallet(symbol=SYMBOL)
hdwallet.from_private_key(private_key=private_key)
addr = hdwallet.p2wpkh_address()
print(addr)
# out: bc1qgrdf2l6z6u78zpdj4excxp44r4amquxlalcnpd

i need this address type : bitcoincash:q....

@meherett meherett added enhancement New feature or request address New or invalid address labels Jun 3, 2022
@meherett
Copy link
Member

meherett commented Jun 3, 2022

@Pymmdrza, Basically Bitcoin Cash has 3 different types of Pay to Public Key Hash (P2PKH) addresses. Those are:
1, CashAddr addresses for Bitcoin Cash (ie starting with q or bitcoincash:q instead of 1)
2, BitPay-style addresses for Bitcoin Cash (ie starting with C instead of 1)
3, Legacy addresses for Bitcoin Cash (ie starting with 1)

So, on the currerent version of this hdwallet package; you can only generate addresses on the second type of BitPay-style addresses for Bitcoin Cash (ie starting with C instead of 1) style. In the upcoming version I will add the rest of them.

And also call this hdwallet.p2pkh_address() instead of hdwallet.p2wpkh_address() function because p2wpkh_address() is Pay to Witness Public Key Hash address or it's SegWit address.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
address New or invalid address enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants