We can express a weighted n-of-m voting by duplicating keys and signatures.
Regular 3-of-5 example:
3
<pub_key_1>
<pub_key_2>
<pub_key_3>
<pub_key_4>
<pub_key_5>
5
OP_CHECKMULTISIG
Redeem example:
<sig_1> <sig_2> <sig_5>
Weighted 3-of-5 with pub_key_1
having up to two votes:
OP_IF
OP_DUP
OP_ENDIF
3
<pub_key_1>
OP_DUP
<pub_key_2>
<pub_key_3>
<pub_key_4>
5
OP_CHECKMULTISIG
Redeem example:
0 <sig_2> <sig_3> <sig_4>
or
1 <sig_1> <sig_4>
Weighted 4-of-7 with pub_key_1
having exactly three votes:
OP_DUP
OP_DUP
4
<pub_key_1>
OP_DUP
OP_DUP
<pub_key_2>
<pub_key_3>
<pub_key_4>
7
OP_CHECKMULTISIG
Redeem example:
<sig_1> <sig_2>
or
<sig_1> <sig_3>
Every person of the weighted MultiSig can have an explicit weight. This scripts checks that the sum of the participants is greater than the threshold.
IF
<key_personA>
CHECKSIGVERIFY
<weightA>
ELSE
0
ENDIF
TOALTSTACK
IF
<key_personB>
CHECKSIGVERIFY
<weightB>
ELSE
0
ENDIF
TOALTSTACK
IF
<key_personC>
CHECKSIGVERIFY
<weightC>
ELSE
0
ENDIF
TOALTSTACK
...
FROMALTSTACK
FROMALTSTACK
FROMALTSTACK
...
ADD
ADD
ADD
<threshold>
GREATEREQUAL
VERIFY