This is an idea that was on my mind some time ago when I had to use my account on another phone because mine didn’t have internet access.
To do this, I had to connect the two devices to the same network, which was a bit of a hassle because neither phone was configured to join or create another network.
Obviously, it wasn’t that difficult, but I thought, what if it were possible to exchange all the information needed to make the account work using only the QR code?
At that moment, I didn’t need the chat history, I just needed the contact list, and exchanging data had added time and everything involved with exchanging personal data.
In addition, not connecting the two phones to the same network somehow increases security (imagine, for example, that one of the two phones is somehow compromised by malware; exchanging contacts in this way would still be secure).
There is already a library that can do this: GitHub - sz3/libcimbar: Optimized implementation for color-icon-matrix barcodes
However fast it may be, I would still avoid synchronizing two devices with data in this way because the process could take too long.
But only for account and contact list can be ok. few second of cam capturing.