WavesGo has always been at the forefront of innovation within the Waves ecosystem, particularly technical innovation. The freshly introduced Mass Transfer Transaction offered us another opportunity to step forward, demonstrate the power of a feature and show best practices. The results we observed were so overwhelming that we decided to abandon the token fee for leasing reward distribution and start to make use of the new Mass Transfer Transaction. More about the results a little later, let’s first have a look at the new feature.
The Mass Transfer feature is a new type of transaction (type 11) on the Waves blockchain. In a nutshell, it makes it possible to include up to 100 recipients in one single transaction. Below you can find an example of a Mass Transfer transaction encoded as JSON:
The yellow part is the salient point: Before type 11 was introduced, a regular transfer on Waves (type 4) only allowed to include one single recipient. Thus, every single type 4 transaction included the light blue part and therefore bloated the blockchain. The Mass Transfer transaction allows us to eliminate the need of repeating the light blue part for each recipient and therefore reduces blockchain bloat. We’d also like to emphasize the speed at which these transactions are confirmed — mind-blowing.
Marc Jansen (@hawky) made a great effort during the last weeks to make Mass Transfers easy-to-use by implementing them in the PyWaves library. This week, we were able to use the Mass Transfer feature to distribute leasing rewards for the first time. Find the video of our reward distribution this morning below:
Let’s crunch the numbers:
- Before Mass Transfer, it took roughly 60 minutes to complete a reward distribution (~12’000 transactions)
- With Mass Transfer, we transferred $WGO to 6664 addresses in 38 seconds
- The second round, distribution of $WAVES rewards, completed even faster. We did 6760 transfers within 31 seconds (!)
- We achieved a maximum throughput of 217 transfers per second (!)
In the video, Marc mentioned that the distribution used to take about an hour in total. Thus, transfer speed is increased by factor 50 while keeping blockchain bloat as tiny as possible. Out of curiosity, we decided to do the maths for how much blockchain space we saved:
Type: 1 byte
TX ID: 32 bytes
Public Key: 32 bytes
Sender: 26 bytes
Timestamps: 16 bytes
Proof: 64 bytes + 2 bytes
Asset ID: 1 byte
Attachment: 10 bytes
Total: 184 bytes
Above we listed every single part of the light blue highlighted part of the Mass Transfer JSON and its corresponding size measured in bytes. Let’s call this “Transaction Header” for convenience. Instead of creating a Transaction Header for each and every transfer, the Mass Transfer feature only requires one Transaction Header for up to 100 transfers.
Today, we created ~12’000 transactions which translates to 120 Mass Transfer TXs. Thus, we saved 120 * 99 * 184 = 2’185’920 bytes = 2’134 kb = 2 mb of blockchain space.
There is one drawback: Fees have to be paid in $WAVES if using Mass Transfer. At WavesGo, we decided to come up for the fee ourselves instead of charging our lessors. We are aware, that most leasing pools, particularly small ones, will not be able to follow our path, simply as this would either make their node unprofitable or their lessors would have to be charged the transaction fee.
All in all, the Mass Transfer transaction is a great feature and once again proves that Waves Platform is at the very edge of technical innovation.
The WavesGo Team