# 📚INTRODUCTION

Welcome to the official documentation for TAN, a cutting-edge ***Block Per Reward Proof-of-Stake (BPoS)*** blockchain designed to offer a sustainable, secure, and efficient decentralized ecosystem. TAN operates with its native cryptocurrency, TAN, which is at the heart of our innovative blockchain network.

Our blockchain leverages the ***Block Per Reward Proof-of-Stake (BPoS)*** consensus mechanism to validate transactions, ensuring energy efficiency and enhanced security compared to traditional ***Proof-of-Work (PoW)*** systems. One of the standout features of the TAN blockchain is its halving mechanism, which occurs every four years. This halving process reduces the block rewards by half, promoting scarcity and potentially increasing the value of TAN over time.

The purpose of this GitBook is to provide our users and the wider community with comprehensive information about the TAN blockchain. Whether you're a developer looking to integrate with our platform, a user interested in staking TAN, or a community member wanting to understand the technical intricacies of our system, you'll find detailed guidance and resources here.

Join us as we explore the world of TAN and uncover the potential of blockchain technology to revolutionize industries and empower individuals. Welcome to the TAN community!


# BASIC KNOWLEDGE


# 🌐⛓️What is Blockchain

**Blockchain** is a revolutionary technology that underpins decentralized digital currencies like **(TAN)** and many other applications across various industries. At its core, a blockchain is a distributed ledger that records transactions in a secure, transparent, and immutable manner.\ <br>

## **# Key Features** of **Blockchain**

1. **Decentralization:** Unlike traditional centralized databases, a blockchain is maintained by a network of nodes (computers) spread across different locations. This decentralized nature eliminates the need for a central authority, enhancing security and trust.
2. **Immutability:** Once a transaction is recorded on the blockchain, it cannot be altered or deleted. This immutability is achieved through cryptographic hashing, which ensures that any attempt to change the data would be easily detected by the network.
3. **Transparency:** Every transaction on the blockchain is visible to all participants in the network. This transparency builds trust among users, as anyone can verify transactions independently.
4. **Security:** Blockchain uses advanced cryptographic techniques to secure data. Transactions are grouped into blocks and linked together in a chain, making it extremely difficult for malicious actors to alter historical records.

## #How Blockchain Works

* **Transactions:** When a user initiates a transaction, it is broadcast to the entire network of nodes. Each node validates the transaction based on predefined rules and cryptographic algorithms.
* **Blocks:** Validated transactions are grouped together into a block. Each block contains a list of transactions, a timestamp, a reference to the previous block, and a unique hash.
* **Consensus:** Nodes in the network must agree on the validity of the new block before it is added to the blockchain. Different consensus mechanisms, such as **Block Per Reward Proof-of-Stake (BPoS)**  used by TAN , ensure this agreement is reached efficiently and securely.
* **Chain:** Once a block is validated and added to the blockchain, it becomes a permanent part of the ledger. Each new block is linked to the previous one, forming a continuous chain of blocks.

## Importance of Blockchain

**Blockchain** technology has the potential to transform various sectors, including **Finance, Supply Chain, Healthcare,** and more. Its ability to provide Secure, Transparent, and Decentralized solutions makes it an ideal choice for applications requiring trust and integrity.

In the context of **TAN,** our blockchain leverages these fundamental principles to create a robust and efficient ecosystem for our users and developers. Understanding the basics of blockchain is essential for anyone looking to engage with our platform and harness the power of decentralized technology.


# EVM

The Ethereum Virtual Machine (EVM) is a critical component of the Ethereum blockchain and has become a standard for many other blockchain platforms, including TAN. Understanding the EVM is essential for developers and users who want to interact with smart contracts and decentralized applications (DApps) on the TAN blockchain.<br>

## What is EVM ?

The EVM is a decentralized computing environment that runs on the Ethereum network and compatible blockchains. It acts as a global supercomputer where developers can deploy and execute smart contracts. Smart contracts are self-executing contracts with the terms directly written into code, and they run exactly as programmed without any possibility of downtime, censorship, fraud, or third-party interference.

## Key Features of EVM

1. **Turing-Complete:**&#x54;he EVM is **Turing-complete**, meaning it can execute any computation that can be done by a traditional computer, given enough resources. This capability allows developers to create complex and sophisticated smart contracts.
2. **Isolation:** The EVM runs smart contracts in a completely isolated environment. This isolation ensures that the execution of one contract does not affect others and that the blockchain remains secure even if individual contracts contain bugs or vulnerabilities.
3. **Bytecode Execution:** Smart contracts on the EVM are written in high-level programming languages like Solidity and then compiled into bytecode. The EVM executes this bytecode, allowing the contracts to interact with the blockchain.
4. **Gas Mechanism:** To prevent abuse of computational resources, the EVM uses a gas system. Gas is a unit that measures the amount of computational effort required to execute operations. Users must pay gas fees to execute contracts, which helps manage network resources and incentivizes efficient coding.

## EVM and TAN

The TAN blockchain is EVM-compatible, meaning it supports the execution of smart contracts written for the Ethereum network. This compatibility allows developers to easily migrate their Ethereum-based DApps and smart contracts to the TAN platform with minimal adjustments.

* **Interoperability:** EVM compatibility ensures that TAN can interact with a wide range of existing tools, libraries, and infrastructure developed for Ethereum. This interoperability accelerates development and integration processes.
* **Developer-Friendly:** By supporting the EVM, TAN provides a familiar environment for developers who are already experienced with Ethereum. This familiarity lowers the learning curve and encourages more developers to build on the TAN blockchain.
* **Enhanced Capabilities:** While leveraging the robustness of the EVM, TAN also incorporates unique features and optimizations that enhance performance and security, offering a superior experience for both developers and users.

## Importance of EVM Compatibility

EVM compatibility is crucial for fostering a vibrant and innovative ecosystem. It allows the TAN blockchain to tap into the extensive developer community and resources of the Ethereum network, fostering rapid growth and adoption. Additionally, it ensures that TAN remains at the forefront of blockchain technology, supporting a wide range of applications from **decentralized finance (DeFi)** to **non-fungible** tokens **(NFTs)** and beyond.

By understanding the EVM, users and developers can better appreciate the capabilities of the TAN blockchain and leverage its full potential to create impactful decentralized solutions.


# 💻Node

In the context of blockchain technology, a node is a crucial component that helps maintain the network's integrity and functionality. Nodes are individual devices (computers) that participate in the blockchain network by following its protocol and rules. Understanding the role and types of nodes is essential for grasping how the TAN blockchain operates.

## What is a Node ?

A **node** is any computer that connects to the blockchain network. Nodes have various roles, including validating transactions, storing blockchain data, and broadcasting information to other nodes. Each node operates independently but cooperatively to ensure the network remains decentralized and secure.

## Types of Nodes

1. **Full Nodes:**

* Full nodes store a complete copy of the blockchain, which includes all historical transactions and blocks.
* They validate and verify all transactions and blocks, ensuring that the rules of the blockchain protocol are strictly followed.
* Full nodes contribute significantly to the network's security and decentralization by providing accurate data and validation services.

2. **Light Nodes (or Lightweight Nodes):**

* Light nodes do not store the entire blockchain. Instead, they download only a portion of the blockchain data, typically the block headers.
* They rely on full nodes for transaction verification and data retrieval, making them less resource-intensive and faster to operate.
* Light nodes are ideal for users with limited storage and computational resources, such as mobile devices and certain DApps.

3. **Validator Nodes:**

* In a Proof-of-Stake (PoS) blockchain , validator nodes play a critical role in block creation and transaction validation.
* Validator nodes are responsible for proposing and validating new blocks. They are selected based on the amount of staked TAN tokens they hold.
* These nodes are incentivized to act honestly by receiving block rewards and transaction fees.

## Functions of Nodes in the TAN Blockchain

* **Transaction Validation**: Nodes check transactions against the blockchain's rules to ensure they are legitimate. This process includes verifying digital signatures and ensuring that the sender has sufficient funds.
* **Block Propagation**: Nodes share information about new transactions and blocks with other nodes. This propagation ensures that all nodes have a consistent and up-to-date view of the blockchain.
* **Consensus Participation**: In **(BPoS)** systems, **validator nodes** participate in the consensus mechanism to agree on the next block to be added to the blockchain. This consensus ensures that the network operates smoothly and securely.
* **Data Storage**: Full nodes maintain a complete copy of the blockchain, which is crucial for the network's transparency and reliability. This storage allows users to verify transactions independently and access historical data.

## Importance of Nodes

**Nodes** are the backbone of the **TAN blockchain,** ensuring its decentralized nature and security. By distributing the responsibilities of **transaction validation**, **data storage**, and consensus across multiple nodes, the TAN network can achieve high levels of reliability and resistance to censorship and attacks.

For users and developers, understanding nodes is vital for interacting with the blockchain effectively. Running a node can also contribute to the network's health and security, offering a way to participate more deeply in the TAN ecosystem.

In summary, nodes play an indispensable role in maintaining the functionality and integrity of the TAN blockchain. Whether you're a user, developer, or enthusiast, appreciating the importance of nodes will enhance your understanding of how blockchain technology works and its potential applications.


# WELCOME TO TAN NETWORK


# 💡About TAN

Welcome to the ***TAN Network*****,** a pioneering blockchain platform designed to provide a secure, efficient, and scalable environment for decentralized applications (DApps) and digital assets. At the heart of the TA&#x4E;**,** our native cryptocurrency ***TAN*****,** which powers the entire ecosystem.

## What is TAN ?

***TAN*** is the native coin of the TAN Network, serving multiple critical functions within our blockchain ecosystem. It acts as the primary medium for transactions, a reward for validators, and a staking asset for securing the network. TAN is integral to the smooth operation and governance of the TAN blockchain.

## Key Features of TAN

1. **Proof-of-Stake (PoS) Consensus:** TAN leverages a ***(BPoS)*** consensus mechanism, which is more energy-efficient and secure compared to traditional ***Proof-of-Stake (PoS)*** systems. Validators are chosen based on the number of TAN tokens they hold and are willing to "**stake**" as collateral, encouraging active participation and network security.
2. **Halving Mechanism**: To promote scarcity and potentially enhance the value of TAN over time, the block rewards for validators are halved ***every four years**.* This halving mechanism controls the supply of new TAN coins, aligning with long-term value growth and economic stability.
3. **Staking and Rewards**: TAN holders can participate in the network's consensus process by staking their tokens. In return, they receive rewards in the form of additional TAN coins. This staking process not only secures the network but also provides an incentive for users to hold and utilize TAN.
4. **Smart Contract Capability**: The TAN Network is ***EVM-compatible***, allowing developers to deploy and interact with smart contracts seamlessly. TAN is used to pay for gas fees associated with executing smart contracts, making it a vital component for developers and users engaging with decentralized applications.

## Use Cases for TAN

* **Transactions**: TAN is used for peer-to-peer transactions within the TAN Network. Users can send and receive TAN quickly and securely, leveraging the blockchain's efficiency.
* **Staking and Validation**: By staking TAN, users can become validators and help secure the network. Validators earn rewards for their participation, contributing to the overall health and stability of the blockchain.
* **Decentralized Applications (DApps)**: Developers can use TAN to power their DApps, paying for computational resources and transaction fees. This utility encourages innovation and the creation of diverse applications on the TAN Network.
* **Governance**: TAN holders have a say in the governance of the TAN Network. Through a decentralized governance model, users can vote on proposals and changes to the network, ensuring that it evolves in a way that benefits the community.

## The Future of TAN

The TAN Network is committed to continuous improvement and innovation. As we grow, we aim to enhance the functionality and adoption of TAN through strategic partnerships, technological advancements, and community engagement. Our vision is to create a thriving ecosystem where TAN is widely used and recognized as a cornerstone of decentralized finance and blockchain technology.

