MMDRZA Guideline Portal
HomeProductsGithub
  • Guide
    • Install Python
    • Rich Address Downloader
    • Code Signing
      • How to Sign an .exe File in Windows
  • Cryptofuzz
    • Example
      • 🗝️Decimal
      • 📝Mnemonic
      • 🔐Private Key (HEX)
      • 🔑Private Key (Wif)
    • Private Key To Bitcoin
    • Private Key To Ethereum
    • Private Key to Tron (trx)
    • Private Key To Dogecoin
    • Private Key To DASH
    • Private Key To Litecoin
    • Private Key To Bitcoin Gold
    • Private Key To Digibyte
    • Private Key To Ravencoin
  • SECP256K2
    • Profile Test
    • Decimal To Private Key (Wif)
    • Decimal to Address
    • Decimal To Ethereum
    • Decimal to RIPEMD160
    • wif Private Key To Private Key (hex)
    • Convert Private Key To Wif Compressed and Uncompressed
    • Wif to Decimal
    • Private Key (decimal) To RIPEMD160 (h160)
    • Decimal To Compressed and uncompressed Address
Powered by GitBook
On this page

Was this helpful?

  1. Cryptofuzz

Private Key To Bitcoin Gold

convert Private key hex to all address bitcoin gold

from cryptofuzz import BitcoinGold
# private key hex
pvk = "db6fae9db7f5314e1249390b8e38a91a6dff98c655f25a6bf01f8619f2b70e65"
# bitcoin gold class
btg = BitcoinGold()
# bitcoin gold address
btg_p2pkh = btg.hex_addr(pvk, Type="p2pkh") # or btg.hex_addr(pvk)
btg_p2sh = btg.hex_addr(pvk, Type="p2sh")
btg_p2wpkh = btg.hex_addr(pvk, Type="p2wpkh")
btg_p2wsh = btg.hex_addr(pvk, Type="p2wsh")
btg_p2wpkh_p2sh = btg.hex_addr(pvk, Type="p2wpkh_p2sh")
btg_p2wsh_p2sh = btg.hex_addr(pvk, Type="p2wsh_p2sh")
print(f"BitcoinGold (P2PKH): {btg_p2pkh}")
print(f"BitcoinGold (P2SH): {btg_p2sh}")
print(f"BitcoinGold (P2WPKH): {btg_p2wpkh}")
print(f"BitcoinGold (P2WSH): {btg_p2wsh}")
print(f"BitcoinGold (P2WPKH in P2SH): {btg_p2wpkh_p2sh}")
print(f"BitcoinGold (P2WSH in P2SH): {btg_p2wsh_p2sh}")
# output
# BitcoinGold: GLDrFtvSDM6GfUC269xyD6D9UvzErPgX9m
# BitcoinGold (P2PKH): GLDrFtvSDM6GfUC269xyD6D9UvzErPgX9m
# BitcoinGold (P2SH): AQgTuj9yELS98t1DL6TaoHvWt9LQ9oLY6i
# BitcoinGold (P2WPKH): btg1qrg27uj6c3l2u2k3yafjtll7y7h5qemh4q32yk6
# BitcoinGold (P2WSH): btg1qes324tgq90x4y39skfcpn3tgjzchmg5cd9efaep5fl64vsw38qsqyzdwgc
# BitcoinGold (P2WPKH in P2SH): ANjKtVcN3hvj9s7eX3pztS16yiJwD4kZjo
# BitcoinGold (P2WSH in P2SH): AHEnEs9KdUrvSsQiD4UxDKowWQVZcb47JW

Generating Bitcoin Gold Addresses

In this example, we demonstrate how to generate various types of Bitcoin Gold addresses using a given private key and the cryptofuzz library. The types of addresses we explore include P2PKH, P2SH, P2WPKH, P2WSH, P2WPKH in P2SH, and P2WSH in P2SH addresses. The process is straightforward and requires specifying the type of address you desire when calling the hex_addr() method.

Code Example:

from cryptofuzz import BitcoinGold
# Replace 'pvk' with your own private key in hexadecimal format
pvk = "your_private_key_here"
btg = BitcoinGold()
# Generate different types of Bitcoin Gold addresses from the private key
btg_p2pkh = btg.hex_addr(pvk, Type="p2pkh")
btg_p2sh = btg.hex_addr(pvk, Type="p2sh")
btg_p2wpkh = btg.hex_addr(pvk, Type="p2wpkh")
btg_p2wsh = btg.hex_addr(pvk, Type="p2wsh")
btg_p2wpkh_p2sh = btg.hex_addr(pvk, Type="p2wpkh_p2sh")
btg_p2wsh_p2sh = btg.hex_addr(pvk, Type="p2wsh_p2sh")

Output Example:

  • BitcoinGold (P2PKH): GLDrFtvSDM6GfUC269xyD6D9UvzErPgX9m

  • BitcoinGold (P2SH): AQgTuj9yELS98t1DL6TaoHvWt9LQ9oLY6i

  • BitcoinGold (P2WPKH): btg1qrg27uj6c3l2u2k3yafjtll7y7h5qemh4q32yk6

  • BitcoinGold (P2WSH): btg1qes324tgq90x4y39skfcpn3tgjzchmg5cd9efaep5fl64vsw38qsqyzdwgc

  • BitcoinGold (P2WPKH in P2SH): ANjKtVcN3hvj9s7eX3pztS16yiJwD4kZjo

  • BitcoinGold (P2WSH in P2SH): AHEnEs9KdUrvSsQiD4UxDKowWQVZcb47JW

This guide provides you with a clear example of how to utilize the cryptofuzz library for generating different types of Bitcoin Gold addresses based on a single private key. You can replace the pvk variable with your actual private key in hexadecimal format to generate your addresses.

PreviousPrivate Key To LitecoinNextPrivate Key To Digibyte

Last updated 1 year ago

Was this helpful?