Skip to content

Conversation

@alias-bitsignal
Copy link

Main Info

  • Added Bismuth (BIS) cryptocurrency support (SLIP-0044 = 209), based on the secp256k1 curve.
  • Implemented multi-byte Base58Check version prefixes for Bismuth addresses.
  • Added full test coverage (tests/test_bismuth.py) — all 7/7 tests passing.
  • Integrated into hdwallet/init.py for export and discovery.
  • Verified on Python 3.8, 3.9, and 3.10 — no compatibility issues found.

Example Usage (BIP-44)

from hdwallet import HDWallet
from hdwallet.cryptocurrencies import Bismuth
from hdwallet.hds import BIP44HD
from hdwallet.mnemonics import BIP39Mnemonic
from hdwallet.derivations import BIP44Derivation, CHANGES

MNEMONIC = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"

hdwallet = (
    HDWallet(cryptocurrency=Bismuth, hd=BIP44HD, network=Bismuth.NETWORKS.MAINNET)
    .from_mnemonic(BIP39Mnemonic(MNEMONIC))
    .from_derivation(
        BIP44Derivation(
            coin_type=Bismuth.COIN_TYPE,  # 209
            account=0,
            change=CHANGES.EXTERNAL_CHAIN,
            address=(0, 1),
        )
    )
)

leaf = max(hdwallet.dumps(exclude={"root", "indexes"}), key=lambda r: r["at"]["path"].count("/"))
print("Path:", leaf["at"]["path"])
print("Address:", leaf["address"])

Example Output of the above Code

Path: m/44'/209'/0'/0/0
Address: Bis1LenEHPex4WwY3BLxFGRmxNtsvKqgxkSbh

Verification

  • pytest -q tests/test_bismuth.py → 7 passed
  • Address derivation matches Bismuth mainnet prefix (Bis1)
  • Testnet address derivations prefixed with tBis
  • Correct Base58Check encoding/decoding with multi-byte version guard
  • Address validator correctly accepts and rejects checksums
  • Compatible with HDWallet API and BIP44Derivation

Files Changed

  • hdwallet/cryptocurrencies/bismuth.py → new file
  • hdwallet/cryptocurrencies/__init__.py → added Bismuth export
  • tests/test_bismuth.py → new test suite

Notes
Bismuth support now aligns with the standard BIP-44 hierarchy:
m / 44' / 209' / 0' / 0 / 0

@meherett meherett added the cryptocurrency New cryptocurrency to add label Nov 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cryptocurrency New cryptocurrency to add

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants