Thursday, April 3, 2025
HomeBitcointransactions - MULTISIG locking script with out sure order of signatures

transactions – MULTISIG locking script with out sure order of signatures

I must create and broadcast a MULTISIG transaction to the take a look at community. OP_CHECKMULTISIG is for use. I want a locking script that requires my public key and 1 of different 3 folks’s. The order of the signatures in unlocking script shouldn’t matter.

So far as i do know OP_CHECKMULTISIG requires order, so I do not know how one can cope with no order state of affairs. Additionally, how am I even going to examine the signature of mine with my public key if its not high of the stack originally. It appears too advanced, but when there’s a neater method or a sure scheme I might gladly take the assistance.

Additionally, does this imply that solely 2 signature could be given for unlocking script or greater than 2 is feasible? If that’s the case I made one, however it’s not utilizing OP_CHECKMULTISIG and unsure if its legitimate:

 OP_CHECKSIG
OP_IF
    # If sure, second signature have to be an worker's
    OP_SWAP  # [result1, sig2]
    OP_DUP  OP_CHECKSIG OP_SWAP
    OP_DUP  OP_CHECKSIG OP_SWAP
    OP_DUP  OP_CHECKSIG
    OP_ADD OP_ADD
    OP_1 OP_GREATERTHANOREQUAL  # At the least 1 worker signed
OP_ELSE
    # If first shouldn't be supervisor's, examine if it is an worker's
    OP_SWAP  # [result1, sig2]
    OP_DUP  OP_CHECKSIG OP_SWAP
    OP_DUP  OP_CHECKSIG OP_SWAP
    OP_DUP  OP_CHECKSIG
    OP_ADD OP_ADD
    OP_1 OP_GREATERTHANOREQUAL OP_IF
        # If first is an worker's, second have to be supervisor's
         OP_CHECKSIG
    OP_ELSE
        OP_0  # Fail if first sig is neither
    OP_ENDIF
OP_ENDIF

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments