boltlabs-inc / zeekoe

Zero-knowledge layer-2 payment channels
MIT License
24 stars 1 forks source link

Update ChannelId to have a canonical representation #300

Open marsella opened 2 years ago

marsella commented 2 years ago

The channel ID currently has two representations: as a [u8; 32] and as a Scalar. These representations do not have a bijective relationship -- there are more byte arrays than scalars.

We should make sure that the representation that is serialized, displayed, and stored in databases is not ambiguous.

I think there is not an operational bug related to this, but printing it out (Display) sometimes shows a different value than the serialized version.