ESP32 as programmer for Attiny chip

I’d like to use an existing ESP32 as programmer for an Attiny25 (or similar), so that I can upload a .hex file or similar over wifi to the ESP, then get it to flash the Attiny with that code.
Has anybody come across any sample code / managed to do this themselves?

And this is related to Mongoose-OS because…

… well, it is somehow related to Cesanta.
Not for your chip, though, but

OK thanks that’s interesting. I should probably have clarified - I already have mongoose-os running on my ESP as part of the main firmware. In a new hardware update I’ll also have an attiny chip on the same PCB, which I’d like to be able to programme using the ESP32 (so using mos).

So I was hoping to be able to upload a .hex file using RPC over MQTT, then call an RPC function in mos to upload the firmware to the attiny, if that makes sense?