def create_auth_ack_message(ephemeral_pubkey=nil, nonce=nil, version=SUPPORTED_RLPX_VERSION, eip8=false)
      raise RLPxSessionError, 'must not be initiator' if initiator?

      ephemeral_pubkey = ephemeral_pubkey || @ephemeral_ecc.raw_pubkey
      @responder_nonce = nonce || Crypto.keccak256(Utils.int_to_big_endian(SecureRandom.random_number(TT256)))

      if eip8 || @got_eip8_auth
        msg = create_eip8_auth_ack_message ephemeral_pubkey, @responder_nonce, version
        raise RLPxSessionError, 'invalid msg size' unless msg.size > 97
      else
        msg = "#{ephemeral_pubkey}#{@responder_nonce}\x00"
        raise RLPxSessionError, 'invalid msg size' unless msg.size == 97
      end

      msg
    end
def create_auth_ack_message(ephemeral_pubkey=nil, nonce=nil, version=SUPPORTED_RLPX_VERSION, eip8=false)
      raise RLPxSessionError, 'must not be initiator' if initiator?

      ephemeral_pubkey = ephemeral_pubkey || @ephemeral_ecc.raw_pubkey
      @responder_nonce = nonce || Crypto.keccak256(Utils.int_to_big_endian(SecureRandom.random_number(TT256)))

      if eip8 || @got_eip8_auth
        msg = create_eip8_auth_ack_message ephemeral_pubkey, @responder_nonce, version
        raise RLPxSessionError, 'invalid msg size' unless msg.size > 97
      else
        msg = "#{ephemeral_pubkey}#{@responder_nonce}\x00"
        raise RLPxSessionError, 'invalid msg size' unless msg.size == 97
      end

      msg
    end
Handshake ack message handling

 authRecipient = E(remote-pubk, remote-ephemeral-pubk || nonce || 0x1) // token found
 authRecipient = E(remote-pubk, remote-ephemeral-pubk || nonce || 0x0) // token not found

 nonce, ephemeral_pubkey, version are local