@Override
  public Bytes encode() {
    final MutableBytes bytes = MutableBytes.create(MESSAGE_LENGTH);
    signature.encodedBytes().copyTo(bytes, 0);
    ephPubKeyHash.copyTo(bytes, ECIESHandshaker.SIGNATURE_LENGTH);
    pubKey
        .getEncodedBytes()
        .copyTo(bytes, ECIESHandshaker.SIGNATURE_LENGTH + ECIESHandshaker.HASH_EPH_PUBKEY_LENGTH);
    nonce.copyTo(
        bytes,
        ECIESHandshaker.SIGNATURE_LENGTH
            + ECIESHandshaker.HASH_EPH_PUBKEY_LENGTH
            + ECIESHandshaker.PUBKEY_LENGTH);
    bytes.set(MESSAGE_LENGTH - 1, (byte) (token ? 0x01 : 0x00));
    return bytes;
  }
Decodes this message.

@param bytes The raw bytes.
@param nodeKey The nodeKey used to calculate ECDH key agreements.
@return The decoded message.
ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/handshake/ecies/InitiatorHandshakeMessageV1.java