In our journey of developing Multichain, a pivotal aspect was to devise a seamless yet secure method of managing and notifying funds. This encompasses the intricate process of transferring deposited funds from warm to cold wallets and notifying users upon each deposit. Here, we delve into these mechanisms, highlighting their technical intricacies and operational efficiencies.
Fund Management: From Warm to Cold Wallets
At Multichain, we handle the safekeeping of deposited funds with utmost precision. This involves a two-tier wallet system: warm and cold wallets. The warm wallets are online wallets used for immediate transactions. Although they offer quicker access, they are not ideal for long-term storage due to potential security risks. This is where cold wallets come into play.
- Sweeping Funds to Cold Wallets:
- Warm wallets periodically sweep deposited funds into cold wallets. Cold wallets are offline storage, offering enhanced security for long-term holding. This process is especially crucial for ERC20 and TRC20 tokens, which are subject to the nuances of blockchain transactions.
- For ERC20 and TRC20 tokens, the system first estimates the necessary gas fees, which are in Ethereum for ERC20 and Tron for TRC20 tokens. This estimation is vital to ensure successful transaction completion without unnecessary delays or failures.
- Buffer Amounts for Gas Fees:
- To facilitate the sweeping process, our system sends buffer amounts of Ethereum or Tron to the warm wallets. This buffer is essential to cover the gas fees for forwarding or sweeping the ERC20/TRC20 tokens to the cold wallets.
- Transaction Types:
- Native tokens like Ethereum and Tron typically require a straightforward ‘sendTransaction’ operation for forwarding. However, for ERC20/TRC20 tokens, the process involves a ‘sweeping’ transaction. This distinction is key to understanding the varying operational requirements for different token types.
Real-Time Notifications: Keeping Users Informed
Another critical feature of Multichain is the real-time notification system, which keeps users updated on their transactions, particularly deposits.
- Webhook Callback URL:
- Whenever a deposit is received in a user’s wallet, our system triggers a notification through a webhook callback URL. This is an automated message sent to the platform that has integrated Multichain, notifying them of the deposit.
- Technical Implementation:
- This notification system is implemented using webhook technology. When a deposit transaction is confirmed on the blockchain, our backend system detects this change and sends an HTTP POST request to the registered webhook URL of the integrated platform.
- The payload of this POST request contains detailed information about the deposit, such as the amount, transaction ID, and wallet address. This enables the integrated platform to promptly update their records and notify the end-user of the deposit.
Conclusion
Incorporating these sophisticated fund management and notification systems in Multichain has been a cornerstone of our development process. By ensuring efficient and secure fund transfers and providing real-time transaction updates, we have elevated the user experience, making crypto transactions not only seamless but also reassuringly transparent. As we continue to evolve Multichain, our focus remains on enhancing these systems, ensuring they remain robust, secure, and user-friendly in the dynamic world of cryptocurrency payments.