conex icon indicating copy to clipboard operation
conex copied to clipboard

Wire.to_string: disambiguate encoding of Pair, use whitespace ' ' as separator

Open hannesm opened this issue 1 month ago • 1 comments

//cc @reynir very much appreciated that you looked into this.

Since this changes the Wire.to_string, used for signing data, we need to bump the version of all data that will be signed. Since we have to do this, is there anything else that we should change in the encoding?

hannesm avatar Nov 11 '25 20:11 hannesm

I added a qcheck test that checks the property forall w, w' : Wire.t, w = w' <=> Wire.to_string w = Wire.to_string w'. After pushing I cherry-picked that commit on main and disappointingly it doesn't find any counter examples :/ so I'm now not convinced the test is any good.

reynir avatar Nov 12 '25 07:11 reynir