# Introduction

{% hint style="success" %}
The decentralized subnet template, named the Subnet Template, is tested in a Linux environment, but should be able to be built in a macOS environment. The Windows environment may require further development. For Windows environments, use WSL.
{% endhint %}

## GitHub

<https://github.com/hypertensor-blockchain/subnet-template>&#x20;

## Introduction

At the heart of the **Hypertensor** platform is a simple but powerful ethos: every **subnet** should operate as a fully decentralized peer-to-peer (P2P) network. These subnets sit at the intersection of **blockchain** and **AI—not** to be confused with the Hypertensor blockchain itself — and provide a robust foundation for building decentralized AI-native applications.

Each **Hypertensor subnet** leverages the same foundational technologies that power leading blockchain ecosystems. This includes **libp2p**, the modular P2P networking stack used by major chains like Ethereum, Base, Arbitrum, Polkadot, Avail, Unichain, Hypertensor, applications like IPFS, and hundreds of other blockchains and decentralized applications. For a full list of libp2p adopters, see the [official list of libp2p builders](https://docs.libp2p.io/concepts/introduction/users/).

By combining blockchain-grade peer-to-peer (P2P) infrastructure with AI-native capabilities, Hypertensor subnets enable developers to create fully decentralized, intelligent applications.

You can think about subnets like **blockchains designed for AI**. **All computational limitations** related to gas and block weight **have been removed, allowing for AI applications to be built in decentralized networks.**

## Getting Started

This documentation will focus on building a subnet over the SubnetTemplate.

As a builder, the primary focus is on building the application logic and how nodes will be able to form consensus and score each other.

In the inference-subnet (an example subnet), the focus is on the Inference Protocol (see [protocols](/build-a-subnet/protocols.md)), and a commit-reveal scheme utilizing the [DHT Records](/subnet-template/dht-records.md) with a [record validator](/subnet-template/dht-records/record-validator.md).

***

## Start building:

#### Clone the template:

```bash
git clone https://github.com/hypertensor-blockchain/subnet-template.git
cd subnet-template
python -m venv .venv
source .venv/bin/activate
pip install .
touch .env
```

Review the `.env.example` file and fill out the variables required to use the subnet and network.

Building a subnet revolves around two main points: protocols and consensus. Everything else is built-in and ready to go.

* Protocols
* Consensus

***

## Build

### [Protocols](/build-a-subnet/protocols.md)

Protocols are where the application logic lives and how nodes communicate with each other. Call inference on nodes, run automated tasks, and more!

### [Consensus](/network/consensus.md)

Consensus is where nodes score each other, and it runs in parallel to the Hypertensor consensus mechanism for validating and attesting. This is also where you will build the [scoring](/build-a-subnet/consensus/scoring.md) mechanism.

***

## Security

Because subnets are decentralized, security is important. There are two basic tools the template offers for security.

See [Subnet Security](/build-a-subnet/subnet-security.md) for more information.

### Authorizers

Authorizers is handshake logic between two peers.

### Record Validators

Record validators validate data between peers on both `GET` (to retrieve data from peers) and `PUT` (to store data) requests.


---

# 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://docs.hypertensor.org/build-a-subnet/introduction.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.
