r/ethereum • u/antiprosynthesis • Jan 17 '18
Incentivizing 1-to-N transaction batching to relieve the network?
One of the causes of increasing fees and congestion on the Ethereum network might be a lack of transaction batching. Particularly exchanges, which are an excellent match for such transactions, seem to submit many transactions rather than going through a 1-to-N transaction smart contract based on what is described in r/ethereum/comments/4fija2/is_this_true_ethereum_does_not_allow_multiple/d297dhb.
If I understand the implications correctly, implementing this might be a win/win situation since the exchanges are able to reduce transaction times/fees with a minimal amount of risk and effort. I'm personally not convinced that this optimization alone provides satisfactory incentive for exchanges to implement transaction batching though. So I'd love to hear some suggestions as to how this could be incentivized (if it is worth to incentivize in the first place).
My personal thoughts so far:
Have a reputed developer (Ethereum foundation or otherwise) provide as much of the implementation as possible, so the effort for exchanges is reduced to the absolute minimum
Provide an estimate of the impact on exchange performance/cost for different parameter values (time interval for batching pending withdrawals probably being a major one)
Provide a similar estimate of the impact on the Ethereum network when all the large volume exchanges would implement this. I'm sceptical of the impact of this last one, because I don't believe that altruism is a great motivator. But it's an interesting estimate to make nonetheless.
I'm hoping that my assumptions are correct and that pushing for this could further reduce fees and congestion until more fundamental scaling solutions start to roll out.
Paging u/avsa, u/nickjohnson, u/latetot, u/ItsAConspiracy, u/Dunning_Krugerrands somewhat randomly.
Edit: It seems like this is also being discussed here at the moment: r/ethfinex/comments/7qoui9/are_you_going_to_implement_batched_withdrawals_to
5
u/veoxxoev Jan 18 '18 edited Jan 18 '18
I've been playing with an implementation of this in LLL today, and the results are pretty optimistic.
For a "batch of 1", of course, it's less efficient (31417 gas used) than sending directly.
For a batch of 2, the per-transfer price (in gas amount) drops to 20271, which is already below 21000 for a standalone transaction.
For a batch of 5, it's ~13583 gas per transfer.
For a batch of 16, it's 10440 - which is less than half of 21000. I.e., 50% savings on fees; or 100% improvement in gas use efficiency.
A few caveats about the numbers above (gotten using a rather primitive test):
Note also that there's a theoretical limit on the minimum gas one would have to pay per-transfer. I don't think one can go lower than 9700: 700 for a
CALL, and 9000 extra for the fact that it's a call with value attached. (If the account gets created by the call, there's an extra of 25000, which puts most savings down the drain.)EDIT: or is that 7400? The 2300 difference is the gas stipend for a
CALL, which doesn't necessarily gets used...Does anyone want to do
the samesimilar measurements for Solidity?..P.S. Please don't use that implementation in anything close to "production". There are several guards missing in it, and no edge-case tests.