A multisig address is simply a redeem script of the form m <keys> n OP_CHECKMULTISIG.
This redeem script is then wrapped in a P2SH address, which is the HASH_160 of the redeem script presented in the format standardised in BIP16
For instance, a common multisig address is 2of2 (2of3 is also very common). An example redeem script is 522103c9078b8d06d83347b2e7e8cbbdfc24bd50e09ca1a4e5d90d70485a8c4094e5672102d52317afd128305d6fca7bd30b839e821564990c88581ebb432b478cfa95602f52ae, which decodes to:
2 03c9078b8d06d83347b2e7e8cbbdfc24bd50e09ca1a4e5d90d70485a8c4094e567 02d52317afd128305d6fca7bd30b839e821564990c88581ebb432b478cfa95602f 2 OP_CHECKMULTISIG
Producing a HASH_160 for the above redeem script gives us 4aef67ed61d391d6f3d9903ead92386c1efc9925, which when put in the P2SH form is a914(4aef67ed61d391d6f3d9903ead92386c1efc9925)87 (brackets mine).
This finally gives us the address 38XEixUj1QpcqxTWbxvqdbv4Mjre4imw9Z after a Base58Check encode.
1It's exactly the same procedure but instead of the public key you double hash the redeem script and instead of 0x01 version byte you use 0x05 – Mike D – 2018-05-30T14:55:47.447
https://gist.github.com/gavinandresen/3966071 and some research here in the forum :-) – pebwindkraft – 2018-05-30T18:41:40.650
hi Mike - thanks for responding. Alas, same as below, I still don't understand something. In a 2 out of 3 framework, and assuming the multisig address is a function of 3 public keys, how does the system know from just two public keys that I am going to spend the funds associated with that multisig address. – Rodrigue Afota – 2018-05-31T14:56:07.410
Let me be clearer: compare this with Shamir secret scheme: in that case it is very clear that there is a redundant mathematical relationship between a secret, which by construction can be retrieved by n out of m data points, no matter which n. In multisig case however, I don't understand how signing by two keys only is sufficient for the network to understand that I am spending coins associated with a 2 out of 3 address. – Rodrigue Afota – 2018-05-31T14:58:21.707