W5 Optimization Challenge
Prize: up to 2,000 TON
Deadline: October 15, 23:59 UTC+4
Results: November 11
The Tonkeeper team is working on a new wallet standard called
W5 aimed at replacing the currently used wallet
v4R2. It will enable new exciting possibilities for TON that dramatically improve user experience for millions of people.
W5 supports gasless transactions, delegation and account recovery, subscription payments with tokens and Toncoin, and cheap multi-transfers. At the same time, W5 significantly reduces user and merchant fees.
Learn about W5 from our
GitHub repository.
We invite talented Fift and FunC engineers to participate in optimizing W5. The most optimized solution that meets the requirements will win the contest.
Requirements
The goal is to optimize gas consumption for
each of the three computation paths, where a single outgoing message of 1 TON to a regular basechain address is emitted from the wallet:
1. Processing an external signed message. Starting gas cost:
3135.
2. Processing an internal signed message. Starting gas cost:
4110.
3. Processing an internal message authenticated by an extension. The dictionary contains only that one extension. Starting gas cost:
2660.
The starting gas costs are measured when the entire contract code is offloaded to a library on a masterchain. Measurements were made on testnet.
Non-goals: optimizing the storage space, optimizing the code size (the code will be offloaded into a shared library and won’t cost anything to a user).
While optimizing these three cases, do not impede the remaining functionality. Minor trade-offs are acceptable, but a significant increase in cost, usage complexity, or loss of security may disqualify a candidate.
The resulting code in FunC or Fift must contain
excellent documentation necessary for audit and a
documented build process if it differs from the one we already use in the repository.
Implementation should be generally compatible with the ABI in the specification.
Minor changes to the storage and message layout are allowed for the performance if they do not break the functionality and do not complicate the ABI for apps. Please do not change the 32-bit opcodes. We reserve the right to decide which changes are acceptable. When in doubt, feel free to make two submissions: conservative & radical..
Deliverable
Pull-request to
w5 repository.
Prizes
🥇The author of the winning implementation receives co-authorship credit in the project and
0.333 TON per gas unit saved in
each of the three paths (external+signed, internal+signed, internal+extension).
We also reward original ideas with novel trade-offs and worthy follow-up attempts.
🥈The second place:
0.100 TON per gas unit.
🥉The third place:
0.050 TON per gas unit.
We will pay out only one prize per author. We will evaluate submissions one by one. To avoid copycats, we recommend you submit your code shortly before midnight on October 15 (UTC +4).
We can’t wait to see how your talents unfold in this challenge. Good luck!
For any questions, please contact
@w5challenge