Closed Emyrk closed 11 months ago
thank you for the report @Emyrk, I'll apply this fix as soon as possible and release a new version.
Thanks! I was going to open a PR, but the requirement of base58 is annoying since golang does not support it natively.
With your no deps in go.mod, it has to be implemented here :cry:
Fixed in #153 by simplifying the way bitcoin and etherium addresses are generated.
Describe the bug
Bitcoin keys use base58 check (see https://en.bitcoin.it/wiki/Base58Check_encoding, for example: https://gobittest.appspot.com/Address). Addresses generated by this package are not valid Bitcoin addresses since their checksums are invalid.
The generator just generates random base58 text. I implemented a function that can fix checksums of a randomly generated address, it just requires base58 encode/decode. You can copy this small implementation into the
Faker
lib to not need togo get
it: https://github.com/akamensky/base58/blob/master/base58.go. Or implement it yourself.If base58 is in this package, I can make a PR that runs all bitcoin generated addressed through a checksum fix function and make sure they are valid.
To Reproduce
https://go.dev/play/p/No5BYCcsUk4
Expected behavior
The address should pass the CheckDecode