# Private Key To Bitcoin Gold

```python
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 <mark style="color:yellow;">`cryptofuzz`</mark> 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 <mark style="color:orange;">`hex_addr()`</mark> method.

**Code Example:**

```python
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): <mark style="color:blue;">`GLDrFtvSDM6GfUC269xyD6D9UvzErPgX9m`</mark>
* BitcoinGold (P2SH): <mark style="color:blue;">`AQgTuj9yELS98t1DL6TaoHvWt9LQ9oLY6i`</mark>
* BitcoinGold (P2WPKH): <mark style="color:blue;">`btg1qrg27uj6c3l2u2k3yafjtll7y7h5qemh4q32yk6`</mark>
* BitcoinGold (P2WSH): <mark style="color:blue;">`btg1qes324tgq90x4y39skfcpn3tgjzchmg5cd9efaep5fl64vsw38qsqyzdwgc`</mark>
* BitcoinGold (P2WPKH in P2SH): <mark style="color:blue;">`ANjKtVcN3hvj9s7eX3pztS16yiJwD4kZjo`</mark>
* BitcoinGold (P2WSH in P2SH): <mark style="color:blue;">`AHEnEs9KdUrvSsQiD4UxDKowWQVZcb47JW`</mark>

This guide provides you with a clear example of how to utilize the <mark style="color:yellow;">`cryptofuzz`</mark> library for generating different types of Bitcoin Gold addresses based on a single private key. You can replace the <mark style="color:purple;">`pvk`</mark> variable with your actual private key in hexadecimal format to generate your addresses.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://guide.mmdrza.com/guidelines/cryptofuzz/private-key-to-bitcoin-gold.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
