Set user expectations
Set user expectations
The main expectations you need to set for your user are around times and fees. These are the two most potentially-surprising aspects of a blockchain transaction.
Time
Users want to know how long they'll be waiting so they can plan their next move. We are able to provide estimates in-dApp using the GasStation API. And we used this same API to make an accurate progress bar and percentage ticker.
It can be tricky to get exact times. Yet users we spoke to would be happy with a best-guess, providing it wasn't wildly inaccurate. So it's best to speak in terms of time ranges e.g. less than 3 minutes and to make it clear that any time is an estimate.
How we did it
We took the gas that is set for the transaction and then use the Gas station API to look at a list of recently completed transactions to see their price and duration. We then average the amount of time the completed transactions took to get our own estimate based on the gas price. The percentage and progress bar can then show the transaction's progress with reasonable accuracy.
This was far more successful than vague statements like "This might take a few minutes" which sent experienced users to Etherscan. Novice users on the other hand could do nothing but sit and wait – not very respectful of their time. And not very respectful of the potential risk/anxiety they might be experiencing trying out a new technology.
Not elapsed times or spinners
Users we tested with suggested that features like elapsed times and spinners weren't helpful. It's easy after a few minutes to think that your transaction might have timed out, especially if you weren't given an estimated time beforehand. We believe this kind of UI will lead to mistake repeat transactions unless you prevent the user from initiating concurrent transactions.
Fees
The earlier a user knows about transaction fees, the better. If a user only gets this information in their wallet UI, they may feel tricked, eroding trust in your product or service. You especially don't want Gas to feel like a hidden fee, as we've found a lot of users think that the fee goes to the dApp and not the network.