Currently,
IOTA uses the concept of bundles to create transfers. Bundles are a series of transactions that are linked together using their trunk reference.
These transactions have a fixed layout and a fixed size independently of their “content”. Since the signature of value transactions does not fit into a single transaction, we usually have to use at least 3 transactions to create a simple transfer: 2 transactions for the input + their signature and a transaction for the remainder (without a signature).
I want to use this thread to discuss a possible change of this mechanism and also discuss the reasons for this proposed change.
I want to start with the reasons why I think that atomic, variable sized transactions might be the better choice post-coordicide and then also discuss the aspects that are usually considered to be arguments “for” the current approach.
Reasons to use atomic, variable sized transactions instead of bundles
-
Less network overhead: The transaction format can be adjusted to only carry the information that is really required. We can completely omit sending a lot of unnecessary information for the consecutive transactions of a bundle (2nd signature transaction + remainder). Especially the use of UTXO post-coordicide will most probably make this situation even worse and force us to use even more transactions to create a simple transfer.
-
Less signature verifications: Post-coordicide, every transaction has to contain the node id and the signature of the node that issued the transaction. This means that for a simple transfer we need to verify the signatures of at least 3 transactions. Considering that the signature verification is the most expensive part of the transaction processing, this means that the introduction of node ids will reduce the performance of nodes by at least 300% if we stick to the current approach (and it gets even worse for bigger bundles). This essentially means that nodes will be able to process hundreds maybe even thousands of transactions less than they could with atomic transactions that are not split into bundles.
-
Better spam-protection and congestion control: The size of the bundle is not known until we have received the last transaction. This means that it can happen that we accept and route a certain amount of transactions, to then later detect that the issuing node has exceeded its quota and drop all additional transactions. This means that we have routed and processed messages that could have been filtered right from the start if we would have seen that the issuing node tries to send a transfer that is too big. This might even open an attack vector where a node issues different bundles to different people that will all start to process the transactions of the bundle and then drop them at different times again unnecessarily increasing the load in the network.
-
Shorter Merkle-proofs (for sharding): The Merkle proofs for inter-shard transactions get much smaller (at least 300%) if we do not have to traverse all the transactions in a bundle to reach the next transfer. This will make inter-shard transactions much faster and more lightweight.
Reasons to use bundles instead of atomic transactions
I now want to discuss the reasons that previously led to the design decision of having bundles instead of variable sized transactions. I will write a short opinion to every point. If you feel like there are arguments missing or have a different opinion that challenges my view, feel free to answer accordingly.
The following list of arguments is taken from the corresponding stack exchange thread that asked for the reason of having fixed-size transactions and the concept of bundles:
- Smaller codebase for transaction processing (if implemented in software)
Since one of the biggest bottlenecks of IOTA is the huge size of transactions, we have started to implement an on the fly compression for the gossip layer. This makes the codebase much more complex and kind of negates this argument.
- Fewer logic gates for transaction processing (if implemented in hardware)
Same argument as above.
- Higher security (because of a lower chance for buffer overflow type bugs to happen)
While I agree that it is “easier” to not make mistakes, well written code should not have these kind of bugs and the code base is quite complex anyway. So reducing the complexity of one part does not really “solve” anything if other parts need to deal with dynamically sized data anyway (especially considering the on the fly compression).
- Reduced resource consumption (because of absence of issues like heap fragmentation)
This is actually a valid argument but it is again negated by the on the fly compression which is anyway necessary to achieve any meaningfull network throughput.
- Better load balancing (because transaction processing is more predictable)
This argument is not valid in the presence of a rate control and congestion module (see arguments above).
- Atomic transmission over a physical medium (because packet size can be equal to transaction size + service data)
IOTA transactions are bigger than the default MTU size so this would only make sense if we could shrink the size of a transactions below 1500 bytes.
Conclusion
I do understand where the original ideas of using bundles are coming from, but I think that the changes that are necessary for coordicide with performance impacts of multiple 100% justify a change of this mechanism.
At the same time it gives us much more flexibility regarding things like meta-transactions and will allow us to fully utilize the network layer without wasting any unnecessary bandwidth.
Since the gossip layer does not need to compress things on the fly anymore, we will also see a much smaller codebase for both hardware and software.
Please discuss!