Logo

How to Create a Token on peaq: A Step-by-Step Developer Guide

Summary

Learn how to create a token on the peaq network, the layer-1 blockchain for DePIN and the Machine Economy. This guide covers token standards, no-code tools like Bitbond's Token Tool, smart contract deployment, and essential RPC setup for interacting with peaq.

Token Creation Decision Checklist

Before you start, consider the following criteria to choose the best approach for your project:

CriterionWhat to checkWhy it matters
Token standardERC-20, ERC-721, or ERC-1400?Determines token functionality (fungible, non-fungible, or security token).
Technical skillCan you write Solidity?No-code tools are faster; custom contracts offer more flexibility.
Custom featuresNeed taxes, minting, burning, or whitelisting?Advanced features require custom code or a tool that supports them.
BudgetWhat are the gas fees on peaq?peaq offers low fees, but complex contracts cost more to deploy.
TimelineHow soon do you need the token live?No-code tools can deploy in minutes; custom development takes longer.
RPC reliabilityDo you have a reliable peaq RPC endpoint?A stable RPC ensures smooth deployment and interaction.

Understanding peaq and Its Token Standards

peaq is a Substrate-based blockchain that is EVM-compatible, meaning you can deploy Ethereum-standard tokens like ERC-20, ERC-721, and ERC-1400. The network is optimized for DePIN projects, offering high throughput (10,000 TPS at launch), low fees, and a Nakamoto coefficient of 130+. For token creation, you have two primary paths:

  • No-code token generators like Bitbond's Token Tool, which provide a user-friendly interface to configure and deploy tokens without writing Solidity.
  • Custom smart contract deployment using tools like Hardhat or Remix, giving you full control over token logic.

Prerequisites

Before creating a token, ensure you have:

  • A Web3 wallet (e.g., MetaMask) configured for the peaq network.
  • Sufficient PEAQ tokens to cover gas fees (for deployment and transactions).
  • A reliable peaq RPC endpoint. You can use OnFinality's public RPC or get a dedicated endpoint for production workloads. See peaq RPC Guide for connection details.
  • (Optional) Basic familiarity with Solidity if deploying a custom contract.

Step-by-Step: Creating a Token Using Bitbond's Token Tool

Bitbond's Token Tool is the most popular no-code solution for peaq. Follow these steps:

Step 1: Access Token Tool

Navigate to Token Tool on peaq.

Step 2: Connect Your Wallet

Click "Connect Wallet" and select MetaMask (or another Web3 provider). Ensure your wallet is set to the peaq network. If not, add peaq using the following RPC details:

  • Network Name: peaq
  • RPC URL: https://peaq.api.onfinality.io/public (or your own endpoint)
  • Chain ID: 3338
  • Symbol: PEAQ
  • Block Explorer: https://peaq.subscan.io

Step 3: Configure Token Details

Fill in the token parameters:

  • Token Name: e.g., "MyDePINToken"
  • Symbol: e.g., "MDT"
  • Initial Supply: e.g., 1000000
  • Decimals: 18 (standard)

Step 4: Advanced Settings (Optional)

You can enable features like:

  • Can Burn: Allow token holders to burn tokens.
  • Can Mint: Allow the owner to mint new tokens.
  • Set Total Supply Cap: Limit the maximum supply.
  • Charge Transaction Tax: Apply a fee on transfers.
  • Apply Burn Fee: Deflationary token mechanism.
  • Apply Holder Rewards: Reflection token feature.

Step 5: Review and Confirm

Check the estimated gas fee (displayed in PEAQ). Click "Create Token" and confirm the transaction in your wallet. Wait for confirmation (usually under a minute). Your token contract address will be shown upon success.

Step-by-Step: Deploying a Custom ERC-20 Token on peaq

For developers who need full control, here's how to deploy a custom token using Hardhat:

1. Set Up the Project

mkdir peaq-token
cd peaq-token
npm init -y
npm install --save-dev hardhat @nomicfoundation/hardhat-toolbox
npx hardhat init

2. Write the Smart Contract

Create contracts/MyToken.sol:

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

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

contract MyToken is ERC20 {
    constructor(uint256 initialSupply) ERC20("MyDePINToken", "MDT") {
        _mint(msg.sender, initialSupply);
    }
}

3. Configure Hardhat for peaq

Edit hardhat.config.js:

