Skip to content
Projects

LightCountry/TokenPay has 1,103 GitHub stars and 306 forks. Star changes are not measured yet. Last checked 2026-11-09 10:13 UTC. Last push 2026-09-26.

How these counts are measured

✅一款同时支持动态和静态收款地址收取TRX、USDT-TRC20、ETH系列区块链所有代币的支付解决方案!✅A payment solution that supports both dynamic and static payee addresses to receive TRX, USDT-TRC20, all tokens of ETH series blockchain!

Measured star growth

in 24h
Update delayed
in 7 days
Update delayed
in 15 days
Update delayed
in 1 month
Update delayed

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README_EN.md

Original

TokenPay

GPLv3 license .NET 8 version 1.0.0

简体中文 | English

TokenPay — a blockchain payment solution

TokenPay is an open-source, self-hosted payment solution that accepts TRX, USDT-TRC20, EVM-native coins, and ERC-20 tokens through either dynamic or static receiving addresses. It can theoretically work with any EVM-compatible blockchain, including Ethereum, BNB Smart Chain, and Polygon.

Overview

  • TokenPay is written in C# and is designed for private, self-hosted deployments.
  • Payment pages are available in Simplified Chinese and English. The interface follows the visitor's device language and falls back to English for any other language. More languages can be added via the ExtraLanguages setting together with matching localized pages.
  • No separate database server or Redis instance is required. TokenPay uses an embedded SQLite database.
  • It can be integrated with any system that needs to accept TRX, USDT-TRC20, EVM-native coins, or ERC-20 tokens.
  • TokenPay is distributed under the GPLv3 license.

Features

  • Cross-platform C# implementation for Windows, Linux, and macOS on x86 and ARM hardware.
  • Supports assigning a receiving address per order or per customer, reducing the risk of matching a payment to the wrong order when a shared address is used.
  • Runs as a compiled application without requiring a separate database or cache service.
  • Includes an optional, read-only administration interface for reviewing orders, wallet balances, and exchange rates. Administrators can also reconcile an expired order after independently verifying its on-chain payment.

Repository layout

TokenPay
├── Plugs   # Integration plugins
├── Wiki    # Documentation
└── src     # TokenPay application source

Available integrations

Integration and documentation

Tutorials

Administration interface

The administration interface is disabled by default and returns HTTP 404 under /admin until it is explicitly enabled. It provides paginated, searchable, read-only access to order, wallet, and exchange-rate records. Wallet private keys are neither selected from the database nor displayed.

Authentication uses a secure, hashed password and an HTTP-only session cookie. Login attempts are rate-limited, state-changing requests are protected against CSRF, and HTTPS-only cookies are enabled by default for production use.

To generate an administrator password hash:

dotnet TokenPay.dll --hash-admin-password "your-long-random-password"

Then configure the Admin section in appsettings.json:

{
  "Admin": {
    "Enabled": true,
    "Username": "admin",
    "PasswordHash": "paste-the-generated-hash-here",
    "SessionMinutes": 30,
    "RequireHttps": true
  }
}

Keep RequireHttps enabled on public or production deployments. See the administration guide for configuration details, security recommendations, and the manual order reconciliation procedure.

Community and feedback

How payment detection works

TokenPay uses APIs provided by services such as TronGrid and blockchain explorers to poll incoming TRX, ETH, USDT, USDC, and other supported transfers to addresses associated with active orders. It compares each incoming amount with the expected order amount and completes the order when a valid match is found.

0. The server periodically refreshes exchange rates.
1. The customer submits a payment and the transaction is recorded on-chain.
2. The server polls blockchain APIs for recent incoming transactions to monitored addresses.
3. A matching transaction causes the order to be marked as paid.
4. The asynchronous notification service sends the payment result to the merchant's callback URL.

Donate

If TokenPay has been useful to you, you can support its development:

USDT-TRC20: TKGTx4pCKiKQbk8evXHTborfZn754TGViP
USDT-TRC20 donation QR code

Acknowledgements

TokenPay uses or has benefited from the following open-source projects:

Serilog GitHub stars

FreeSql GitHub stars

Flurl GitHub stars

Nethereum GitHub stars

HDWallet GitHub stars

Disclaimer

TokenPay is open-source software intended for learning, research, and technical communication. It must not be used in violation of the laws or regulations of the People's Republic of China (including Taiwan Province) or the jurisdiction in which the user operates.

The author develops and publishes the source code only and does not participate in users' operations or commercial activities. Users are solely responsible for how they deploy and use the software and for any legal consequences arising from that use.

Warning

Blockchain tokens referenced by this project are included for educational purposes. The author does not endorse their financial or speculative attributes and does not encourage or support illegal activities involving mining, token speculation, or ICOs. Digital-asset markets can be volatile and may not be subject to conventional regulatory protections. Exercise caution and comply with all applicable laws.

Explore related projects