The logic you followed is correct but things can be done better knowing that there is a package to decode and encode in base58 and it's called base python -m pip install base58 Here below is simple way to get the ripemd hash of a bitcoin address coded in base58 (python ). class InvalidBase58Error (Base58Error): """Raised on generic invalid base58 data, such as bad characters. Checksum failures raise Base58ChecksumError specifically. The Base58 symbol chart used in Bitcoin is specific to the Bitcoin project and is not intended to be the same as any other Base58 implementation used outside the context of Bitcoin (the characters excluded are: 0, O, I, and l). The algorithm for encoding address_byte_string (consisting of 1-byte_version + hash_or_other_data + 4-byte_check_code) is.
Bitcoin base58 pythonBitcoin Base58 Encoder, Decoder, and Validator
Mar 8, Jan 5, Nov 17, Nov 12, Oct 22, Sep 17, Sep 15, Aug 1, Jul 16, Apr 6, Mar 23, Mar 22, Mar 18, Mar 10, Nov 15, Download the file for your platform.
Please try enabling it if you encounter problems. Search PyPI Search. Latest version Released: Jan 11, Python Bitcoin Tools.
Navigation Project description Release history Download files. Project links Homepage. I'm trying to create a Bitcoin address with Python. I got the hashing part right, but I have some trouble with the Base58Check encoding.
I use this package:. That said, my output is wrong and obviously too long. Does anyone know what I did wrong? Fixed it now thanks to Arpegius. Added str bytearray. In base You need to decode it first:. Learn more. Base58Check encoding for Bitcoin addresses too long Ask Question.
Asked 6 years, 8 months ago. Active 6 years, 8 months ago. Viewed 5k times. EDIT: I added a decoding to hex. Does it have to be a byte encoding? How do you do that in Python? You need to decode it first. Active Oldest Votes. Arpegius Arpegius 5, 31 31 silver badges 51 51 bronze badges.