Multi-Signature (limited to 15 keys)

Published by Martin Schuster on

Multi-Signature scripts enable the possibility to require multiple public keys to unlock the transaction. This can be necessary for larger company’s or transactions where multiple persons are involved, so not one person can control the funds or authorize the transaction. These Multi-signature scripts have a condition in which N public keys are recorded and at least M of those must provide their signatures to unlock the funds. These transactions are also called M-of-N multisig. The script for this transaction will look something like this:

M <Public Key 1> <Public Key 2> … <Public Key N> N CHECKMULTISIG

The op_code CHECKMULTISIG should pop M+N+2 Elements from the stack for it to work. But there is a glitch in this op_code.  It pops one extra element from the stack. This will cause a stack error because it would require more elements than there are in the stack. A common workaround is to add OP_0 which provides a dummy value that does nothing.

With more and more involved parties in the multisig transaction, the script can become quite long and therefore would cost more fees. That’s why Multi-signature transactions in this form are rarely used today and are replaced by the pay-to-script-hash. Those transactions are distinguishable because they start with a 3 at the beginning and also offer an additional layer of privacy because these transactions only contain the hashed script and without the corresponding script it is not possible to determine any useful information from it.