1200wd / bitcoinlib

Bitcoin and other Cryptocurrencies Library for Python. Includes a fully functional wallet, Mnemonic key generation and management and connection with various service providers to receive and send blockchain and transaction information.
http://bitcoinlib.readthedocs.io/
GNU General Public License v3.0
615 stars 204 forks source link

Support custom altcoins #239

Closed yupasik closed 2 years ago

yupasik commented 2 years ago

Hello, is there any simple way to add altcoins networks definitions? Thanks

mccwdev commented 2 years ago

You can add new coin definitions in data/networks.json.

For example for dogecoin:

  "dogecoin":
  {
    "description": "Dogecoin",
    "currency_name": "dogecoin",
    "currency_name_plural": "dogecoins",
    "currency_symbol": "Ð",
    "currency_code": "DOGE",
    "prefix_address": "1E",
    "prefix_address_p2sh": "16",
    "prefix_bech32": "doge",
    "prefix_wif": "9E",
    "prefixes_wif": [
      ["0488B21E", "xpub", "public",  false, "legacy",      "p2pkh"],
      ["0488B21E", "xpub", "public",  true,  "legacy",      "p2sh"],
      ["0488ADE4", "xprv", "private", false, "legacy",      "p2pkh"],
      ["0488ADE4", "xprv", "private", true,  "legacy",      "p2sh"]
    ],
    "bip44_cointype": 3,
    "denominator": 0.00000001,
    "dust_amount": 1000,
    "fee_default": 200000000,
    "fee_min":     1000000,
    "fee_max":   10000000000,
    "priority": 10
  },

But of course when the altcoin is not a close relative of bitcoin. there will need to be some code changes as well.