Post
Share your knowledge.
How can I minimize transaction fees for user votes in my app?
I'm developing an app where users make posts and others pay with custom coins to vote on these posts. Currently, each vote counts as a separate transaction, leading to potentially 12,000 transactions a month. Paying for each transaction gas fee is unfeasible for my project. I'm considering sponsored transactions or PTBs but am unsure how to reduce these fees effectively. Can I batch transactions, or is there another solution that I can implement?
- Move CLI
- Move
Answers
3Having users pre-sign transactions for later submission usually isn't viable. Instead, consider having them sign personal messages as a proof of vote. These messages could be stored and submitted later. While you can't directly batch votes into PTBs, administrative contract features might allow for efficient vote-recording methods on a backend, potentially reducing the number of necessary on-chain transactions.
PTBs might not help, as you can't combine transactions from multiple users in a PTB. However, if your smart contract allows it, you could create a transaction that records votes for many users through an admin cap and submit this through a cron job. This might condense and reduce transactions as compared to processing each vote individually.
Sponsored transactions could work for your situation, but you'll need a backend to handle transactions. Enoki might be a good starting point if you go for the sponsorship route. However, consider using a backend that submits transactions where users sign a personal message for address validation. You still need the backend for transactions, but it might lower fees than individual processing.
Do you know the answer?
Please log in and share it.
Move is an executable bytecode language used to implement custom transactions and smart contracts.

- ... SUIderiss+5
- ... SUIRamirez+5
- ... SUIElvin CLONE +5
- ... SUI
- ... SUI
- ... SUI
- ... SUIBritain+2