How can a hardware wallet firmware be open source? Saying that electrum's code is open-source means that you can build the software by yourself. How can you build a hardware wallet? Also, why don't you need to examine the device in which you're connecting the hardware wallet?
They're available on github:
https://github.com/trezor/trezor-firmwarehttps://github.com/Coldcard/firmwareI think someone has actually built a Trezor from the parts they acquired. You'll require some skills though. Electrum's code may be open sourced but it won't mean that the hardware you're running on is free from backdoors (I don't think you'll want to audit the OS, it's very complex).
Side channel attack may not seem as much of a concern for most but it's reasonable to assume that it's still a viable attack vector (for which most hardware offers little to no protection from them).As with the device used to connect the hardware wallet, if you can verify that the firmware does not transmit any private key nor modify any raw TXes to a malicious address intentionally, that should be fairly safe.
On open-source projects you always have to trust yourself. Although, on hardware wallet you're trusting a company, but on electrum you're trusting the coding skills of
277 contributors plus the
issues that they've answered.
I trust Electrum as much as you but there are also hardware wallets which are open sourced as well. If both the firmware and the application is open source, then you'll probably want the machine that you're working on and it's firmware to be open sourced as well.
Hardware wallets, with the inclusion of a secure chip, makes it harder for the attacker to compromise the device given it's various protection against the attack vectors (mostly sidechannel).
I don't think you can compare the security that a hardware wallet can provide against the myriad of attack vectors against a cold storage wallet. I don't dispute that it's difficult for someone to compromise your Electrum (through compromising your offline OS) but given physical access, it's much harder for someone to breach a hardware wallet than an Electrum wallet. That, and it's smaller margin of error is where HW wallets excel at.