The js stack should implement the same restrictions as the go stack. The change itself should probably be made in the encode/decode methods of the identity hash in https://github.com/multiformats/js-multiformats Ref: https://github.com/ipfs/boxo/pull/1018