Verify if a number of signatures match a specifc public key

0
69


Suppose you’ve got an organization which has three primary leaders known as A, B and C additionally the corporate have 5 shareholders known as S1 to S5. The choice rule for spending any coin from firm’s tackle is to both we current 1 of the primary leaders signature and three different signature from shareholders.
For instance following unlocking script works (because it accommodates one of many leaders):

<sig_S1> <sig_A> <sig_S2> <sig_S5> 

however not this one:

<sig_S1> <sig_S4> <sig_S3> <sig_S5> 

How I can examine if amongst multi signatures there exist a signature which corresponds to a selected public key, on this case, I’ll be taught {that a} chief’s signature certainly exists. for instance, if we discover out from 5 signatures offered the signature of A exists, and the locking code will appear to be follows:

(3 instances duplicate of all signatures offered)
(examine for the existence of A in signatures)
OP_IF 
   4 <pub_A> <pub_S1> <pub_S2> ... <pub_S5> 5 OP_CHECKMULTISIG
OP_ENDIF
(the identical as above for B)
(the identical as above for C)



Supply hyperlink

Leave a reply