You should check out the OpenNic project, which is an organization that has already attempted what you're describing.https://www.opennic.org/
It's the default SMS application on Pixel devices.