Integrate private_pub and add chat functionality