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

Addresses generation #53

Open
rafaelpac opened this issue Aug 25, 2019 · 3 comments
Open

Addresses generation #53

rafaelpac opened this issue Aug 25, 2019 · 3 comments

Comments

@rafaelpac
Copy link

Hi!
I don't understand something.
If I take private key
0000000000000000000000000000000000000000000000000000000000000001
private key WIF is
KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn
public key compressed is
0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798

https://segwitaddress.org/ will give me address
3JvL6Ymt8MVWiCNHC7oWU6nLeHNJKLZGLN
but BTCPY will give me
3CNHUhP3uyB9EUtRLsmvFUmvGdjGdkTxJw

https://segwitaddress.org/bech32/ will give me address
bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4
but BTCPY will give me
bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4 (version 0)
bc1pw508d6qejxtdg4y5r3zarvary0c5xw7k8e76x7 (version 1)
bc1zw508d6qejxtdg4y5r3zarvary0c5xw7k6jw83r (version 2)

Why are these differences?!?

@brunoerg
Copy link

@rafaelpac It's everything right! From a key you can generate MANY addresses. You are assuming it should return always the same address, but it is not true. Reuse addresses is not a good practice.

@rafaelpac
Copy link
Author

Bech32 is fine, I understand it, btcpy is working as expected. But for the P2SH, it is weird. What script is btcpy using to get that different address? I am not talking about HD addresses, I mean, SH means script hash, right? What script when hashed will make it to this p2sh btcpy gives out?

@ghost
Copy link

ghost commented Jul 4, 2022

how is possible generate each time new address for Bech32 can some one share code?

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