Move.

Post

Share your knowledge.

CarlkawIy.
Jan 15, 2025
Expert Q&A

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
1
3
Share
Comments
.

Answers

3
Raju.
Raju158
Jan 15 2025, 13:59

Having 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.

1
Best Answer
Comments
.
Tawhid.
Jan 16 2025, 02:49

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.

2
Comments
.
tomek.
Jan 16 2025, 00:45

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.

0
Comments
.

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.

148Posts231Answers
Sui.X.Peera.

Earn Your Share of 1000 Sui

Gain Reputation Points & Get Rewards for Helping the Sui Community Grow.

Reward CampaignJune
We use cookies to ensure you get the best experience on our website.
More info