Skip to content

P2PKH address for the uncompressed public key #58

Closed
@meir555

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions