Please read this: https://uavcan.org/Specification/6._Application_level_functions/#firmware-update
Also this: https://uavcan.org/Implementations/Libuavcan/Tutorials/11._Firmware_update/ The tutorial is for libuavcan, not libcanard, but the general principles are the same so you can use it as a high-level reference.
The Kocherga protocol module implements the UAVCAN bootloader protocol: https://github.com/Zubax/kocherga/blob/master/kocherga_uavcan.hpp (and it is built on Libcanard!)