> 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/hash-functions.md).

# Legacy - Hash Functions

### Introduction

There are three primitive elements found in BSV: Hash Functions, Merkle Trees, and Digital Signatures. If you take the time to learn these three primitives well, you will likely find the learning curve to understanding these systems significantly reduced. The focus of this course is Hash functions.

We examine what hash functions are, the hash functions used in BSV, how hash functions are used in BSV, why double hashing is used in BSV, and the role hash functions play in BSV's security model. BSV makes use of two hash functions: SHA-256 and RIPEMD-160.

There is example code in various parts of the course, and two example hash function implementations all written using the Go programming language. These examples are simply meant to aid in understanding the course material; knowing how to read and write code is not required to complete this course.\
\
\&#xNAN;***However, although it is not necessary to understand and complete the course, some familiarity with command line or terminal environments and programming is assumed with respect to the example code presented in the course.***

Installation of Supporting Libraries Quick-Start: GoLang

You can install Go for your operating system from the official Go website: <https://go.dev/doc/install>

Once you have Go installed, create a new directory and initialize a new Go module using the following command:

```markup
go mod init github.com/[your username]/bsv-examples
```

The examples in this course also utilize the official BSV libsv Go libraries which you can add to your module using the following commands:

```markup
go get github.com/libsv/go-bt
go get github.com/libsv/go-bk
​​​​​​​go get github.com/libsv/go-bc
```


---

# 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 dynamically by asking a question.

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

```
GET https://hub.bsvblockchain.org/higher-learning/bsv-academy/hash-functions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
