Optimizing Payment Processing on the TON Blockchain: A Technical Overview

The TON Blockchain (The Open Network) has garnered attention for its advanced features and scalability. In this post, we delve into a microservice designed for handling payments and withdrawals within the TON ecosystem, focusing on its implementation, features, and deployment. This service is particularly relevant for developers and businesses looking to integrate TON payments into their systems.

Overview of the TON Payment Processor

The TON Payment Processor is a microservice that facilitates the acceptance of payments and the execution of withdrawals to wallets on the TON blockchain. It supports both TON coins and Jettons, provided they meet specific criteria, and offers a REST API for seamless integration. The service operates on the ADNL protocol, ensuring direct interaction with the TON node without reliance on third-party APIs.

Note: The project is currently in the testing and proof-of-concept phase. Users are advised to exercise caution and contribute suggestions for improvement.


Key Features

  • Deposit Address Generation: Generates new deposit addresses for TON or Jetton wallets, to which customers can send payments. These payments are accumulated in a hot wallet.
  • Withdrawal Execution: Allows for the withdrawal of TONs or Jettons from the hot wallet to the customer’s wallet on the TON blockchain.
  • Multiple Payment Reuse: Deposit addresses can be reused for multiple payments.
  • Batch Withdrawals: Supports sending withdrawals in batches using a high-load wallet, optimizing transaction efficiency.
  • Cold Wallet Aggregation: Aggregates a portion of TONs or Jettons in a cold wallet for enhanced security.
  • Bearer Token Authorization: Ensures secure access to the service through Bearer token authentication.

Glossary

  • Deposit Address: An address generated by the service for receiving payments.
  • Hot Wallet: A wallet aggregating all incoming TONs and Jettons from deposit addresses.
  • Cold Wallet: A secure wallet for storing a portion of funds transferred from the hot wallet.
  • User ID: A unique identifier for associating deposit addresses or withdrawal requests with a specific user.
  • Query ID: A unique identifier for tracking withdrawal requests and preventing double-spending.

Deployment and Configuration

The deployment of the TON Payment Processor involves several configurable parameters, including connection settings for the TON lite server, database URI, API host and token, and wallet addresses. It is crucial to ensure the correct setup of these parameters to guarantee the smooth operation of the service. For detailed deployment instructions and a complete list of configurable parameters, please refer to the official documentation.

Prerequisites

  • A minimum amount of TONs in a HighloadV2 wallet or a pre-deployed HighloadV2 wallet.
  • A TON node with a lite server on the same machine as the service.
  • Jettons that meet the specified criteria for compatibility and transaction fees.

Conclusion

The TON Payment Processor is a promising tool for integrating TON blockchain payments into various applications. Its focus on direct interaction with the TON node and support for both TON coins and Jettons makes it a versatile solution for developers and businesses. As the project evolves, it is expected to become a cornerstone in the TON ecosystem for payment processing.


For more information and updates, join the discussion on Telegram and explore the GitHub repository.