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

Address.fromPublicKey is returning wrong address #425

Open
wisammechano opened this issue Nov 4, 2024 · 0 comments
Open

Address.fromPublicKey is returning wrong address #425

wisammechano opened this issue Nov 4, 2024 · 0 comments

Comments

@wisammechano
Copy link

wisammechano commented Nov 4, 2024

In random testing of this tool, I found out that it generated the wrong address for the following:

public key: 02b9e58a925566151f0c168980b36b4c5815c0b85f226f590d16a00467e0b037da
hash160: 00b3fed5f2135a0f3f6ac65e67ecf3b0239d9cfb
generated address: 14idJbAR6gZ8A5zMqTHF28RxU8w2DE9ui
expected address: 114idJbAR6gZ8A5zMqTHF28RxU8w2DE9ui

I believe the generated address is not padding with 1 when the first byte in the hash is 00.

Thankfully, this doesn't affect the search algorithm as it compares hash160 to hash160 but it is worth noting that anywhere the Address.fromPublicKey() function is used, it can potentially display a wrong address.

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