unisat-wallet / extension

The first open-source browser extension wallet for Bitcoin NFTs
Other
804 stars 306 forks source link

Miscalculated TX size #199

Open DotSwap-Dev opened 1 month ago

DotSwap-Dev commented 1 month ago

UniSat PSBT signing is miscalculating tx sizes, this will cause the final fee rate to be different from user's expectation.

This is the signed PSBT: 70736274ff0100910200000001b6956ab753f02f15491ff1049c2664826ea9384707e08d34c6fe88a99669b9480300000000ffffffff034042000000000000160014fba86f537937486ff1a48a61123d02a42635755400000000000000000b6a5d0814d3e59d0114b2018e0b000000000000225120e63bc4799f5efd6ffd274b72152bc3930668435a75edaf565c5a1138be65e1fd000000000001012baa97000000000000225120e63bc4799f5efd6ffd274b72152bc3930668435a75edaf565c5a1138be65e1fd010843014164fafa8b2b8b78e3aef0c4de0925bcd6b5affa982695e206c541acae194f39c5c63cb6af7288942b9ff96f57f0b1c4812d7f7c47c827bc634ea88d13f187df750100000000

The fee rate was set to 117.3 sats/vB instead of 116 sats/vB, the correct transaction size is 163 bytes.

GGG888GGG commented 1 month ago

@huanniangstudio

DotSwap-Dev commented 1 week ago

@huanniangstudio

@GGG888GGG

Any updates?

huanniangstudio commented 1 week ago

When the signature window pops up, the signature has not yet been made, and the transaction fee is estimated.

huanniangstudio commented 1 week ago

So you should notice that in this case, the display of the fee rate is an approximate situation. "≈117.3 sats/vB" instead of "=117.3 sats/vB"

GGG888GGG commented 1 week ago

@DotSwap-Dev