rust-elements icon indicating copy to clipboard operation
rust-elements copied to clipboard

confidential: Don't reverse explicit values for serde

Open stevenroose opened this issue 10 months ago • 5 comments

So this is a breaking change. It might affect people actually using the serde serialization of confidential::Value::Explicit right now. Which is really unfortunate.

But IMO this is a bug. We for some miraculous reason (probably a mistake on some programmer's end) reverse the bytes when consensus-encoding explicit values. That's fine. But somehow we also ended up doing this for serde, which makes no sense.

I'm hitting this when trying to use this type in a Web setting through WASM and a small number of satoshis will (when reversed) cause a JS overflow (which only supports 53 bit integers).

stevenroose avatar Aug 21 '23 02:08 stevenroose