> For the complete documentation index, see [llms.txt](https://hub.bsvblockchain.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hub.bsvblockchain.org/higher-learning/bsv-academy/bitcoin-primitives-hash-functions/ripemd-160-overview/what-is-a-bsv-address-and-a-wif.md).

# What is a BSV Address and a WIF?

&#x20;

<figure><img src="https://3421145409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRTEKu4E7Fvtss3GI9CYU%2Fuploads%2F5fChxv2ZIIdlY53Zlr5o%2Ftransaction_verification.svg?alt=media&amp;token=9f0a3db8-f1b8-4931-b6ea-9262bc3ec747" alt=""><figcaption></figcaption></figure>

## What is a BSV Address and a WIF?

#### What is a BSV Address?

A **BSV address** is simply a **human-readable identifier** that represents where satoshis can be sent.

Technically, it is built as follows:

1. Start with the **public key** from an ECDSA key pair.
2. Take the **compressed x-coordinate** of that public key.
3. Apply **SHA-256**, then **RIPEMD-160** → this gives the **Public-Key-Hash**.
4. Add a **version byte**.
5. Encode using **Base58Check** to make it shorter, readable, and error-checked.

👉 In **Pay-to-Public-Key-Hash (P2PKH)** transactions, the BSV address is the **message digest** (the “Public-Key-Hash”) to which satoshis are locked.

***

#### What is a WIF?

A **WIF (Wallet Import Format) key** is a way to **encode private keys** for easy transfer between wallets.

* Like addresses, WIFs also use **Base58Check encoding**.
* Instead of a public key hash, a WIF encodes the **private key’s serialised value (d)**.
* Unlike addresses, WIFs do **not use HASH-160**.

👉 **Key takeaway:**

* **Addresses** = Public side (where funds are received).
* **WIFs** = Private side (used to import/export keys securely).

***

#### Example: Generating a Key Pair in GoLang

Using the **libsv libraries**, you can generate a Bitcoin ECDSA public-private key pair:

```
package main 

import ( 
    "fmt" 
    "github.com/libsv/go-bk/bec" 
    "github.com/libsv/go-bt/v2/bscript" 
) 

func main() { 
    privKey, _ := bec.NewPrivateKey(bec.S256()) 
    pubKey := privKey.PubKey() 
    fmt.Println("Private Key:", privKey) 
    fmt.Println("Public Key:", pubKey) 
}
```

&#x20;

✅ **Summary:**

* A **BSV address** = **HASH-160 of the public key**, formatted with Base58Check, used in transactions.
* A **WIF** = Base58Check encoding of the **private key**, making wallets portable and user-friendly.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hub.bsvblockchain.org/higher-learning/bsv-academy/bitcoin-primitives-hash-functions/ripemd-160-overview/what-is-a-bsv-address-and-a-wif.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
