# 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: 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://hub.bsvblockchain.org/higher-learning/bsv-academy/hash-functions.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.
