-
Notifications
You must be signed in to change notification settings - Fork 182
FIP Discussion: Merge multiple transfer transactions into one #218
Description
Simple Summary
Aggregating multiple transactions into a single transaction optimizes the user experience and reduces user overhead as paying for each transaction is expensive and cumbersome.
Abstract
In the process of transaction creation, multiple transactions are aggregated into one transaction, and they are processed separately in the execution, thus reducing the cost of transaction execution and saving the cost of users.
Change Motivation
Chain bandwidth is a valuable resource, necessary for both critical network operations and product use.
Avoiding frequent and high-gas-cost operations reduces contention, costs, and chain validation latency.
Given the state of the network, users have to pay a fee for each transaction, and the cost of calling multiple methods in a period of time is a significant cost to the user. Imagine a scenario where a user needs to transfer money to multiple addresses at the same time, but each transaction can only be transferred to one address,which is extremely inconvenient for the user. On the other hand, it is also a very troublesome thing when the user needs to check the fund flow of his account.
Specification
- Aggregating information from multiple calls into the parameters of a transaction.
- Mark transactions in a specific way, route them to a specific processing method for execution, and reduce execution costs.
Design Rationale
The handling of messages in the official project is quite mature, so changing the logic of the actor part of the code is not desirable. Therefore, in the stage of message routing, the message is intercepted, and then the message is split, and the transaction cycle execution after splitting is the most appropriate way. The advantage of this is that it does not affect the native logic, but only extends the functionality, ensuring the security and compatibility of the code.
The data structure of the message itself has jSON-formatted parameters, which can be used to carry multiple transactions. Multiple transactions are serialized into parameters and parsed at execution time.
Most of the cost of aggregating multiple transactions goes to tipping miners, whose job is simply to package transactions, so cutting tipping for miners can significantly reduce transaction costs for users.