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

P2PKH address for the uncompressed public key #58

Closed
meir555 opened this issue Jun 22, 2022 · 2 comments
Closed

P2PKH address for the uncompressed public key #58

meir555 opened this issue Jun 22, 2022 · 2 comments

Comments

@meir555
Copy link

meir555 commented Jun 22, 2022

Code:

from hdwallet import HDWallet
from hdwallet.symbols import BTC as SYMBOL
hdwallet: HDWallet = HDWallet(symbol=SYMBOL)
PRIVATE_KEY: str = hashlib.sha256(b"asdasd").hexdigest()
hdwallet.from_private_key(PRIVATE_KEY)
print("Uncompressed:", hdwallet.uncompressed())
print("P2PKH Address:", hdwallet.p2pkh_address())

Result:

Uncompressed: fb2b1bf2bcb92b11db6caee48f4a0656dddb0104abc8583a67be81581868ae31551a7aeb83a4004d4b169d4d8020f0b1fd4ae977e4bd9da0d9f3414a0c0353c5
P2PKH Address: 1AQYRDSw3eUo3LuWbdENKdLudxJ2ENuUwN

Problems:

  1. Shouldn't you add 04 to the beginning of the uncompressed key?
  2. The address P2PKH Address: 1AQYRDSw3eUo3LuWbdENKdLudxJ2ENuUwN is the address of the compressed public key, can you add the P2PKH Address for the uncompressed public key?
    For the example above, from my calculation the P2PKH address for the uncompressed public key is 1Mw7FXN7D7du9umtbkhov2ftELKQw1wFor
@meherett
Copy link
Member

Duplicated #50

@meherett
Copy link
Member

It's supported uncompressed address in the v3 package. Thank you.

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

2 participants