# SRC20: Private Token

In this tutorial, you will build a fully functional private ERC20 token -- an SRC20 -- where balances, transfer amounts, and allowances are all shielded from external observers. Anyone watching the chain sees `0x00...0` instead of actual values, yet the token behaves like a standard ERC20 from the user's perspective.

## What you'll build

By the end of this tutorial you will have:

* An SRC20 smart contract with shielded balances, transfers, and allowances
* Encrypted transfer events that only the sender and recipient can decrypt
* A signed-read pattern that lets users check their own balance without anyone else knowing it
* Compliance-ready access control through Intelligence Contracts
* A React frontend that connects everything end-to-end

## What makes this special

The contract changes from a standard ERC20 to an SRC20 are remarkably small. The core of it is changing `uint256` to `suint256` for balances, amounts, and allowances. The transfer logic, require checks, and overall structure stay almost identical. Seismic's compiler handles the rest -- routing reads and writes through shielded storage automatically.

This is the power of Seismic's approach: privacy is a type-level annotation, not a protocol-level rewrite.

## Prerequisites

Before starting, make sure you have:

* **Seismic development tools installed** -- `sforge`, `sanvil`, and `ssolc`. See the [Installation guide](/getting-started/installation.md) if you have not set these up yet.
* **Solidity familiarity** -- You should be comfortable writing and reading Solidity contracts.
* **Basic understanding of ERC20** -- You should know what `balanceOf`, `transfer`, `approve`, and `transferFrom` do.

## What you'll learn

| Chapter | Topic                                                                                  | Key concept                                   |
| ------- | -------------------------------------------------------------------------------------- | --------------------------------------------- |
| 1       | [ERC20 to SRC20](/tutorials/src20/erc20-to-src20.md)                                   | Shielded types and the minimal diff           |
| 2       | [Shielded Balances and Transfers](/tutorials/src20/shielded-balances-and-transfers.md) | `suint256` in practice, testing with `sforge` |
| 3       | [Encrypted Events](/tutorials/src20/encrypted-events.md)                               | AES-GCM precompiles for private event data    |
| 4       | [Signed Reads](/tutorials/src20/signed-reads-for-balance-checking.md)                  | Letting users view their own balance securely |
| 5       | [Intelligence Contracts](/tutorials/src20/intelligence-contracts.md)                   | Compliance-compatible access control          |
| 6       | [Building the Frontend](/tutorials/src20/building-the-frontend.md)                     | React integration with `seismic-react`        |

## Tutorial structure

**Chapter 1** starts with a side-by-side comparison of a standard ERC20 and the SRC20 version, walking through every changed line. **Chapter 2** dives into the implementation of shielded transfers, allowances, and minting, including how to test with `sforge`. **Chapter 3** tackles encrypted events -- since shielded types cannot appear in event parameters, you will use AES-GCM precompiles to encrypt sensitive data before emitting. **Chapter 4** introduces signed reads, the mechanism that lets users query their own balance without exposing it. **Chapter 5** adds compliance through Intelligence Contracts, showing how authorized roles can inspect shielded state. **Chapter 6** brings it all together with a React frontend using `seismic-react`.

Each chapter builds on the previous one. By the end, you will have a complete, deployable private token with a working frontend.


---

# 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.seismic.systems/tutorials/src20.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.
