We trust wallets like Ledger, Trezor, and etc. We believe the math that the randomly generated private keys are safe. But could it be possible that the private keys you thought are “generated” are actually provided and already stored in the database?
Imagine I am the cold wallet company, and I pre-generated like one trillion private keys secretly and saved them in my own database. For each wallet chip, I carefully choose 100 private keys and write them into the chip, and mark the keys in my database as used. When a user received the wallet and tries to generate a private key, the program in the chip just picks one of the 100 keys I wrote in. No one knows whether the keys are really generated or given by the wallet provider.
When I’ve already sold enough wallets, I can iterate all the used private keys and steal all my customs bitcoins.
That sounds practical and horrible. I am using a wallet but I cannot convince myself that my private key really belongs to me. Is that scenario possible? Is there any way to guarantee that the private key is not saved by others when the wallet is not open source?