P2P Platform Development: Deals, TON and Jetton
P2P · Laravel · Vue · TON · Jetton
P2P is a platform for the exchange of cryptocurrency between users. The project combines announcements, transactions, correspondence and dispute resolution. To work with TON wallets and Jetton tokens, the application is associated with a separate GRAM microservice.
Project task
Organize an exchange between two participants: from choosing an announcement and creating a transaction to confirming payment and completing the exchange. One application requires a personal account, payment details, chat transactions and an administrative section for disputes.
A separate task is to link user balances with revenues from the blockchain. The platform maintains internal accounting, and GRAM maintains wallets and transmits information about confirmed deposits.
Platform architecture
Main annex
Laravel is responsible for server logic, Inertia and Vue are responsible for the interface. Here are ads, transactions, user profiles, bank details and administrative tools.
Wallet microservice GRAM
The work with the blockchain is made in a separate application. P2P receives deposit events from GRAM and forwards Jetton withdrawal requests via API interservice.

Announcements and transactions
The user creates an ad for the purchase or sale of cryptocurrency. The other party selects the offer and opens the deal. Separate actions are provided for its support:
- creation and confirmation of the transaction;
- acceptance or rejection of the proposal;
- a note on sending payment;
- completion of the exchange or cancellation;
- Dispute opening and closing.
The deal has correspondence with attachments and reading notes. Payment details are managed in the profile. For the administrator, there is a view of transactions, work with disputes and a directory of their causes.
The participant’s mark of payment and the completion of the exchange are different actions. This allows you to separate the message about sending money and the further decision on the transaction.
TON and Jetton
GRAM transmits confirmed incoming transactions to P2P via API. The TON and Jetton have different handlers and separate balance sheets.
The integration uses an external event identifier: a repeat delivery of one deposit must be recognized as a repeat of an already known transaction. For Jetton, the project documentation describes a separate log of credits and movements on user balances.
This approach connects a specific blockchain operation with its reflection in the accounting of the platform.
Conclusion Jetton
According to the scheme described in the draft, when creating an application, the platform reserves the amount and commission on the user's balance. After confirmation by GRAM, the reserve is debited, and in case of failure or error, it is released.
Synchronization of applications made to the background team. It restores the sending of undelivered requests and updates the status of active operations after restarting the queue.
Access and Interoperability of Services
User account
The project includes PIN, two-factor authentication, Telegram binding and access recovery scenarios. User and administrative operations are separated in application routes.
API between P2P and GRAM
The integration uses a HMAC signature, timestamp, a one-time nonce, a list of allowed IP and Idempotency-Key. Signing a request and recognizing a repeat financial transaction solve separate problems.
Stack and deployment
Laravel, PHP, Inertia, Vue, MySQL and Redis. The application runs in Docker: Nginx, PHP-FPM, queue handler, scheduler and Laravel Reverb for WebSocket connections work separately.
Background processes are separated from web request processing. The documentation contains the order of project deployment, code update, migration launch and interface assembly.
Test token for integration
To test the interaction between P2P and GRAM, a separate TGRAM project in TON testnet was prepared. It includes Jetton contracts and tools for deploying, issuing and transferring test tokens.
TGRAM is used for integration scenarios in the test network. It is not a separate payment asset of the P2P platform.
What brings the project together
The user part is responsible for the exchange between participants, the administrative part is responsible for the support of transactions, and the integration with GRAM is responsible for the communication with wallets and the blockchain. TON and Jetton are counted separately, the output of Jetton passes through reservation and synchronization of applications.
The description is based on project documentation and itineraries. Indicators of load, turnover and commercial results in the case are not stated.