require("@nomicfoundation/hardhat-toolbox");

module.exports = {
  solidity: "0.8.20",
  networks: {
    peaq: {
      url: "https://peaq.api.onfinality.io/public",
      accounts: ["YOUR_PRIVATE_KEY"]
    }
  }
};

4. Deploy the Contract

Create a deployment script scripts/deploy.js:

async function main() {
  const [deployer] = await ethers.getSigners();
  console.log("Deploying with account:", deployer.address);

  const MyToken = await ethers.getContractFactory("MyToken");
  const token = await MyToken.deploy(ethers.parseEther("1000000"));

  console.log("Token deployed to:", token.target);
}

main().catch((error) => {
  console.error(error);
  process.exitCode = 1;
});

Run:

npx hardhat run scripts/deploy.js --network peaq

Your token is now live on peaq.

Connecting to peaq via RPC

To interact with your token or the network, you need a reliable RPC endpoint. OnFinality provides both public and dedicated RPC services for peaq. Here's how to connect using JSON-RPC:

curl https://peaq.api.onfinality.io/public \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc":"2.0",
    "method":"eth_blockNumber",
    "params":[],
    "id":1
  }'

For production applications, consider a dedicated node to avoid rate limits and ensure consistent performance.

Common Pitfalls and Troubleshooting

  • Insufficient gas: Ensure your wallet has enough PEAQ. peaq fees are low, but complex contracts may require more.
  • Wrong chain ID: Double-check that your wallet is set to peaq (chain ID 3338).
  • RPC errors: If you encounter timeouts, switch to a more reliable RPC provider like OnFinality.
  • Token not showing in wallet: Import the token contract address manually into your wallet.

Key Takeaways

  • peaq supports ERC-20, ERC-721, and ERC-1400 token standards via its EVM compatibility.
  • No-code tools like Bitbond's Token Tool enable token creation in minutes without coding.
  • For custom tokens, use Hardhat or Remix to deploy Solidity contracts.
  • Always use a reliable RPC endpoint for deployment and interaction. OnFinality offers public and dedicated peaq RPC services.
  • peaq's low fees and high throughput make it ideal for DePIN and machine economy projects.

Frequently Asked Questions

What is the peaq network?

peaq is a layer-1 blockchain designed for the Machine Economy and DePIN. It is EVM-compatible and built on Substrate, offering high scalability, low fees, and interoperability.

Can I create a token on peaq without coding?

Yes. Use Bitbond's Token Tool, a no-code token generator that lets you configure and deploy tokens in a few clicks.

What token standards are supported on peaq?

peaq supports ERC-20 (fungible tokens), ERC-721 (NFTs), and ERC-1400 (security tokens) via its EVM compatibility.

How much does it cost to create a token on peaq?

The cost is the gas fee for deploying the smart contract. peaq's fees are low; typical deployment costs a few dollars worth of PEAQ.

How do I connect to peaq?

You can connect via RPC using an endpoint like https://peaq.api.onfinality.io/public. For production, consider a dedicated node. See peaq RPC Guide for details.

Where can I find the token contract address after creation?

After deployment, the contract address is shown in the tool or console output. You can also find it on the peaq block explorer (e.g., Subscan).

Can I add custom features like taxes or minting?

Yes. The Token Tool supports advanced features like burn fees, reflection rewards, and minting. For more complex logic, deploy a custom smart contract.

What is the chain ID for peaq?

The chain ID is 3338.

How do I get PEAQ tokens for gas?

You can acquire PEAQ from exchanges or faucets. Ensure you have enough to cover deployment and transaction fees.

Is peaq secure for token creation?

Yes. peaq has a high Nakamoto coefficient (130+) and uses robust cryptographic techniques. Always audit your smart contract if deploying custom code.

Next Steps

Now that you've created your token, consider:

  • Adding liquidity on a decentralized exchange.
  • Integrating with wallets and dApps.
  • Exploring peaq's Modular DePIN Functions for machine identity and payments.
  • Monitoring your token's performance with a reliable RPC provider. OnFinality offers RPC pricing suitable for any scale.

For more information, visit the peaq documentation or check out supported networks for other chains.

RPC Knowledge Base

Related RPC details

Never Worry about Infrastructure Again

OnFinality takes away the heavy lifting of DevOps so you can build smarter and faster.

Get Started