Hello breadbones,
Thanks for asking the Apple Support Communities for help with your iPhone only working while plugged in to power.
It sounds like you may have an issue with your battery. Please also verify your battery health, as this article mentions: iPhone Battery and Performance - Apple Support - Apple Support
"A normal battery is designed to retain up to 80% of its original capacity at 500 complete charge cycles when operating under normal conditions. The one-year warranty includes service coverage for a defective battery. If it is out of warranty, Apple offers battery service for a charge. Learn more about charge cycles."
You also mention you see the Restore Screen. You may not be able to check your battery until you get past the restore screen. Please check the process in this help article: If you see the Restore screen on your iPhone, iPad, or iPod touch - Apple Support
If you need more help, please contact Apple Support: Contact Apple Support
Thanks and have a wonderful day.