# Bitcoin Address Tool

Derive Bitcoin P2PKH, P2SH-P2WPKH, P2WPKH addresses and WIF from a secp256k1 private key. Supports hex or WIF input, mainnet and testnet.

## Run it

- **CLI:** `gizza tool bitcoin-address "0000000000000000000000000000000000000000000000000000000000000001"`
- **Web:** https://gizza.ai/tools/bitcoin-address/
- **Agents:** machine-readable descriptor (parameters JSON Schema) at https://gizza.ai/tools/bitcoin-address/tool.json

## Inputs

- `key` — Private key (hex or WIF) _(field)_
- `network` — Network for hex input _(field)_
- `compressed` — Compressed public key / WIF _(field)_

## Output

- Derived addresses (text)

## Query parameters

Open the tool pre-filled and auto-run via URL:

- `key` — Private key (hex or WIF)
- `network` — Network for hex input
- `compressed` — Compressed public key / WIF

Example: `https://gizza.ai/tools/bitcoin-address/?key=0000000000000000000000000000000000000000000000000000000000000001&network=mainnet&compressed=true`

---

## What this tool does

Paste an existing Bitcoin secp256k1 private key and derive the standard address
formats and WIF export locally. The tool accepts either a 32-byte hex private key
or a WIF string. For hex input you choose mainnet or testnet and whether the
public key should be compressed. For WIF input, the embedded network and
compression flag are detected from the WIF itself.

The output includes the private key hex, WIF, public key hex, HASH160, legacy
P2PKH address, wrapped SegWit P2SH-P2WPKH address, and native SegWit P2WPKH
address when the key is compressed.

## Address formats

| Format | Mainnet prefix | Testnet prefix | Notes |
| --- | --- | --- | --- |
| P2PKH legacy | `1…` | `m…` or `n…` | Hash160 of the selected public-key encoding, Base58Check |
| P2SH-P2WPKH wrapped SegWit | `3…` | `2…` | Hash160 of the v0 witness redeem script, Base58Check |
| P2WPKH native SegWit | `bc1q…` | `tb1q…` | Bech32 witness v0 program |
| WIF | `K…`/`L…` or `5…` | `c…` or `9…` | Base58Check private-key export |

SegWit address formats require compressed public keys. If you derive from an
uncompressed key, the tool returns the P2PKH address and WIF, and explains why
P2SH-P2WPKH/P2WPKH are not emitted.

## Example

Private key `0000000000000000000000000000000000000000000000000000000000000001`
with mainnet + compressed produces:

- P2PKH: `1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH`
- WIF: `KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn`
- Native SegWit: a `bc1q…` P2WPKH address

## FAQ

<details>
<summary>Does this generate a new Bitcoin private key?</summary>

No. It derives addresses from a private key you already provide. If you need a
fresh random wallet keypair, use the wallet keypair generator instead.

</details>

<details>
<summary>Is my private key uploaded?</summary>

No. The derivation runs locally in your browser or CLI using pure Rust code. Treat
private keys carefully anyway: avoid pasting real production funds into any tool
you do not control.

</details>

<details>
<summary>Why are SegWit addresses missing for an uncompressed key?</summary>

P2SH-P2WPKH and P2WPKH spend paths are defined for compressed public keys. For an
uncompressed key the tool returns the legacy P2PKH address and WIF, then marks the
SegWit fields as requiring a compressed key.

</details>

<details>
<summary>Can I use WIF input?</summary>

Yes. WIF is decoded with Base58Check. Its version byte selects mainnet or testnet,
and its optional compression flag selects compressed or uncompressed public-key
handling, overriding the page controls.

</details>

## Related tools

- [Bech32 / Bech32m Encoder & Decoder](https://gizza.ai/tools/bech32-codec/): Encode and decode checksummed Bech32 and Bech32m strings (HRP + data) as used by SegWit, Taproot, Lightning and Nostr. Free, private, browser-local.
- [ECDSA secp256k1 sign & verify](https://gizza.ai/tools/ecdsa-secp256k1/): Generate secp256k1 keypairs and sign or verify messages with ECDSA (the Bitcoin/Ethereum curve). RFC 6979 deterministic, DER + compact — in your browser.
- [BIP32 HD Key Derivation](https://gizza.ai/tools/hd-key-derive/): Derive BIP32 child private keys, xpubs, WIF keys, and Bitcoin mainnet/testnet P2PKH or SegWit addresses from a seed or xprv. Private and offline in your browser.
- [AES cipher](https://gizza.ai/tools/aes-cipher/): Encrypt or decrypt text with AES in CBC, CTR, GCM or ECB mode and 128/192/256-bit keys, with hex/base64 I/O — in your browser. Nothing is uploaded.
- [AES Key Wrap](https://gizza.ai/tools/aes-key-wrap/): Wrap and unwrap cryptographic keys with AES Key Wrap (KW / RFC 3394, KWP / RFC 5649) using a 128/192/256-bit KEK — hex or base64, free and in-browser.
