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

[FEATURE]: verify checksum in CheckIsValidAddress #37

Open
1 task done
joticajulian opened this issue Nov 17, 2022 · 2 comments
Open
1 task done

[FEATURE]: verify checksum in CheckIsValidAddress #37

joticajulian opened this issue Nov 17, 2022 · 2 comments
Labels
enhancement New feature or request task

Comments

@joticajulian
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

New feature

Verify the checksum in CheckIsValidAddress:

func CheckIsValidAddress(s string) bool {

The address has 25 bytes, consisting of 3 parts:

  • prefix: 1 byte
  • data: 20 bytes
  • checksum: 4 bytes

Verify this:

  • The prefix must be 0 (for P2PKH addresses)
  • checksum must be equal to first 4 bytes of sha256(sha256(prefix + data))

Reference:
https://medium.com/coinmonks/how-to-generate-a-bitcoin-address-step-by-step-9d7fcbf1ad0b

Anything else?

No response

@joticajulian joticajulian added the enhancement New feature or request label Nov 17, 2022
@sgerbino
Copy link
Member

Related to #33.

@koinos-ci
Copy link

This issue is stale because it has been open for 30 days with no activity.

@mvandeberg mvandeberg added task and removed stale labels Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request task
Projects
None yet
Development

No branches or pull requests

4 participants