MerosCrypto / Meros

An instant and feeless cryptocurrency for the future, secured by the Merit Caching Consensus Mechanism.
https://meroscrypto.io
Other
82 stars 19 forks source link

Bech32 checksums easily pass for mutated strings. #269

Closed kayabaNerve closed 3 years ago

kayabaNerve commented 3 years ago

https://github.com/sipa/bech32/issues/51 discusses this issue in depth. https://gist.github.com/sipa/a9845b37c1b298a7301c33a04090b2eb#improving-detection-of-insertion-errors also details a fix.

What we have to decide is if breaking away from the existing Bech32 standard is worth it, in order to not have this problem.

As much as I love the absolute offered by this new scheme, there's two pieces of history to cite:

1) Nano's use of Blake2 within Ed25519. 2) Meros's use of JSON-RPC 2.0 over TCP (#265).

Breaking away from existing, adopted pieces of technology creates a fragmented ecosystem which can easily damage project accessibility, and therefore adoptance. Because of that, I'm leaning towards sticking with the Bech32 scheme as described. That said, I did want to create this issue to officially note this problem/discussion, and the aspects at play.

It should be noted since this is NOT part of the protocol, rather address encoding, and we have a byte to determine the type of address, we can upgrade in the future.

kayabaNerve commented 3 years ago

Extra checks should be added around the parsed data, which have already been prototyped and will be pushed shortly (requires tests). That said, we will not break compatibility with existing Bech32 libraries.

kayabaNerve commented 3 years ago

Removing the 90 char address limit due to that setting a (90-3)*5/8 byte limit (54.375), which is not enough for stealth addresses.