node icon indicating copy to clipboard operation
node copied to clipboard

feat: improve Bitcoin depositor fee so Zeta hub can easily tell if a incoming tx failed or not (now it's a silent failure)

Open ws4charlie opened this issue 1 year ago • 0 comments

Describe the Issue When Zetahub user sends a small amount of Bitcoin to TSS address, the deposit could fail due to less than depositor fee error, and currently in ZetaHub UI, we don't have any way of knowing if the deposit will be registered or not in a timely manner. The reason is that the protocol is using average fee rate in the block to calculate the deposit fee and Zetahub UI has to wait up to 1 Bitcoin block to be able to tell if the incoming deposit will be registered in zetacore or not.

A potential solution can be investigated: It also makes sense for the zetaclient to use individual (the deposit tx) transaction's fee rate to charge deposit fee. For example, a user sends out his transaction with a very low gas rate (as long as he like waiting for a long time to finalize his transaction). Statistically, most users won't do that and we are still collecting a reasonable number of fees to cover our cost (of sending transactions out), but we might see a little bit liability due to those lower-than-market-fee transactions. This might be a trade off of correctness for UX.

Example failed deposit: https://blockstream.info/tx/ed5f3f8a1110b9a0239875ca5d1a0f88fc88353a499de12ea06ec99faad4c486

Expected Outcome A description of what outcome you are seeking.

ws4charlie avatar May 10 '24 17:05 ws4charlie