Let's say I set up a "2 of 4" scenario, where two of four individuals (via their hardware wallets) must sign a bitcoin transaction. Where is this "you must have two of these four" rule stored? Is it somewhere on the bitcoin blockchain?
It’s not on the blockchain itself but rather is in the script of the bitcoin address generated. In the script would include how many of how many of you in total would be required to push through a transaction as well as public keys of each signer and other possible data needed. If you are interested in the script and coding, you can check this out as it explains it more in detail and with examples:
https://github.com/BlockchainCommons/Learning-Bitcoin-from-the-Command-Line/blob/master/10_4_Scripting_a_Multisig.md[/u]]https://github.com/BlockchainCommons/Learning-Bitcoin-from-the-Command-Line/blob/master/10_4_Scripting_a_Multisig.mdSaid differently, if I authorize a spend transaction using my hardware wallet (I am one of the four), how does the exchange (Coinbase, or any other non-Electrum) know that a second signature is required?
It’s not the exchange exactly that figures this out. The blockchain would be the one to validate and check if all requests are met in order to carry out the transaction.