Join us on this exciting journey and become a part of the TAN Network. Together, we can build a decentralized future powered by TAN.


# 🪙TAN (Native Coin of  Tan)

TAN is the native cryptocurrency of the TAN Network, serving as the backbone of our blockchain ecosystem. It plays a crucial role in the network’s operation, incentivizing participants, securing the blockchain, and enabling seamless transactions.

## Key Characteristics of TAN

1. **Utility and Functionality:** TAN is designed to facilitate a wide range of functions within the TAN Network. From paying transaction fees to staking and governance, TAN is essential for engaging with the network’s features.
2. **Scarcity Through Halving**: To maintain scarcity and support value appreciation, TAN follows a halving schedule. Every four years, the block rewards for validators are reduced by half, which decreases the rate at which new TAN coins are introduced into circulation.
3. **Decentralized and Secure**: As a **(BPoS)** blockchain, TAN relies on validators who stake TAN to secure the network. This decentralized approach ensures robust security and minimizes the risk of centralized control or attacks.

## Function and Uses of TAN

* **Transaction Fees**: Users pay transaction fees in TAN for operations on the network. These fees compensate validators for processing and verifying transactions, ensuring smooth and efficient blockchain performance.
* **Staking**: TAN holders can stake their coins to become validators or delegate their stake to other validators. Staking helps secure the network and, in return, stakers earn rewards in TAN.
* **Rewards**: Validators and stakers receive TAN as rewards for their contributions to the network’s security and performance. This reward mechanism incentivizes active participation and long-term commitment to the network.
* **Governance**: TAN empowers holders to participate in the governance of the TAN Network. Through a decentralized voting system, TAN holders can propose and vote on changes, ensuring that the network evolves according to the community’s collective decisions.

## Advantages of Holding TAN

1. **Economic Incentives**: By holding and staking TAN, users can earn additional TAN through network rewards. This creates a positive feedback loop where participants are financially incentivized to contribute to the network’s security and growth.
2. **Active Participation**: TAN holders have a direct impact on the network’s development through governance. This democratic approach ensures that the TAN Network evolves in a manner aligned with the community’s interests.
3. **Access to DApps**: TAN is used to interact with decentralized applications built on the TAN Network. This includes paying for services, executing smart contracts, and participating in various blockchain-based activities.
4. **Long-Term Value**: With a fixed supply and periodic halving, TAN is designed to be deflationary, potentially increasing its value over time. This structure provides an incentive for users to hold TAN as a long-term investment.

## Getting Started with TAN

To get started with TAN, users can acquire the coin through various means such as exchanges, staking rewards, or participating in network activities. Once you have TAN, you can start using it for transactions, staking, and governance within the TAN Network.

As the native coin of the TAN blockchain, TAN is more than just a digital asset; it is a vital component that powers the entire ecosystem. Whether you are a user, developer, or investor, TAN provides the tools and incentives needed to fully engage with and benefit from the TAN Network.


# 🫂Community


# GETTING STARTED


# Developer Guide


# Nodes And Validators


# ⬇️Install TAN-Chain

This page provides concise instructions for downloading, unzipping, and building the necessary binaries to set up TAN-chain on a user's system, facilitating seamless installation.

## System requirements

| Hardware  | Minimum   | Recommended |
| --------- | --------- | ----------- |
| CPU       | 4 cores   | 8 cores     |
| RAM       | 8 GB      | 16 GB       |
| Storage   | 500 GB    | 1 TB        |
| Bandwidth | 100 Mbps+ | 1 Gbps      |

## Prerequisites

* Go version - go1.20
* Wget

## How to install TAN-chain ?

