electrum-nmc icon indicating copy to clipboard operation
electrum-nmc copied to clipboard

name_firstupdate rand length check is too strict

Open JeremyRand opened this issue 7 years ago • 0 comments

The length check on rand in https://github.com/namecoin/electrum-nmc/pull/58 expects a length of exactly 20 bytes. While this does match the transactions created by Namecoin Core, the consensus rules allow arbitrary lengths as long as the maximum is 20 bytes. In particular, older versions of Namecoin seem to use a length of 8 or 9 bytes. While it makes sense to verify the exact length of 20 bytes for transactions that Electrum-NMC creates, it doesn't make sense to enforce it on transactions created by 3rd parties, especially since doing so will produce serialization errors when syncing a watching-only wallet (which results in the ElectrumX server being incorrectly blacklisted).

A fix for this should introduce a unit test with the name_firstupdate from d/dot-bit in block height 1585, so that we can avoid this kind of accident again.

JeremyRand avatar Nov 08 '18 06:11 JeremyRand