GRAM: creating and linking TON wallets
TON · Laravel · Wallet microservice · Testnet / Mainnet
Creating and linking TON wallets in GRAM
GRAM is a dedicated microservice that creates and links TON wallets, synchronizes transactions and sends confirmed deposits to the main P2P platform.
The main application owns users and business operations. GRAM owns TON addresses, encrypted key material, balances, transaction history, deposits, withdrawals and fund collection. This separation reduces the amount of code that can access sensitive data.
Wallet creation and linking
Request from the main application
The platform sends its user identifier through a signed service-to-service request and receives only public wallet data.
Existing-link check
A unique mapping prevents a retry from creating a second wallet for the same user and network.
Generation and storage
The service creates a V5R1 wallet, encrypts mnemonic material at rest and stores public address data separately.
Background synchronization
Webhook events are complemented by polling and history reconciliation so temporary provider failures do not lose deposits.
Three wallet roles
Different responsibilities use different wallet types and operational controls.
User wallet
A dedicated deposit address linked to the external user identifier.
Collector wallet
A treasury destination that consolidates funds from many user wallets under configured limits.
Autonomous wallet
A service-owned wallet used for controlled system operations rather than direct user deposits.
From an inbound transaction to platform balance
Detect
Receive an event or discover the transaction through polling and normalize its hash, logical time, amount and message data.
Webhook · polling · normalizationValidate
Confirm the intended transfer type, network, address, amount and required confirmations before treating it as a deposit.
Opcodes · confirmations · validationRecord once
Store the transaction under unique blockchain identifiers so repeated provider events remain idempotent.
Unique keys · ledger · idempotencyDeliver
Write a durable outbox event and send it to the main platform until an authenticated acknowledgement is received.
Outbox · retries · acknowledgement
Service API protection
HMAC signatures
Method, path, query, body hash, timestamp, nonce and idempotency key are signed in a canonical order.
Replay protection
Short timestamp windows and one-time nonces reject captured requests that are sent again.
Network controls
An IP allowlist, strict error contract and audit log add layers around application-level authentication.
Technology and delivery
Expected result
A separated TON custody service that creates wallets safely, detects deposits without duplicates and delivers confirmed financial events reliably to the main application.
GRAM · TON · V5R1 · Laravel · Wallets · Deposits · HMAC · Outbox · Custody
Discuss your project
If you have a project involving Python, Laravel, Node.js, CRM, Telegram, AI/RAG, API integrations, automation or TON/GRAM logic, send me a short description of what you need.
You can simply explain what exists now, what is not working, what outcome you expect and which services are already involved.
