mattoshi on Nostr: My biggest question was how OP_CHECKMULTISIG matches up the provided signatures with ...
My biggest question was how OP_CHECKMULTISIG matches up the provided signatures with the corresponding public keys. The answer is that it just loops through the public keys and tries to verify the signatures! In my mind I thought there would be some type of mapping. It was also surprising to me that even if you have a threshold of valid signatures, they need to be in the right order.
These resources together did a great job explained the nitty gritty:
https://learnmeabitcoin.com/technical/p2ms
https://bitcoin.stackexchange.com/questions/40669/checkmultisig-a-worked-out-example
https://github.com/bitcoin/bitcoin/blob/master/src/script/interpreter.cpp#L1105
These resources together did a great job explained the nitty gritty:
https://learnmeabitcoin.com/technical/p2ms
https://bitcoin.stackexchange.com/questions/40669/checkmultisig-a-worked-out-example
https://github.com/bitcoin/bitcoin/blob/master/src/script/interpreter.cpp#L1105