# 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](https://docs.hypertensor.org/build-a-subnet/protocols)), and a commit-reveal scheme utilizing the [DHT Records](https://docs.hypertensor.org/subnet-template/dht-records) with a [record validator](https://docs.hypertensor.org/subnet-template/dht-records/record-validator).

***

## 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](https://docs.hypertensor.org/build-a-subnet/protocols)

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

### [Consensus](https://docs.hypertensor.org/network/consensus)

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](https://docs.hypertensor.org/build-a-subnet/consensus/scoring) mechanism.

***

## Security

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

See [Subnet Security](https://docs.hypertensor.org/build-a-subnet/subnet-security) 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.
