Base58check

1.0.2 · active · verified Fri Apr 17

This library provides functions for Base58check encoding and decoding of binary data, commonly used in cryptocurrencies like Bitcoin. It is currently at version 1.0.2 and maintains a stable, low-cadence release cycle.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates encoding a byte string and decoding it back, along with a simple example of a Bitcoin-like address encoding pattern.

import base58check

# Encode binary data
original_data = b"Hello, Base58Check!"
encoded_string = base58check.b58encode(original_data)
print(f"Encoded: {encoded_string}")

# Decode a Base58Check string
decoded_data = base58check.b58decode(encoded_string)
print(f"Decoded: {decoded_data}")

# Example with a Bitcoin-like address (simulated for demonstration)
simulated_address_bytes = b'\x00' + b'\x01\x09\x66\x77\x60\x06\x95\x3D\x55\x67\x43\x9E\x5E\x39\x8E\x8B\x0D\x9C\x1C\x00\x10' # Example payload
simulated_address_encoded = base58check.b58encode(simulated_address_bytes)
print(f"Simulated Address: {simulated_address_encoded}")

view raw JSON →