To install TAN-chain, begin by accessing the provided link and downloading the *<mark style="color:blue;">TAN-chain zip</mark>* file. Once the [*download*](https://devnet-taral.tarality.com/) is complete, locate the downloaded zip file on your system and extract its contents. This will create a directory containing all the necessary files and directories for TAN-chain.

After unzipping, you'll have the TAN-chain code base ready for installation. From here, you can proceed with any further setup steps, dependencies installation, or configurations required to run TAN-chain on your system. Following these steps ensures that you have the necessary files in place to begin using TAN-chain.

The next step, in your root folder, execute the `go mod tidy` command in your terminal. This command ensures that all necessary Go modules are present and up to date according to the dependencies specified in the `go.mod` file.

```
go mod tidy
```

Once this step is completed without errors, you can proceed to build the binaries by running the `go build` command in your terminal.

```
go build
```

If the build process completes successfully, the binaries for TAN-chain will be created. You can verify this by checking for the existence of the ***TAN`-chain`*** executable file in your project directory.

***Congratulations!!**,* you have now successfully created the binaries for TAN-chain, and you're ready to proceed with further configurations or running a full node!


# Full Node Instructions

After successfully creating the binaries, you can proceed to run the full node.

### **Steps to run a successful TAN-chain on the local system -**

* Generate data directories for each of the 4 nodes
* Prepare multiaddr string for bootnode
* Copy and paste the [*genesis file*](https://devnet-taral.tarality.com/)
* Running all servers and node.

Let’s see the steps one by one -

To do so, navigate to your root directory and create a new folder. For consistency, let's name this folder "run", though you're free to choose any name you prefer.

```
cd Tan-chain-network
mkdir run
```

This will navigate you to the "TAN-chain-network" directory and create a new folder named "run" within it. This folder will serve as the directory for running your full node.

```
cd run
```

Once you're inside the "run" folder, you can proceed with initializing the data directories for your TAN-chain node.

#### Initialize the data directory with

```
../tan-chain secrets init --insecure --data-dir test-chain-1
```

This will generate the data directory for node one with name “test-chain-1”.

**test-chain-1** *here acts as a prefix for node directory.* You can name it as per your convenience.

Example 🎉-<br>

<figure><img src="/files/qRsfCOUKH6jq5kC9F6yW" alt=""><figcaption></figcaption></figure>

After initializing the data directory, it's time to create the genesis file.

To create the `genesis.json` file and populate it with the contents provided, follow these steps:-

* In your terminal, ensure you are still within the "run" directory.
* Create a new JSON file named `genesis.json` using your preferred text editor or terminal command. For example-

```
touch genesis.json
```

* Open the `genesis.json` file in your text editor or using a command-line text editor like `nano` or `vim`.
* Copy the contents of the genesis file from the [provided link](https://devnet-taral.tarality.com/).
* Paste the copied contents into the `genesis.json` file.
* Save and close the file. If you're using a text editor, follow its specific instructions for saving and closing files.

Once you've completed these steps, your `genesis.json` file should be created and populated with the appropriate content.


# 🔏How to Stake TAN?

Learn how to stake TAN and set up a validator node on the TAN blockchain network to participate in transaction validation and network security.

## Staking TAN to Become a Validator <a href="#staking-taral-to-become-a-validator" id="staking-taral-to-become-a-validator"></a>

Validator nodes are essential components of the TAN blockchain network. They validate transactions and propose new blocks, contributing directly to the consensus mechanism. Becoming a validator requires a commitment to maintaining high uptime and adhering to network protocols.

## How to Stake TAN <a href="#staking-taral-to-become-a-validator" id="staking-taral-to-become-a-validator"></a>

**Prerequisite:** Before proceeding with the staking contracts, ensure you have a fully synchronized full node running in the current blockchain state of TAN.

**Step 1: Clone the Repository from** [**GitHub**](https://github.com/0xPolygon/staking-contracts/tree/main)**.**

**Step 2: Open cloned repository in terminal and install dependencies navigate to the cloned `staking-contracts` directory from the `main` branch and run `npm i` to install dependencies.**

**Step 3: Execute the following command to copy the example environment file to `.env`:**

```
cp .env.example .env   
```

**Step 4 : Use the following command to open and edit the `.env` file using the Nano text editor :**

```
nano .env
```

**Step 5: Replace the existing content in your `.env` file with the following configuration details:**

```
JSONRPC_URL= <Use Tan RPC URL>
PRIVATE_KEYS= <Your private key of wallet which was initially generated at the time of key pair>
STAKING_CONTRACT_ADDRESS= 0x0000000000000000000000000000000000001001
BLS_PUBLIC_KEY= <Your BLS_Public_key which was initially generated at the time of key pair>
```

Save the updated `.env` file after replacing the placeholders with your actual configuration details.

**Step 6: Retrieve Private Key for Staking.**

Change directory to the location where your private key file (`validator.key`) is stored.

```
cd <yourkeygeneratedDirectory>/consensus
```

Use the following command to display the content of the `validator.key` file, which contains your private key:

```
cat validator.key
```

Copy the private key displayed in your terminal. This private key is needed for configuring your staking setup in the `.env` file.

**Step 7: You must have 20000 TAN in your wallet.**

Execute the following curl command in your terminal to check the balance of your wallet address:

```
curl --location 'https://devnet-rpc1.tanledger.com' \
--header 'Content-Type: application/json' \
--data '{"method":"eth_getBalance","params":["<YOUR WALLET ADDRESS>", "latest"],"id":1,"jsonrpc":"2.0"}'
```

Replace `<YOUR WALLET ADDRESS>` with your actual wallet address where you want to check the balance. Ensure your wallet contains at least 20000 TAN. If the balance is insufficient, please add TAN to your wallet.

**Step 8: Build the Project Using npm**

Execute the following command to build the project using npm:

```
npm run build
```

**Step 9: Run the Stake Command:**

Execute the following command to initiate the stake process using npm:

```
npm run stake
```

You should receive a confirmation message indicating that you have staked TAN successfully.

## Conclusion

In this guide, you've learned how to set up and stake TAN tokens to become a validator on the TAN blockchain network. By following these steps, you've configured your environment, managed your wallet, and interacted with staking contracts to contribute to network security and transaction validation. Staking TAN tokens not only helps secure the network but also allows you to participate actively in the decentralized consensus process. Ensure to monitor your validator node and manage rewards effectively to maximize your participation in the TAN ecosystem.


# Become a Validator🤝

Learn how to become a validator on the TAN blockchain network, securing transactions and contributing to network integrity through staking TAN .

## To Become a Validator

To become a validator on the TAN blockchain network, follow these steps:

### **1- Stake TAN :**&#x20;

Ensure you have staked TAN on the network as detailed previously.

### **2- Check Staked Amount on Explorer:**

Verify your staked amount on the blockchain[ *explorer* ](https://tanscan.com)to confirm your stake.

### **3- Initiate Validator Setup:**

Now, proceed with setting up as a validator on the TAN network to actively participate in transaction validation and network consensus.

### **Step 1: To Register Yourself as a Block Validator**

Start by registering as a validator using the following command:

```
npm run register-blskey
```

This command registers your BLS key with the network, indicating your readiness to participate in block validation.

After registering, wait for the creation of the next epoch block. Validator status and responsibilities are activated upon the generation of this block.

### **Step 2: Checking Total Number of Validators**

Execute the following command in your terminal:

```
npm run info
```

This command provides information including the total number of validators on the network.

After running the command, review the output to see the total count of validators and verify your own address among them.

## Conclusion

Becoming a validator on the TAN blockchain network involves registering your BLS key and awaiting the creation of the next epoch block to activate your validator status. By following these steps and monitoring the network, you contribute to its security and decentralization. Stay informed about your validator status using the `npm run info` command to track network dynamics and your role as a validator.


# 🔓How to Unstake TAN?

Learn how to safely and efficiently unstake TAN from the network, ensuring smooth transition and management of your staked assets.

## Unstake TAN

To remove your stake and free yourself from the validator node, initiate the unstaking process through the provided functionality on the TAN blockchain network. This process involves confirming the unstaking transaction to begin withdrawing your TAN tokens from the staking contract.

## How to Unstake TAN?

**Prerequisite:** Before proceeding with the staking contracts, ensure you have a fully synchronized full node running in the current blockchain state of TAN.

**Step 1: Clone the Repository from** [**GitHub**](https://github.com/0xPolygon/staking-contracts/tree/main)**.**

**Step 2: Open cloned repository in terminal and install dependencies navigate to the cloned `staking-contracts` directory from the `main` branch and run `npm i` to install dependencies.**

**Step 3:** To remove your stake and free yourself from the validator node, follow these command:

```
npm run unstake
```

Executing this command initiates the process to withdraw your TAN tokens from the staking contract. Monitor the blockchain for the completion of your unstaking request. Once finalized, your TAN tokens will be available for withdrawal into your wallet. This action releases your TAN from the staking.

## Conclusion

Unstaking TAN from the TAN network is a straightforward process that allows you to withdraw your stake from the validator node. By using the `npm run unstake` command, you initiate the unstaking transaction, freeing your TAN from the staking contract. Monitor the blockchain for confirmation, and once completed, withdraw your tokens into your wallet. This flexibility ensures you can manage your assets independently outside of the validator node, aligning with your evolving participation in the TAN blockchain network.


# RPC

This guide provides an index of network details for the ***TAN-chain devnet, TAN-chain testnet and  TAN-chain mainnet,*** including their associated RPC and node endpoints.

## Network details

## *Devnet*

The Devnet serves as a replica of the TAN-chain testnet and is primarily used for development testing. Obtain devnet tokens from the[ *faucet.*](https://app.tan.live/) Note that these tokens hold no value and differ from TAN.

<table><thead><tr><th width="236">Properties</th><th>Network Details</th></tr></thead><tbody><tr><td>Network Name</td><td>TAN-Devnet</td></tr><tr><td>Chain ID</td><td>4442</td></tr><tr><td>Native Coin</td><td>TAN</td></tr><tr><td>Faucet</td><td><a href="https://faucet-devnet.tarality.com/">Devnet faucet</a></td></tr><tr><td>RPC endpoint</td><td><a href="https://devnet-taral-rpc1.tarality.com">https://</a><mark style="color:blue;">devnet-rpc1.tanledger.com</mark></td></tr><tr><td>Explorer</td><td><a href="https://devnet.taralscan.com/">Devnet explorer</a></td></tr></tbody></table>

## *Testnet*

The TAN testnet serves as a replica of the TAN mainnet and is primarily used for testing. Obtain testnet tokens from the [***faucet***](https://app.tan.live/)***.*** Note that these tokens hold no value and differ from TAN.

| Properties   | Network Details |
| ------------ | --------------- |
| Network name | Comming Soon    |
| Chain ID     | Comming Soon    |
| Native coin  | Comming Soon    |
| Faucet       | Comming Soon    |
| RPC endpoint | Comming Soon    |

## *Mainnet*

The native token for the TAN mainnet is TAN, which is used for transaction fees.

| Properties   | Network Details |
| ------------ | --------------- |
| Network name | Comming Soon    |
| Chain ID     | Comming Soon    |
| Native Coin  | Comming Soon    |
| Faucet       | Comming Soon    |
| RPC endpoint | Comming Soon    |


# TAN Testnet

The TAN Testnet is a crucial environment for developers to experiment, test, and deploy their applications before going live on the mainnet. It replicates the TAN Mainnet functionality and features, allowing developers to identify and resolve potential issues in a controlled setting.

## What is the TAN Testnet?

The TAN Testnet is a sandbox environment that mimics the conditions of the TAN Mainnet. It provides developers with a risk-free platform to:&#x20;

* Develop and test smart contracts
* Experiment with new features
* Identify and fix bugs
* Validate performance and security aspects

## Key Features of the TAN Testnet

1. **Free Test Tokens**: Developers can request free test TAN tokens to simulate transactions and operations without financial risk. These tokens have no real-world value but are essential for testing purposes.
2. **Realistic Environment**: The testnet closely mirrors the mainnet’s behavior, providing an accurate representation of how applications will perform once deployed live.
3. **Community and Support**: The TAN developer community and support team are active on the testnet, providing assistance and resources to help developers troubleshoot issues and optimize their applications.

## How to Access the TAN Testnet

1. **Set Up a Wallet**: To interact with the TAN Testnet, you need a compatible wallet. Popular options include MetaMask, Trust Wallet, and other EVM-compatible wallets. Configure your wallet to connect to the TAN Testnet by adding a custom network with the testnet RPC URL.
2. **Request Test** TAN **Tokens**: Use the TAN Testnet Faucet to request free test TAN tokens. These tokens will be sent to your testnet wallet and can be used for deploying contracts, paying for gas fees, and more.
3. **Deploy and Test Smart Contracts**: With test TAN tokens in your wallet, you can start deploying smart contracts to the TAN Testnet. Use development tools like Remix, Truffle, or Hardhat to write, compile, and deploy your contracts.
4. **Monitor and Debug**: Utilize blockchain explorers specifically for the TAN Testnet to monitor your transactions and contract interactions. These tools help you verify the behavior of your contracts and identify any issues.

## Best Practices for Using the TAN Testnet

* **Frequent Testing**: Regularly test your smart contracts and DApps on the testnet to catch and fix issues early in the development cycle.
* **Security Audits**: Conduct thorough security audits on the testnet before deploying to the mainnet. Use tools and services that can help identify vulnerabilities in your code.
* **Community Engagement**: Engage with the TAN developer community for support, feedback, and collaboration. Participate in forums, attend developer meetups, and share your experiences to benefit from collective knowledge.
* **Documentation and Logging**: Maintain comprehensive documentation and logging for your testnet activities. This practice helps in tracking changes, understanding behavior, and providing insights during troubleshooting.

## Transitioning to Mainnet

Once you are confident that your smart contracts and DApps are performing well on the testnet, you can prepare for deployment on the TAN Mainnet. Ensure all testnet findings are addressed, and conduct final reviews to confirm readiness for the live environment.

The TAN Testnet is an invaluable resource for developers aiming to build robust and reliable applications on the TAN Network. By leveraging the testnet, you can ensure your solutions are well-tested and optimized for success on the mainnet.


# TAN explorers

TAN Explorers are essential tools for developers and enthusiasts to interact with and explore the TAN blockchain. These explorers provide insights into the network's transactions, blocks, addresses, and more. Whether you're a developer building on the TAN blockchain or a user interested in monitoring its activity, these explorers offer invaluable functionalities.

## **1. TAN Explorer 1.0**

TAN Explorer 1.0 is the official blockchain explorer developed by the TAN team. It offers a user-friendly interface and comprehensive features for navigating the TAN blockchain. Here are some key features:

* **Search Functionality**: Easily search for transactions, blocks, and addresses using intuitive search options.
* **Transaction Details**: View detailed information about individual transactions, including sender/receiver addresses, timestamps, and transaction amounts.
* **Block Details**: Explore blocks on the TAN blockchain and examine details such as block height, timestamp, and the number of transactions included.
* **Address Information**: Obtain insights into specific addresses, including transaction history, balance, and associated metadata.

## 2. TAN **Explorer 2.0 (Beta)**

TAN Explorer 2.0 is the latest iteration of the blockchain explorer, currently in beta testing. It builds         upon the features of its predecessor while introducing new functionalities and enhancements. Some   highlights of TAN Explorer 2.0 include:

* **Real-time Data**: Experience real-time updates of transactions and blocks as they occur on the TAN network.
* **Advanced Analytics**: Access advanced analytics tools to analyze blockchain data, including charts, graphs, and statistical insights.
* **Customization Options**: Customize the explorer interface to suit your preferences, with options for theme selection and layout customization.
* **API Integration**: Integrate TAN Explorer 2.0 with external applications and services using its robust API, enabling seamless interaction with the TAN blockchain.

## 3.**Community-built Explorers**

In addition to the official explorers provided by the TAN team, there are also community-built explorers that offer unique features and perspectives. These explorers are developed by community members and enthusiasts, contributing to the ecosystem's diversity and accessibility.

* **Explorer A**: Description of features and functionalities.
* **Explorer B**: Description of features and functionalities.

## **Getting Started**

To begin exploring the TAN blockchain using these explorers, simply visit their respective websites or access them through API endpoints. Whether you're conducting research, monitoring network activity, or building applications, TAN Explorers provide the tools you need to engage with the blockchain effectively.


# Deploy Smart Contracts


# TEP-20

## Overview

The TEP20 token standard is a core component of the TAN-chain blockchain, similar to the ERC20 standard in Ethereum. It defines a set of rules and functionalities that a token contract must follow to ensure compatibility and interoperability across the TAN-chain ecosystem.

## Key Features of TEP20

* **Transferable**: Tokens can be transferred from one account to another.
* **Transfer Approval**: A token owner can approve another account to transfer tokens on their behalf.
* **Balance Query**: The balance of any account can be queried.
* **Allowance Query**: The amount of tokens that an owner allowed to a spender can be queried.

## Use Cases

* **Digital Currency**: TEP20 tokens can represent any fungible assets such as currencies, points, or in-game items.
* **Fundraising**: Used in Initial Coin Offerings (ICOs) or token sales.
* **Staking and Rewards**: Can be used in various decentralized finance (DeFi) applications for staking and reward distribution.

## Deploying TEP20 Token Contracts

There are several methods to deploy a TEP20 token contract on the TAN-chain network.

* [Remix IDE](https://remix.ethereum.org)
* [Truffle](https://archive.trufflesuite.com/)
* <mark style="color:blue;">Ha</mark>[<mark style="color:blue;">rdhat</mark>](https://hardhat.org/)


# Using Remix ide

Here is a detailed explanation of what Remix IDE is and a step-by-step guide on how to deploy a TEP20 contract using Remix IDE:

## What is Remix IDE ?

Remix IDE is an open-source, web-based integrated development environment (IDE) for writing, compiling, and deploying smart contracts. It is widely used for Ethereum and Ethereum-compatible blockchains such as TAN-chain. Remix IDE offers a user-friendly interface, powerful debugging features, and a variety of plugins to streamline the smart contract development process.

## Step-by-Step Guide to Deploy

Follow these steps to deploy a TEP20 contract using Remix IDE:

## 1.Open Remix IDE

Navigate to[ *Remix IDE* ](https://remix.ethereum.org)in your web browser. You will see the main interface, which consists of several panels, including the file explorer, the editor, and the terminal.

## 2.Create a New File

In the file explorer on the left side of the screen:

* To create a new file, select the “File Explorer” icon from the menu, then click the “Create New File” icon.
* Type in the name of the file. It is our first program so let’s go with “`TEP20Token.sol`” .

<figure><img src="/files/n1nEYqH70Qfr3uDaKD0h" alt=""><figcaption></figcaption></figure>

## 3.Write the Contract

* Once the file is named we can begin writing Solidity code in the code editor. Paste or type the code below into Remix.

<figure><img src="/files/bGtOuFLECdUdLbPPlWFW" alt=""><figcaption></figcaption></figure>

## 4.Compile the Contract

* **Select the Compiler**: Click on the `Solidity Compiler` tab on the left sidebar.
* **Choose Compiler Version**: Select the appropriate compiler version (e.g., `0.8.20+commit.c7dfd78e`).
* **Compile the Code**: Click the `Compile TEP20Token.sol` button.

<figure><img src="/files/nkJ8Tmt6NJ5MhnWaZVQt" alt=""><figcaption></figcaption></figure>

## 5.Deploy the Contract

* **Select the Deployment Environment**: Click on the `Deploy & Run Transactions` tab.
* **Configure the Environment**:

  Select `Injected Web3` if you are using a Web3 wallet like MetaMask connected to the TAN-chain network.
* **Deploy the Contract**:
  * Ensure `TEP20Token` is selected in the contract dropdown.
  * Click the `Deploy` button.

<figure><img src="/files/6gMPVBqDEe1QjHNMgqH1" alt=""><figcaption></figcaption></figure>

***Congratulations!!*** You have successfully deployed your TEP20 token contract on the TAN-chain network using Remix IDE.


# Using Truffle

Here is a detailed explanation of what Truffle is and a step-by-step guide on how to deploy a TEP20 contract using truffle:|

## What is Truffle ?

Truffle is a development framework for Ethereum and Ethereum-compatible blockchains such as TAN-chain. It provides a suite of tools for smart contract development, including a built-in compiler, a testing framework, and scripts to deploy contracts.

## Step-by-Step Guide to Deploy Contract

Follow these steps to deploy a TEP20 contract using Truffle:

## 1. Install Truffle

Ensure you have Node.js and npm installed. Then, install Truffle globally:

```
npm install -g truffle
```

## 2. Initialize Truffle Project

**Create a new directory for your project**:

```
mkdir TEP20TokenProject
```

```
cd TEP20TokenProject
```

**Initialize the project with Truffle**:

```
truffle init
```

This command creates a basic Truffle project structure with the following directories:

* `contracts`: Where your smart contracts go.
* `migrations`: Where deployment scripts go.
* `test`: Where your test scripts go.

## 3. Write the Contract

Create a new file `TEP20Token.sol` in the `contracts` directory and add your TEP20 token code:

```
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract TEP20Token is ERC20, Ownable {
    constructor()
        ERC20("MyToken", "MTK")
        Ownable(msg.sender)
    {}

    function mint(address to, uint256 amount) public onlyOwner {
        _mint(to, amount);
    }
}
```

## 4. Compile the Contract

Run the following command to compile your contract:

```
truffle compile
```

This command compiles the contracts in the `contracts` directory and generates the necessary artifacts in the `build/contracts` directory.

## 5. Write the Deployment Script

Create a new file 1`_deploy_contracts.js` in the `migrations` directory and add the following content:

```
const TEP20Token = artifacts.require("TEP20Token");

module.exports = function(deployer) {
  deployer.deploy(TEP20Token);
};
```

## Configure the Network

**Install `truffle-hdwallet-provider` and `dotenv`**:

```
npm install truffle-hdwallet-provider dotenv
```

**Create a \``` .env` `` file** in the root of your project directory to store your private key.

```
// In .env file

YOUR_PRIVATE_KEY = "YOUR_PRIVATE_KEY"

```

Update the `truffle-config.js` file to include the Taral-chain network configuration. For example:

```

const HDWalletProvider = require("truffle-hdwallet-provider");
require("dotenv").config();

const mnemonic = process.env.YOUR_PRIVATE_KEY;

module.exports = {

  networks: {
    
    taral: {
      provider: () => new HDWalletProvider(mnemonic,"https://devnet-rpc1.tanledger.com"),
      network_id: 4442,
      chainId:4442
    }
   
  },

  mocha: {
    // timeout: 100000
  },

  // Configure your compilers
  compilers: {
    solc: {
      version: "0.8.20", // Fetch exact version from solc-bin (default: truffle's version)
   
    }
  },
};
```

## 7.Deploy the Contract

Run the following command to deploy the contract to the specified network:

```
truffle migrate --network tan
```

After a successful deployment, you should see an output similar to this:

<figure><img src="/files/eIWKfqrBbbHsSzoeNrqf" alt=""><figcaption></figcaption></figure>

***Congratulations!!*** You have successfully deployed your TEP20 token contract on the TAN-chain network using Truffle. This guide covered the entire process from setting up the Truffle project to deploying the contract.


# Using Hardhat

Here is a detailed explanation of what Hardhat is and a step-by-step guide on how to deploy a TEP20 contract using hardhat:

## What is Hardhat ?

***Hardhat*** is a development environment for Ethereum and Ethereum-compatible blockchains. It provides a comprehensive toolset for smart contract development, testing, debugging, and deployment.

## Step-by-Step Guide to Deploy Contract

Follow these steps to deploy a TEP20 contract using Hardhat:

## 1.Install Hardhat

Ensure you have Node.js and npm installed. Then, create a new directory for your project and initialize it with Hardhat:

```
mkdir TEP20TokenProject
cd TEP20TokenProject
npm init -y
npm install --save-dev hardhat
```

## 2.Initialize Hardhat Project

Run the following command to initialize a Hardhat project:

```
npx hardhat
```

Follow the prompts to create a new Hardhat project, selecting the appropriate options for your needs.

## 3.Write the Contract

Create a new file `TEP20Token.sol` in the `contracts` directory and add your TEP20 token code:

```
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract TEP20Token is ERC20, Ownable {
    constructor()
        ERC20("MyToken", "MTK")
        Ownable(msg.sender)
    {}

    function mint(address to, uint256 amount) public onlyOwner {
        _mint(to, amount);
    }
}
```

## **4.Write the Deployment Script**

Create a new file `deploy.js` in the `scripts` directory to write your deployment script:

```
async function main() {

  const [deployer] = await ethers.getSigners();
  console.log("Deploying the contracts with the account:",await deployer.getAddress());
  console.log("Account balance:", (await deployer.getBalance()).toString());
  
  const TEP20Token = await ethers.getContractFactory("TEP20Token");
  const token = await TEP20Token.deploy();
  await token.deployed({ gasLimit: 6000000 });

  console.log("TEP20Token address:", token.address);
}
main()
  .then(() => process.exit(0))
  .catch((error) => {
    console.error(error);
    process.exit(1);
  });
```

## **5.Configure Network**

Make sure to install the suggested versions of the packages:

```
npm install --save-dev @nomiclabs/hardhat-ethers@^2.2.3 @nomiclabs/hardhat-waffle@^2.0.6 @openzeppelin/contracts@^5.0.2 @uniswap/v3-periphery@^1.0.1 bignumber.js@^9.1.2 dotenv@^16.4.5 ethereum-waffle@^4.0.10 ethers@5.4 hardhat@^2.22.4
```

**Create a \``` .env` `` file** in the root of your project directory to store your private key.

```
// In .env file

YOUR_PRIVATE_KEY = "YOUR_PRIVATE_KEY"
```

Update the `hardhat.config.js` file to include network configurations:

```
require("@nomiclabs/hardhat-waffle");

/** @type import('hardhat/config').HardhatUserConfig */
const privateKey = process.env.YOUR_PRIVATE_KEY;;
module.exports = {
  solidity: {
   version: "0.8.20",
   settings: {
    optimizer:{
      enabled:true,
      runs:1000,
      details:{yul:false},  
    }
   }
  },
  networks: {
    taral: {
      chainId: 4442,
      url: "https://devnet-rpc1.tanledger.com",
      accounts: [privateKey],
    },
  },
};
```

## 6.Deploy the Contract

Run the deployment script with Hardhat:

```
npx hardhat run scripts/deploy.js --network tan
```

***Congratulations!!*** You have successfully deployed your TEP20 token contract using Hardhat. This guide covered the entire process from setting up the Hardhat project to deploying the contract.


# TEP-721

## What is TEP-721 ?

***TEP-721*** is a token standard for non-fungible tokens (NFTs) on the TAN-chain blockchain. Similar to ERC721 on Ethereum,  TEP-721  defines a set of rules and behaviors for implementing NFTs, allowing developers to create unique digital assets that are indivisible, distinguishable, and provably scarce.

## Key Features of TEP-721

* **Non-Fungible Tokens (NFTs) :** TEP-721 tokens are non-fungible, meaning each token is unique and cannot be replaced or exchanged on a one-to-one basis like cryptocurrencies. Each token represents a distinct digital asset, such as artwork, collectibles, or in-game items.
* **Indivisibility :**  TEP-721  tokens are indivisible, meaning they cannot be divided into smaller units like fungible tokens (e.g., cryptocurrencies).
* **Ownership and Transferability :**  TEP-721  tokens allow for ownership transfer between addresses on the TAN-chain blockchain. Ownership is tracked on-chain, providing transparent and immutable records of token ownership history.
* **Metadata and URI :**  TEP-721  tokens can optionally include metadata, such as descriptions, images, or other attributes that provide additional information about the token and its associated digital asset.
* **Approval and Operator :**  TEP-721  tokens support token approval and operator functionalities, allowing token owners to grant specific addresses permission to transfer tokens on their behalf.

## Use cases

* **Digital Art and Collectibles :**  TEP-721  tokens can be used to represent digital art pieces, collectible items, and limited edition assets.
* **Gaming Assets and Items :** In gaming,  TEP-721  tokens can represent in-game assets, characters, skins, weapons, and other virtual items.
* **Real Estate and Property Ownership :**  TEP-721  tokens can tokenize real-world assets such as real estate properties, land parcels, and luxury goods.
* **Digital Identity and Credentials :**  TEP-721  tokens can be used to tokenize event tickets, concert passes, festival tickets, and VIP access passes. Organizers can issue  TEP-721  tokens as digital tickets, allowing attendees to securely purchase, transfer, and redeem tickets on the blockchain.
* **Intellectual Property and Licensing :**  TEP-721  tokens can represent intellectual property rights, copyrights, patents, and licenses for digital content and creative works.

## Deploying  TEP-721  Token Contracts

There are several methods to deploy a  TEP-721  token contract on the TAN-chain network.

* [Remix IDE](https://remix.ethereum.org/)
* [Truffle](https://hardhat.org/)
* [Hardhat](https://hardhat.org/)


# Using Remix ide

Here is a detailed explanation of what Remix IDE is and a step-by-step guide on how to deploy a TEP721 contract using Remix IDE:

## What is Remix IDE ?

***Remix IDE*** is an open-source, web-based integrated development environment (IDE) for writing, compiling, and deploying smart contracts. It is widely used for Ethereum and Ethereum-compatible blockchains such as TAN-chain. Remix IDE offers a user-friendly interface, powerful debugging features, and a variety of plugins to streamline the smart contract development process.

## Step-by-Step Guide to Deploy

Follow these steps to deploy a TEP721 contract using Remix IDE:

## 1.Open Remix IDE

Navigate to [***Remix IDE*** ](https://remix.ethereum.org/#lang=en\&optimize=false\&runs=200\&evmVersion=null)in your web browser. You will see the main interface, which consists of several panels, including the file explorer, the editor, and the terminal.<br>

## 2.Create a New File

In the file explorer on the left side of the screen:

* To create a new file, select the “File Explorer” icon from the menu, then click the “Create New File” icon.
* Type in the name of the file. It is our first program so let’s go with “TEP721NFT`.sol`” .

<figure><img src="/files/mso37N1g1JSiCzTitBZq" alt=""><figcaption></figcaption></figure>

## 3.Write the Contract

Once the file is named we can begin writing Solidity code in the code editor. Paste or type the code below into Remix.<br>

<figure><img src="/files/SwSPzklWKNfsJr6qPIEL" alt=""><figcaption></figcaption></figure>

## 4.Compile the Contract

* **Select the Compiler**: Click on the `Solidity Compiler` tab on the left sidebar.
* **Choose Compiler Version**: Select the appropriate compiler version (e.g., `0.8.20+commit.c7dfd78e`).
* **Compile the Code**: Click the `Compile` TEP721NFT`.sol` button.

<figure><img src="/files/ZzMQxT4NJHYdJ1YK5yhK" alt=""><figcaption></figcaption></figure>

## 5.Deploy the Contract

* **Select the Deployment Environment**: Click on the `Deploy & Run Transactions` tab.
* **Configure the Environment**:

  Select `Injected Web3` if you are using a Web3 wallet like MetaMask connected to the TAN-chain network.
* **Deploy the Contract**:
  * Ensure TEP721NFT is selected in the contract dropdown.
  * Click the `Deploy` button.

<figure><img src="/files/nEvl2kVNAbGoXAgkYntC" alt=""><figcaption></figcaption></figure>

***Congratulations!!*** You have successfully deployed your TEP721 token contract on the TAN-chain network using Remix IDE.


# Using Truffle

Here is a detailed explanation of what Truffle is and a step-by-step guide on how to deploy a TEP721 contract using truffle:<br>

## What is Truffle ?

***Truffle*** is a development framework for Ethereum and Ethereum-compatible blockchains such as TAN-chain. It provides a suite of tools for smart contract development, including a built-in compiler, a testing framework, and scripts to deploy contracts.<br>

## Step-by-Step Guide to Deploy Contract

Follow these steps to deploy a TEP721 contract using Truffle:<br>

## 1.Install Truffle

Ensure you have Node.js and npm installed. Then, install Truffle globally:

```
npm install -g truffle
```

## 2.Initialize Truffle Project

**Create a new directory for your project**:

```
mkdir TEP721Project
cd TEP721Project
```

**Initialize the project with Truffle**:

```
truffle init
```

This command creates a basic Truffle project structure with the following directories:

* `contracts`: Where your smart contracts go.
* `migrations`: Where deployment scripts go.
* `test`: Where your test scripts go.<br>

## 3.Write the Contract

Create a new file TEP721NFT`.sol` in the `contracts` directory and add your TEP721NFT code:

```
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract TEP721NFT is ERC721, Ownable {
    uint256 private _nextTokenId;

    constructor()
        ERC721("TEP721NFT", "TPFT")
        Ownable(msg.sender)
    {}

    function safeMint(address to) public onlyOwner {
        uint256 tokenId = _nextTokenId++;
        _safeMint(to, tokenId);
    }
}
```

## 4.Compile the Contract

Run the following command to compile your contract:

```
truffle compile
```

This command compiles the contracts in the `contracts` directory and generates the necessary artifacts in the `build/contracts` directory.<br>

## 5.Write the Deployment Script

Create a new file 1`_deploy_contracts.js` in the `migrations` directory and add the following content:

```
const TEP721NFT = artifacts.require("TEP721NFT");

module.exports = function(deployer) {
  deployer.deploy(TEP721NFT);
};
```

## 6.Configure the Network

**Install `truffle-hdwallet-provider` and `dotenv`**:

```
npm install truffle-hdwallet-provider dotenv
```

**Create a \``` .env` `` file** in the root of your project directory to store your private key.

```
// In .env file

YOUR_PRIVATE_KEY = "YOUR_PRIVATE_KEY"
```

Update the `truffle-config.js` file to include the TAN-chain network configuration. For example:

```

const HDWalletProvider = require("truffle-hdwallet-provider");
require("dotenv").config();

const mnemonic = process.env.YOUR_PRIVATE_KEY;

module.exports = {

  networks: {
    
    taral: {
      provider: () => new HDWalletProvider(mnemonic,"https://devnet-rpc1.tanledger.com"),
      network_id: 4442,
      chainId:4442
    }
   
  },

  mocha: {
    // timeout: 100000
  },

  // Configure your compilers
  compilers: {
    solc: {
      version: "0.8.20", // Fetch exact version from solc-bin (default: truffle's version)
   
    }
  },
};
```

## 7.Deploy the Contract

Run the following command to deploy the contract to the specified network:

```
truffle migrate --network tan
```

***Congratulations!!*** You have successfully deployed your TEP-721 token contract on the TAN-chain network using Truffle. This guide covered the entire process from setting up the Truffle project to deploying the contract.


# Using Hardhat

Here is a detailed explanation of what Hardhat is and a step-by-step guide on how to deploy a TEP721 contract using hardhat:

## What is Hardhat ?

***Hardhat*** is a development environment for Ethereum and Ethereum-compatible blockchains. It provides a comprehensive toolset for smart contract development, testing, debugging, and deployment.

## Step-by-Step Guide to Deploy Contract

Follow these steps to deploy a TEP721 contract using Hardhat:

## 1.Install Hardhat

Ensure you have Node.js and npm installed. Then, create a new directory for your project and initialize it with Hardhat:

```
mkdir TEP721Project
cd TEP721Project
npm init -y
npm install --save-dev hardhat
```

## 2.Initialize Hardhat Project

Run the following command to initialize a Hardhat project:

```
npx hardhat
```

Follow the prompts to create a new Hardhat project, selecting the appropriate options for your needs.

## 3.Write the Contract

Create a new file TEP721NFT.sol in the `contracts` directory and add your TEP721NFT code:

```
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract TEP721NFT is ERC721, Ownable {
    uint256 private _nextTokenId;

    constructor()
        ERC721("TEP721NFT", "TPFT")
        Ownable(msg.sender)
    {}

    function safeMint(address to) public onlyOwner {
        uint256 tokenId = _nextTokenId++;
        _safeMint(to, tokenId);
    }
}
```

## **4.Write the Deployment Script**

Create a new file `deploy.js` in the `scripts` directory to write your deployment script:

```
async function main() {

  const [deployer] = await ethers.getSigners();
  console.log("Deploying the contracts with the account:",await deployer.getAddress());
  console.log("Account balance:", (await deployer.getBalance()).toString());
  
  const TEP721NFT = await ethers.getContractFactory("TEP721NFT");
  const token = await TEP721NFT.deploy();
  await token.deployed({ gasLimit: 6000000 });

  console.log("TEP721NFT address:", token.address);
}
main()
  .then(() => process.exit(0))
  .catch((error) => {
    console.error(error);
    process.exit(1);
  });
```

## 5.Configure Network

Make sure to install the suggested versions of the packages:

```
npm install --save-dev @nomiclabs/hardhat-ethers@^2.2.3 @nomiclabs/hardhat-waffle@^2.0.6 @openzeppelin/contracts@^5.0.2 @uniswap/v3-periphery@^1.0.1 bignumber.js@^9.1.2 dotenv@^16.4.5 ethereum-waffle@^4.0.10 ethers@5.4 hardhat@^2.22.4
```

**Create a \``` .env` `` file** in the root of your project directory to store your private key.

```
// In .env file

YOUR_PRIVATE_KEY = "YOUR_PRIVATE_KEY"
```

Update the `hardhat.config.js` file to include network configurations:

```
require("@nomiclabs/hardhat-waffle");

/** @type import('hardhat/config').HardhatUserConfig */
const privateKey = process.env.YOUR_PRIVATE_KEY;;
module.exports = {
  solidity: {
   version: "0.8.20",
   settings: {
    optimizer:{
      enabled:true,
      runs:1000,
      details:{yul:false},  
    }
   }
  },
  networks: {
    taral: {
      chainId: 4442,
      url: "https://devnet-rpc1.tanledger.com",
      accounts: [privateKey],
    },
  },
};
```

## 6.Deploy the Contract

Run the deployment script with Hardhat:

```
npx hardhat run scripts/deploy.js --network tan
```

***Congratulations!!*** You have successfully deployed your TEP721 token contract using Hardhat. This guide covered the entire process from setting up the Hardhat project to deploying the contract.


# TEP-1155

### What is TEP1155 ? <a href="#what-is-tep1155" id="what-is-tep1155"></a>

TEP1155 is a token standard for semi-fungible tokens (SFTs) on the TAN-chain blockchain. Similar to ERC1155 on Ethereum, TEP1155 allows for the creation of both fungible and non-fungible tokens within a single contract. This standard provides flexibility for developers to represent a variety of digital assets, including unique items, collectibles, and fungible tokens, all within a single smart contract.

### Key Features of TEP1155 <a href="#key-features-of-tep1155" id="key-features-of-tep1155"></a>

* **Semi-Fungible Tokens (SFTs) :** TEP1155 tokens are semi-fungible, meaning that each token can represent multiple identical or unique items.Unlike traditional fungible tokens (e.g,cryptocurrencies ), TEP1155 tokens can have varying properties and attributes, making them ideal for representing diverse digital assets.
* **Batch Transfers :** TEP1155 supports batch transfers, allowing users to send multiple tokens in a single transaction. This feature is particularly useful for applications such as gaming, where players may acquire or exchange multiple items simultaneously.
* **Single Contract Deployment :** With TEP1155, developers can deploy a single contract to manage multiple types of tokens, including both fungible and non-fungible assets.
* **Reduce Gas Costs :** TEP1155 optimizes gas usage by allowing batch transfers and efficient storage of token balances.

### Use Cases <a href="#use-cases" id="use-cases"></a>

* **Gaming Assets and Items :** TEP1155 tokens are well-suited for representing in-game assets, such as characters, weapons, armor, and consumables. Game developers can create dynamic gaming experiences where players can collect, trade, and upgrade various items, all within a single token contract.
* **Digital Collectibles and Arts :** TEP1155 tokens can be used to create digital collectibles and art pieces with varying attributes, such as rarity, edition, and artwork type.
* **Tokenized Securities and Investments :** TEP1155 tokens can represent tokenized securities, investment funds, and financial instruments.
* **Supply Chain and Inventory Management :** TEP1155 tokens can track and manage inventory items, product batches, and supply chain logistics. Each token can represent a unique item or batch of products, providing transparency and traceability throughout the supply chain process.
* **Decentralized Finance (DeFi) Applications :** TEP1155 tokens can be used in decentralized finance (DeFi) applications for creating synthetic assets, liquidity pools, and tokenized derivatives. DeFi protocols can leverage TEP1155 to provide diverse financial products and services to users, including lending, borrowing, and trading.

#### Deploying TEP1155 Token Contracts <a href="#deploying-tep1155-token-contracts" id="deploying-tep1155-token-contracts"></a>

There are several methods to deploy a TEP1155 token contract on the TAN-chain network.

* [Remix IDE](https://remix.ethereum.org/#lang=en\&optimize=false\&runs=200\&evmVersion=null\&version=soljson-v0.8.26+commit.8a97fa7a.js)
* [Truffle](https://archive.trufflesuite.com/)
* [Hardhat](https://hardhat.org/)


# Using Remix ide

Here is a detailed explanation of what Remix IDE is and a step-by-step guide on how to deploy a TEP1155 contract using Remix IDE:

## What is Remix IDE ? <a href="#what-is-remix-ide" id="what-is-remix-ide"></a>

***Remix IDE*** is an open-source, web-based integrated development environment (IDE) for writing, compiling, and deploying smart contracts. It is widely used for Ethereum and Ethereum-compatible blockchains such as TAN-chain. Remix IDE offers a user-friendly interface, powerful debugging features, and a variety of plugins to streamline the smart contract development process.

## Step-by-Step Guide to Deploy <a href="#step-by-step-guide-to-deploy" id="step-by-step-guide-to-deploy"></a>

Follow these steps to deploy a TEP1155 contract using Remix IDE:

## **1. Open Remix IDE**

Navigate to [***Remix IDE*** ](https://remix.ethereum.org/#lang=en\&optimize=false\&runs=200\&evmVersion=null)in your web browser. You will see the main interface, which consists of several panels, including the file explorer, the editor, and the terminal.

## **2. Create a New File**

In the file explorer on the left side of the screen:

* To create a new file, select the “File Explorer” icon from the menu, then click the “Create New File” icon.
* Type in the name of the file. It is our first program so let’s go with “`TEP1155NFT.sol`” .

<figure><img src="/files/WySB7kWWAAdnCKU4hEMn" alt=""><figcaption></figcaption></figure>

## **3. Write the Contract**

* Once the file is named we can begin writing Solidity code in the code editor. Paste or type the code below into Remix.

<figure><img src="/files/qTv9jXuGCI0CwCV6WeP0" alt=""><figcaption></figcaption></figure>

## **Compile the Contract**

* **Select the Compiler**: Click on the `Solidity Compiler` tab on the left sidebar.
* **Choose Compiler Version**: Select the appropriate compiler version (e.g., `0.8.20+commit.c7dfd78e`).
* **Compile the Code**: Click the `Compile TEP20Token.sol` button.

<figure><img src="/files/WXX3Yw6cktfIHYGSbX9Q" alt=""><figcaption></figcaption></figure>

## **Deploy the Contract**

* **Select the Deployment Environment**: Click on the `Deploy & Run Transactions` tab.
* **Configure the Environment**:

  Select `Injected Web3` if you are using a Web3 wallet like MetaMask connected to the TAN-chain network.
* **Deploy the Contract**:
  * Ensure `TEP20Token` is selected in the contract dropdown.
  * Click the `Deploy` button.

<figure><img src="/files/LQhZ6a9E5eHEjCqkmmRx" alt=""><figcaption></figcaption></figure>

***Congratulations!!*** You have successfully deployed your TEP1155 token contract on the TAN-chain network using Remix IDE.


# Using Truffle

Here is a detailed explanation of what Truffle is and a step-by-step guide on how to deploy a TEP1155 contract using truffle:

## What is Truffle ?

***Truffle*** is a development framework for Ethereum and Ethereum-compatible blockchains such as TAN-chain. It provides a suite of tools for smart contract development, including a built-in compiler, a testing framework, and scripts to deploy contracts.

## Step-by-Step Guide to Deploy Contract

Follow these steps to deploy a TEP1155 contract using Truffle:

## 1. Install Truffle

Ensure you have Node.js and npm installed. Then, install Truffle globally:

```
npm install -g truffle
```

## 2. Initialize Truffle Project

**Create a new directory for your project**:

```
mkdir TEP1155Project
cd TEP1155Project
```

**Initialize the project with Truffle**:

```
truffle init
```

This command creates a basic Truffle project structure with the following directories:

* `contracts`: Where your smart contracts go.
* `migrations`: Where deployment scripts go.
* `test`: Where your test scripts go.

## 3. Write the Contract

Create a new file TEP1155NFT`.sol` in the `contracts` directory and add your TEP1155NFT code:

```
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract TEP1155NFT is ERC1155, Ownable {
    constructor(address initialOwner) ERC1155("") Ownable(initialOwner) {}

    function mint(address account, uint256 id, uint256 amount, bytes memory data)
        public
        onlyOwner
    {
        _mint(account, id, amount, data);
    }

    function mintBatch(address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data)
        public
        onlyOwner
    {
        _mintBatch(to, ids, amounts, data);
    }
}
```

## 4.Compile the Contract

Run the following command to compile your contract:

```
truffle compile
```

This command compiles the contracts in the `contracts` directory and generates the necessary artifacts in the `build/contracts` directory.

## 5.Write the Deployment Script

Create a new file 1`_deploy_contracts.js` in the `migrations` directory and add the following content:

```
const TEP1155NFT = artifacts.require("TEP1155NFT");

module.exports = function(deployer) {
  deployer.deploy(TEP1155NFT);
};
```

## 6.Configure the Network

**Install `truffle-hdwallet-provider` and `dotenv`**:

```
npm install truffle-hdwallet-provider dotenv
```

**Create a \``` .env` `` file** in the root of your project directory to store your private key.

```
// In .env file

YOUR_PRIVATE_KEY = "YOUR_PRIVATE_KEY"
```

Update the `truffle-config.js` file to include the Taral-chain network configuration. For example:

```

const HDWalletProvider = require("truffle-hdwallet-provider");
require("dotenv").config();

const mnemonic = process.env.YOUR_PRIVATE_KEY;

module.exports = {

  networks: {
    
    taral: {
      provider: () => new HDWalletProvider(mnemonic,"devnet-rpc1.tanledger.com"),
      network_id: 4442,
      chainId:4442
    }
   
  },

  mocha: {
    // timeout: 100000
  },

  // Configure your compilers
  compilers: {
    solc: {
      version: "0.8.20", // Fetch exact version from solc-bin (default: truffle's version)
   
    }
  },
};
```

## 7.Deploy the Contract

Run the following command to deploy the contract to the specified network:

```
truffle migrate --network tan
```

***Congratulations!!*** You have successfully deployed your TEP1155 token contract on the TAN-chain network using Truffle. This guide covered the entire process from setting up the Truffle project to deploying the contract.


# Using Hardhat

Here is a detailed explanation of what Hardhat is and a step-by-step guide on how to deploy a TEP1155 contract using hardhat:

## What is Hardhat ?

***Hardhat*** is a development environment for Ethereum and Ethereum-compatible blockchains. It provides a comprehensive toolset for smart contract development, testing, debugging, and deployment.

## Step-by-Step Guide to Deploy Contract

Follow these steps to deploy a TEP1155 contract using Hardhat:

## 1.Install Hardhat

Ensure you have Node.js and npm installed. Then, create a new directory for your project and initialize it with Hardhat:

```
mkdir TEP1155Project
cd TEP1155Project
npm init -y
npm install --save-dev hardhat
```

## 2.Initialize Hardhat Project

Run the following command to initialize a Hardhat project:

```
npx hardhat
```

Follow the prompts to create a new Hardhat project, selecting the appropriate options for your needs.

## 3.Write the Contract

Create a new file TEP1155NFT`.sol` in the `contracts` directory and add your TEP1155NFT code:

```
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract TEP1155NFT is ERC1155, Ownable {
    constructor(address initialOwner) ERC1155("") Ownable(initialOwner) {}

    function mint(address account, uint256 id, uint256 amount, bytes memory data)
        public
        onlyOwner
    {
        _mint(account, id, amount, data);
    }

    function mintBatch(address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data)
        public
        onlyOwner
    {
        _mintBatch(to, ids, amounts, data);
    }
}
```

## 4.**Write the Deployment Script**

Create a new file `deploy.js` in the `scripts` directory to write your deployment script:

```
async function main() {

  const [deployer] = await ethers.getSigners();
  console.log("Deploying the contracts with the account:",await deployer.getAddress());
  console.log("Account balance:", (await deployer.getBalance()).toString());
  
  const TEP1155NFT = await ethers.getContractFactory("TEP1155NFT");
  const token = await TEP1155NFT.deploy();
  await token.deployed({ gasLimit: 6000000 });

  console.log("TEP1155NFT address:", token.address);
}
main()
  .then(() => process.exit(0))
  .catch((error) => {
    console.error(error);
    process.exit(1);
  });
```

## 5.Configure Network

Make sure to install the suggested versions of the packages:

```
npm install --save-dev @nomiclabs/hardhat-ethers@^2.2.3 @nomiclabs/hardhat-waffle@^2.0.6 @openzeppelin/contracts@^5.0.2 @uniswap/v3-periphery@^1.0.1 bignumber.js@^9.1.2 dotenv@^16.4.5 ethereum-waffle@^4.0.10 ethers@5.4 hardhat@^2.22.4
```

**Create a \``` .env` `` file** in the root of your project directory to store your private key.

```
// In .env file

YOUR_PRIVATE_KEY = "YOUR_PRIVATE_KEY"
```

Update the `hardhat.config.js` file to include network configurations:

```
require("@nomiclabs/hardhat-waffle");

/** @type import('hardhat/config').HardhatUserConfig */
const privateKey = process.env.YOUR_PRIVATE_KEY;;
module.exports = {
  solidity: {
   version: "0.8.20",
   settings: {
    optimizer:{
      enabled:true,
      runs:1000,
      details:{yul:false},  
    }
   }
  },
  networks: {
    taral: {
      chainId: 4442,
      url: "https://devnet-rpc1.tanledger.coms",
      accounts: [privateKey],
    },
  },
};
```

## 6.Deploy the Contract

Run the deployment script with Hardhat:

```
npx hardhat run scripts/deploy.js --network tan
```

***Congratulations!!*** You have successfully deployed your TEP1155 token contract using Hardhat. This guide covered the entire process from setting up the Hardhat project to deploying the contract.


# 🦊Add TAN to Metamask

Learn how to configure MetaMask to connect to the TAN-chain blockchain, enabling seamless interaction with TAN-based decentralized applications and assets.

**Follow these steps to add the TAN blockchain to your MetaMask wallet. This guide covers adding the Devnet, Testnet, and Mainnet, all of which follow the same approach.**

## Step 1 : Open MetaMask

* Open your ***MetaMask wallet***. If you don't have MetaMask installed, you can download it from [here](https://metamask.io/).
* Click on the ***MetaMask extension*** icon in your browser to open the wallet interface.

## Step 2 : Access the Network Dropdown

Click on the network dropdown at the top of the MetaMask interface. This dropdown displays the currently selected network ***(e.g., "Ethereum Mainnet").***

<figure><img src="/files/5YwV9WOoCzSDLo7VFeXn" alt=""><figcaption></figcaption></figure>

## Step 3 : Add a Network

Click on ***"Add Network"*** at the bottom of the network dropdown. This will open a new window where you can enter the details for the new network.

<figure><img src="/files/hKDNRIkuTSdEAjfYgiCT" alt=""><figcaption></figcaption></figure>

Click on add a network **"*****manually".***

<figure><img src="/files/6f4rKg96gcjiCzMM220J" alt=""><figcaption></figcaption></figure>

## Step 4 : Enter Network Details

In the "Add a network" form, Fill in the following details:

* **Network Name**: ***TAN Devnet*** (You can name it as per your preference)
* **New RPC URL**: [*<mark style="color:blue;">https://devnet</mark>*](https://devnet-taral-rpc1.tarality.com/)<mark style="color:blue;">-</mark>*<mark style="color:blue;">rpc1.tanledger.com</mark>*
* **Chain ID**: *4442*
* **Currency Symbol**: *TAN*   (Optional, But recommended)
* **Block Explorer URL**: [*https://tanscan.com/*](https://tanscan.com/)    (Optional, But recommended)

<figure><img src="/files/xRChrqCvUO5IFFO7IYtQ" alt=""><figcaption></figcaption></figure>

## Step 5 : Save the Network <a href="#step-5-save-the-network" id="step-5-save-the-network"></a>

After entering the network details, click ***"Save"*** to add the TAN network to MetaMask.

## Step 6 : Confirm Network Addition

Once you save the network, MetaMask will automatically switch to the newly added TAN network. You can now interact with TAN-based decentralized applications and assets.

## Adding Testnet and Mainnet

To add the TAN Testnet and Mainnet, follow the same steps as above. Simply replace the RPC endpoint and explorer URLs with the respective details for the Testnet and Mainnet. The Chain ID remains the same.

## Testnet Details

* **Network Name**: ***TAN Testnet***
* **New RPC URL**: (Provide the Testnet RPC URL)
* **Chain ID**: (Provide the Testnet chain id)
* **Currency Symbol**: ***TAN*** (optional)
* **Block Explorer URL**: (Provide the Testnet Explorer URL).

## Mainnet Details

* **Network Name**: ***TAN Mainnet***
* **New RPC URL**: (Provide the Mainnet RPC URL)
* **Chain ID**: (Provide the Mainnet chain id)
* **Currency Symbol**: ***TAN*** (optional)
* **Block Explorer URL**: (Provide the Mainnet Explorer URL).

You have successfully added the TAN network to your MetaMask wallet. You can now seamlessly interact with decentralized applications (DApps) and assets on the TAN-chain blockchain. Whether you're using the Devnet for development, the Testnet for testing, or the Mainnet for live transactions, your MetaMask wallet is now fully equipped to handle all your TAN blockchain needs.


# 🪙Get Testnet Funds

To start testing and developing on the TAN Testnet, you need Testnet funds. These funds are free and used solely for testing purposes. Here’s a step-by-step guide on how to obtain Testnet funds for

## Steps to Get Testnet Funds <a href="#steps-to-get-testnet-funds" id="steps-to-get-testnet-funds"></a>

### Step 1 : Open Metamask and Switch to TAN Testnet <a href="#step-1-open-metamask-and-switch-to-taral-testnet" id="step-1-open-metamask-and-switch-to-taral-testnet"></a>

* Open your MetaMask wallet.
* Ensure you have already added the TAN Testnet network to your MetaMask. If not, follow the [***Adding TAN to MetaMask***](https://app.gitbook.com/o/nC9mJuubvvzkG7dnYGaU/s/XMQYfACyWKWFvsl6LV4r/~/changes/1/getting-started/add-tan-to-metamask)[ ](https://metamask.io/)guide.
* Click on the network dropdown at the top of the MetaMask interface and select ***"TAN Testnet."***

### Step 2 : Copy your Metamask Address <a href="#step-2-copy-your-metamask-address" id="step-2-copy-your-metamask-address"></a>

Once you're on the TAN Testnet network, click on your account name at the top of MetaMask to copy your wallet address.

### Step 3 : Visit the TAN Testnet Faucet <a href="#step-3-visit-the-taral-testnet-faucet" id="step-3-visit-the-taral-testnet-faucet"></a>

* Open your web browser and navigate to the [***TAN Testnet Faucet***](https://app.tan.live/)*.*
* In the faucet interface, you will typically find a field to enter your MetaMask wallet address.

### Step 4 : Request Testnet Funds <a href="#step-4-request-testnet-funds" id="step-4-request-testnet-funds"></a>

* Paste your copied MetaMask address into the faucet's address field.
* Click the button to request Testnet funds. This button is usually labeled "***Claim TAN***".

### Step 5 : Confirm Fund Receipt <a href="#step-5-confirm-fund-receipt" id="step-5-confirm-fund-receipt"></a>

* After submitting your request, the faucet will send Testnet funds to your MetaMask wallet.
* Open MetaMask and check your balance to confirm that the Testnet funds have been received. This may take a few moments.

You have successfully obtained Testnet funds for the TAN Testnet. You can now start developing and testing your decentralized applications on the TAN blockchain. Enjoy building and experimenting with your projects!


# Core Concepts


# Genesis File

The ***Genesis File*** is a foundational component of the TAN blockchain, serving as the starting point for the entire network. It plays a crucial role in defining initial parameters, such as the initial distribution of tokens, network settings, and other essential configurations. Understanding the Genesis File is fundamental for developers and network participants to comprehend the genesis state of the blockchain.

## Structure of the Genesis File <a href="#structure-of-the-genesis-file" id="structure-of-the-genesis-file"></a>

The Genesis File is typically a ***JSON (JavaScript Object Notation)*** file that contains key information about the initial state of the TAN blockchain. Below are the essential components typically found in the Genesis File:

* **Chain Configuration**: This section includes parameters related to the blockchain's consensus mechanism, such as the consensus algorithm block time, block size limits, reward percentage, subsidy,and many others consensus-related settings.
* **Initial Allocation**: Here, the initial distribution of native tokens (TAN) is specified. This allocation defines how many tokens are assigned to various addresses or entities at the genesis block. It lays the foundation for the network's token distribution and economic model.
* **Network Parameters**: This part outlines various network parameters, including the network ID, genesis block timestamp, and other network-specific settings necessary for nodes to join and synchronize with the network.
* **Metadata**: Optionally, the Genesis File may include additional metadata or comments to provide context or instructions for network participants or developers.

## Importance of the Genesis File <a href="#importance-of-the-genesis-file" id="importance-of-the-genesis-file"></a>

The Genesis File serves as the blueprint for the TAN blockchain, shaping its initial state and guiding its evolution. It establishes the rules and parameters that govern the network from its inception, ensuring consistency and integrity across all nodes. Developers and validators rely on the Genesis File to initialize their nodes correctly and participate in the network effectively.

## Customization and Evolution <a href="#customization-and-evolution" id="customization-and-evolution"></a>

While the Genesis File defines the initial state of the blockchain, it's important to note that its contents can be customized or updated over time through network upgrades or forks. Changes to the Genesis File may involve adjustments to token allocations, consensus parameters, or other network configurations. However, modifications to the Genesis File require careful consideration and community consensus to maintain the integrity and security of the blockchain.

## Conclusion <a href="#conclusion" id="conclusion"></a>

The Genesis File is a foundational element of the TAN blockchain, encapsulating its initial state and setting the stage for its growth and development. By understanding the structure and significance of the Genesis File, developers and network participants can gain insights into the genesis state of the blockchain and contribute to its ongoing evolution.


# Consensus

***Consensus*** is the mechanism by which participants in a blockchain network agree on the validity of transactions and the state of the ledger. It plays a critical role in ensuring the integrity, security, and decentralization of the TAN blockchain. Let's explore the consensus mechanism employed by TAN in more detail.

## Block Per Reward Proof of Stake *(BPoS)* <a href="#proof-of-stake-pos" id="proof-of-stake-pos"></a>

TAN utilizes a ***Block Per Reward Proof of Stake (PoS)*** consensus mechanism to achieve agreement among network participants. In ***(BPoS),*** validators are chosen to create new blocks and validate transactions based on the amount of native tokens (TAN) they hold and are willing to "***stake***" as *collateral*. This means that the probability of a validator being chosen to validate the next block is proportional to the number of TAN tokens they have staked.

## Key Components of *(BPoS)* in TAN <a href="#key-components-of-pos-in-taral" id="key-components-of-pos-in-taral"></a>

1. **Validator Selection**: Validators are selected to propose and validate new blocks based on their stake in the network.  validators are ***randomly*** selected to create blocks. This random selection ensures fairness and prevents any single entity from dominating the block creation process, promoting decentralization.
2. **Block Proposal**: Selected validators propose new blocks by including a set of valid transactions and appending them to the blockchain. Each block contains a ***reference to the previous block,*** forming a chain of blocks that represents the entire transaction history of the TAN blockchain.
3. **Block Validation**: Once a block is proposed, other validators verify its validity by checking the transactions and ensuring they adhere to the network's rules and consensus protocol. If the block is deemed ***valid***, it is ***added to the blockchain***.
4. **Consensus Enforcement**: Consensus rules are enforced by the majority of validators in the network. Any attempt to propose invalid blocks or manipulate the blockchain is rejected by honest validators, preserving the integrity of the network.

## Advantages of *(BPoS)* <a href="#advantages-of-pos" id="advantages-of-pos"></a>

* **Energy Efficiency**: (***BPoS)*** consumes significantly less energy compared to ***Proof of Work (PoS)*** consensus mechanisms, making it more environmentally friendly.
* **Decentralization**: (***BPoS)*** promotes decentralization by allowing anyone to become a validator by staking TAN tokens, rather than relying on computational power as in (***PoW and PoS)***.
* **Security**: (***BPoS)*** incentivizes validators to act honestly by requiring them to stake TAN tokens as collateral. This aligns their interests with the security and stability of the network.

## Conclusion <a href="#conclusion" id="conclusion"></a>

***Consensus*** is a fundamental aspect of the TAN blockchain, enabling decentralized agreement among network participants. Through the ***Block Per Reward Proof of Stake (BPoS)*** consensus mechanism, TAN ensures the security, efficiency, and decentralization of its blockchain, paving the way for a robust and scalable decentralized ecosystem.


# Proof of Stake(Pos)

***Proof of Stake (PoS)*** is a consensus mechanism utilized by the TAN blockchain to achieve agreement among network participants and validate transactions. In (PoS), validators are selected to create new blocks and secure the network based on the amount of native tokens (TAN) they hold and are willing to stake. Let's explore how (PoS) operates within the TAN ecosystem.

## Validator Selection <a href="#validator-selection" id="validator-selection"></a>

Validators play a crucial role in the (PoS)consensus mechanism by proposing and validating new blocks. In TAN, validators are selected from a pool of participants based on the number of TAN tokens they hold and are willing to stake as collateral. The probability of a validator being chosen to create a new block is directly proportional to the amount of TAN tokens they have staked.

## Staking Mechanism <a href="#staking-mechanism" id="staking-mechanism"></a>

Staking TAN tokens is a fundamental requirement for participation in the (PoS) consensus mechanism. By staking tokens, validators demonstrate their commitment to the network and are incentivized to act honestly to preserve the integrity and security of the blockchain. In return for their efforts, validators may receive rewards in the form of additional TAN tokens.

## Block Proposal and Validation <a href="#block-proposal-and-validation" id="block-proposal-and-validation"></a>

Once selected, validators propose new blocks by including a set of valid transactions and appending them to the blockchain. Other validators in the network then verify the proposed block's validity by checking the transactions and ensuring they adhere to the network's rules and consensus protocol. If the block is deemed valid by the majority of validators, it is added to the blockchain.

## Consensus Enforcement <a href="#consensus-enforcement" id="consensus-enforcement"></a>

Consensus rules are enforced by the collective agreement of validators in the network. Any attempt to propose invalid blocks or manipulate the blockchain is rejected by honest validators, preserving the integrity and security of the network. Validators who behave maliciously or attempt to subvert the consensus process may be penalized by having their staked tokens slashed.

## Advantages of (POS) <a href="#advantages-of-pos" id="advantages-of-pos"></a>

* **Energy Efficiency**: (PoS) consumes significantly less energy compared to Proof of Work (PoW) consensus mechanisms, making it more environmental friendly.
* **Decentralization**: (PoS) promotes decentralization by allowing anyone to become a validator by staking TAN tokens, rather than relying on computational power as in (PoW) .
* **Security**: (PoS) incentivizes validators to act honestly by requiring them to stake TAN tokens as collateral. This aligns their interests with the security and stability of the network.

## Conclusion <a href="#conclusion" id="conclusion"></a>

Proof of Stake (PoS) is a robust and efficient consensus mechanism employed by the TAN blockchain to achieve decentralized agreement and validate transactions. By leveraging the staking of TAN tokens,(PoS)ensures the security, efficiency, and decentralization of the network, paving the way for a scalable and sustainable blockchain ecosystem.


# TAN Consensus(BPoS)

***Block Per Reward Proof of Stake (BPoS)*** is the core consensus mechanism driving the TAN blockchain. It merges the efficiency of ***Proof of Stake (PoS) with a unique (BPoS) Block Per Reward system*** offering a scalable and secure network. This mechanism ensures fast transaction processing, rewards network participants, and maintains the blockchain’s decentralization.

## **# H**ow it works?

TAN’s ***Block Per Reward Proof of Stake (BPoS)*** system differentiates itself by ***rewarding validators based on the number of blocks they propose***, rather than the amount of TAN tokens they stake. This ensures that validators are motivated to contribute actively to block creation and network security.

* **Fast Block Times:** TAN’s blocks are created every ***5 seconds***, enabling faster transaction processing and reducing congestion, compared to networks with slower block times.
* **Validators' Dual Role:** Validators secure the network by validating transactions and creating blocks, while also participating in governance with ***equal voting power***, giving everyone a voice in the network’s future.
* **Delegator's Role:** Delegators stake TAN tokens with trusted validators, earning rewards based on their stake. This promotes decentralization and requires ***60% validator approval*** for governance proposals, ensuring strong decision-making.

## **# Key Benefits of (BPoS):**

* **Fast Block Creation:** TAN network creates blocks every ***5 seconds,*** allowing for quick transaction processing, faster finality, and higher throughput. This is much faster than ***Ethereum’s 12-15 seconds*** block time, reducing congestion and increasing efficiency.
* **Validator Incentives:** Validators earn a share of TAN rewards for creating new blocks, encouraging active participation and network security. The block reward decreases over time through halving ***period of every four year***, controlling inflation and ensuring stability.
* **Security and Decentralization:** **(BPoS)** ensures a secure, trustless network without a central authority, keeping the blockchain decentralized and all TAN transactions secure and transparent.

## # Block Reward Distribution

Validators receive rewards for their work, but the block reward is distributed into three parts:

1. **Validator Reward (20%)**: The validator who successfully mines and validates the block receives **20%** of the block reward.
2. **Burn Subsidy (50%)**: Half of the block reward is allocated to a burn subsidy, reducing the total supply of TAN tokens over time. This mechanism enhances scarcity and value. Additionally, once a burn occurs,*(**Initial staked amount + 20%)*** of the burned amount is reverted as an incentive.
3. **Ecosystem Subsidy (30%)**: The remaining ***30%*** is distributed among various incentives to promote the growth and adoption of the TAN ecosystem. The subsidy is divided as follows:
   * **Developer Incentives**: Supporting developers contributing to the blockchain’s ecosystem.
   * **Staking Incentives**: Rewarding users for participating in staking.
   * **Wallet Incentives**: Encouraging users to hold TAN in official wallets.
   * **Holding Incentives**: Encouraging long-term holding of TAN tokens.


# Validators Reward

## # Validators Selection and Block Validation

1. **Validator Selection:-** In TAN's ***(BPoS)*** system, validators are randomly selected to create blocks. This random selection ensures fairness and prevents any single entity from dominating the block creation process, promoting decentralization.
2. **Block Validation:-** Validators' rewards are based on their performance—those who actively create blocks and validate transactions earn higher rewards. Poor performance or failure to follow network rules results in fewer rewards, encouraging validators to maintain high standards. This performance-based system prevents centralization and ensures a broad range of participants help secure the network, contributing to a more decentralized, resilient, and secure ecosystem.

## #Validator's Reward Distribution

* In TAN’s ***(BPoS)*** system, ***20% of each block’s reward*** is allocated to validators. This reward is given to validators as compensation for their role in securing the network, validating transactions, and proposing new blocks. The ***20%*** allocation ensures that validators have a strong incentive to participate in the network’s consensus mechanism, thereby maintaining the blockchain’s security and decentralization.

## **#Validator Integrity and Slashing Penalties**

TAN’s **(BPoS)** system ensures validator integrity by using slashing penalties for ***inactivity or malicious behavior**,* such as hacking. Validators who act dishonestly ***lose a portion of their stake**,* which is burned, reducing the network's token supply. This promotes security, discourages bad behavior, and maintains a healthy ecosystem.


# Burn Subsidy

## # What is Burn Subsidy?

The ***Burn Subsidy*** is a key feature of TAN’s tokenomics, where ***50% of the block reward*** is allocated to the ***Subsidy Layer**.* This layer incentivizes users to burn their TAN tokens, reducing the circulating supply and increasing scarcity. Users who burn tokens receive a ***20% reward*** over a ***one month cliff*** and ***12-month vesting period on his Initial amount*** , encouraging long-term participation. This mechanism fosters a deflationary environment, supporting the value of the token while promoting network stability. Ultimately, the Subsidy Layer ensures balanced token distribution, strengthens the network economy, and drives the overall growth of the ecosystem.

* **Allocation and Tokenomics:**\
  ***50%*** of each block reward is allocated to the ***Subsidy Layer***, ensuring it has enough resources to maintain the integrity and sustainability of the network’s tokenomics, supporting long-term health.
* **Incentivizing Token Burning and Scarcity:**\
  The Subsidy Layer encourages users to burn their TAN tokens, reducing the circulating supply and increasing scarcity, which in turn supports the token’s value over time.
* **Incentive for Burning Tokens and Long-Term Participation:**\
  Users who burn tokens receive a ***20%*** reward over a ***one month cliff*** and ***12-month vesting period on his Initial amount*****&#x20;,** promoting long-term participation and gradual involvement in the ecosystem.
* **Strengthening Network Economy and Token Utility:**\
  By encouraging token burning and rewarding participants, the Subsidy Layer fosters a deflationary environment, boosts token demand, and strengthens the overall network economy, ensuring healthy ecosystem growth.


# Ecosystem Incetives

The ***Ecosystem Incentives*** account for ***30% of the block reward*** in the ***TAN*** network. These incentives are designed to encourage various forms of participation and support for the network, ultimately driving growth and adoption. Here’s a detailed breakdown of how these incentives work:

## **# Developer Incentives:**

* **Purpose:** Promote the growth and development of the ***TAN*** ecosystem.
* **Mechanism:** Developers who contribute by building decentralized applications (dApps), smart contracts, or adding to the network's ***Total Value Locked (TVL)*** receive incentives.
* **Benefit:** This incentivizes developers to create tools and applications that expand the TAN ecosystem, fostering innovation and increasing the network's value. The goal is to make TAN a robust and versatile platform with a wide array of applications and use cases.

## **# Wallet Incentives:**

* **Purpose:** Encourage frequent use of TAN for transactions.
* **Mechanism:** Users who make frequent transactions are rewarded based on the volume of their transactions. For example, users completing transactions in increments of 1,000, 5,000, or 20,000 TAN will earn incentives.
* **Benefit:** This rewards users for using TAN as a means of exchange, increasing adoption and usage of the token. The more transactions users make, the more incentives they receive, promoting active engagement with the network.

## **# Staking Incentives:**

* **Purpose:** Reward users who stake their TAN tokens to secure the network.
* **Mechanism:** Users who stake their tokens receive additional incentives beyond block rewards. These rewards are designed to encourage users to lock up their tokens, helping to secure the network’s consensus mechanism.
* **Benefit:** Stakers are rewarded for contributing to network security and stability, and the extra staking rewards provide an ongoing incentive to hold and stake TAN, further decentralizing and securing the network.

## **# Holding Incentives:**

* **Purpose:** Reward long-term investors for holding TAN.
* **Mechanism:** Investors who hold TAN for extended periods receive incentives based on the length of time they hold the token. The longer they hold, the more incentives they earn.
* **Benefit:** This encourages a stable holder base, reducing market volatility and supporting the long-term value of TAN. It also enhances the token’s value proposition by rewarding investors for their patience and belief in the network's future.


# Scalability

***Scalability*** is a critical consideration for blockchain networks aiming to support a growing user base and handle increased transaction throughput. The TAN blockchain employs various strategies to enhance scalability and accommodate the demands of a rapidly expanding ecosystem.

## 1- Network Architecture <a href="#id-1-network-architecture" id="id-1-network-architecture"></a>

TAN's network architecture is designed to facilitate scalability by utilizing a distributed and decentralized infrastructure. The blockchain network consists of interconnected nodes that collaborate to validate transactions and maintain the integrity of the ledger. This distributed nature allows the network to scale horizontally by adding more nodes as needed to handle increased transaction volume.

## 2- Consensus Mechanism <a href="#id-2-consensus-mechanism" id="id-2-consensus-mechanism"></a>

The ***Block per Reward Proof of Stake (BPoS)*** consensus mechanism used by TAN is inherently more scalable than traditional (PoW and PoS) mechanisms. ***(BPoS)*** requires significantly less computational power, enabling faster block validation and transaction finality. This scalability advantage allows the TAN blockchain to process a higher number of ***Transactions per second (TPS)*** while maintaining network security and decentralization.

## 3- Layer 2 Solutions <a href="#id-3-layer-2-solutions" id="id-3-layer-2-solutions"></a>

To further enhance scalability, TAN explores the integration of Layer 2 scaling solutions, such as state channels and sidechains. These solutions enable off-chain transaction processing, reducing the burden on the main blockchain and increasing overall throughput. By leveraging Layer 2 technologies, TAN aims to achieve higher transaction scalability without compromising on-chain security or decentralization.

## 4- Optimized Protocol Design <a href="#id-4-optimized-protocol-design" id="id-4-optimized-protocol-design"></a>

The protocol design of the TAN blockchain is continuously optimized to improve efficiency and scalability. Through ongoing research and development, the TAN team explores innovative techniques to streamline transaction processing, reduce latency, and enhance overall network performance. By implementing protocol upgrades and optimizations, TAN aims to stay at the forefront of blockchain scalability solutions.

## 5- Community Engagement <a href="#id-5-community-engagement" id="id-5-community-engagement"></a>

Scalability is not solely a technical challenge but also requires active participation and collaboration from the community. TAN encourages community engagement through open discussions, feedback channels, and collaborative initiatives aimed at addressing scalability concerns. By fostering a vibrant and inclusive community, TAN leverages collective expertise and resources to drive innovation and scalability solutions forward.

## **Conclusion**

Scalability is a crucial aspect of the  TAN blockchain's long-term viability and success. By leveraging a distributed network architecture, a scalable consensus mechanism, Layer 2 scaling solutions, optimized protocol design, and active community engagement, TAN aims to overcome scalability challenges and establish itself as a high-performance blockchain platform capable of supporting widespread adoption and usage.


# Governance


# TAN Improvement Proposal

***TAN Improvement Proposals (TIPs)*** are a structured mechanism for proposing, discussing, and implementing changes or enhancements to the TAN blockchain protocol. TIPs provide a transparent and community-driven approach to governance, allowing stakeholders to participate in the evolution of the blockchain ecosystem.

## 1. Proposal Submission <a href="#id-1.-proposal-submission" id="id-1.-proposal-submission"></a>

Anyone can submit a TAN Improvement Proposal by following a standardized template and submitting it to the designated platform or forum. The proposal should clearly outline the problem or opportunity, proposed solution, rationale, and potential impact on the TAN ecosystem. Submitters are encouraged to engage with the community to gather feedback and refine their proposals before submission.

## 2. Proposal Discussion <a href="#id-2.-proposal-discussion" id="id-2.-proposal-discussion"></a>

Once submitted, TIPs undergo a period of community discussion and review. Members of the TAN community, including developers, validators, and token holders, are invited to provide feedback, ask questions, and express their opinions on the proposal. This open dialogue ensures that proposals are thoroughly vetted and considered from diverse perspectives.

## 3. Decision Making <a href="#id-3.-decision-making" id="id-3.-decision-making"></a>

After the discussion period, the TAN community may proceed to a formal decision-making process to determine the fate of the proposal. Depending on the governance model implemented by the TAN blockchain, decision-making may involve voting by stakeholders, consensus among key participants, or other mechanisms designed to ensure fair and inclusive governance.

## 4. Implementation <a href="#id-4.-implementation" id="id-4.-implementation"></a>

If a TAN Improvement Proposal receives sufficient support and consensus from the community, it may be implemented by the TAN development team or relevant stakeholders. Implementation involves integrating the proposed changes into the TAN blockchain protocol through software upgrades or protocol adjustments. Throughout the implementation process, transparency and accountability are maintained to ensure that changes align with the community's wishes and objectives.

## 5. Monitoring and Evaluation <a href="#id-5.-monitoring-and-evaluation" id="id-5.-monitoring-and-evaluation"></a>

Following implementation, the effects of the proposed changes are monitored and evaluated to assess their impact on the TAN ecosystem. Feedback from users, developers, and other stakeholders is solicited to gauge the success of the improvements and identify any areas for further refinement or adjustment. This iterative process ensures that the TAN blockchain remains dynamic and responsive to evolving needs and challenges.

## **Conclusion**

TAN Improvement Proposals (TIPs) play a crucial role in shaping the future of the TAN blockchain ecosystem. By providing a transparent and community-driven mechanism for proposing and implementing changes, TIPs empower stakeholders to actively participate in governance and contribute to the growth and development of the blockchain. Through collaboration, consensus, and continuous improvement, TAN strives to foster a vibrant and resilient ecosystem that meets the needs of its diverse user base.


# ❓FAQ's


