Reading Assignment: Script

  1. OP_CHECKSIGVERIFY

Same as OP_CHECKSIG, but OP_VERIFY is executed afterward.

  1. OP_DROP Removes the top stack item.

  2. 0xae

1 Like
  1. OP_CHECKSIGVERIFY does the same thing as OP_CHECKSIG but it also performs OP_VERIFY afterwards. OP_CHECKSIG verifies that the given signature is valid for the hash of all inputs, outputs and script (after last OP_CODESEPARATOR). If yes, then it returns 1. If not, then 0. OP_VERIFY will check it if true or not, and if not true, it will mark it as invalid and remove top stack.

  2. OP_DROP “pops” the most recent item in the stack.

  3. Hexadecimal notation for opcode of OP_CHECKMULTISIG (=174) is: 0xae

1 Like
  1. OP_CHECKSIG hashes the entire transaction’s outputs, inputs, and script and then validates the signature for this hash and public key. If valid 1 is returned, 0 otherwise. OP_CHECKSIGVERIFY does the same and also pops and marks the transaction as invalid if 0.

  2. OP_DROP

  3. 0xae

1 Like

1. What is the practical difference between OP_OP_CHECKSIG and OP_OP_CHECKSIGVERIFY?
I think OP_OP_CHECKSIG means the transaction is completed and valid, however, OP_OP_CHECKSIGVERIFY means the transaction is failed. So the difference between them is that one is valid and the other one is invalid.

2. What is the “Pop” functions called in the Script? (It is not called OP_POP)
“Pop” function means to withdraw the step which had been done before in order.

3. What is the hexadecimal OP Code for OP_CHECKMULTISIG?
I don’t know.

1 Like

2. What is the “Pop” functions called in the Script? (It is not called OP_POP)

OP_DROP is the function, description: “Removes the top stack item.”

3. What is the hexadecimal OP Code for OP_CHECKMULTISIG?

It’s 0xae.
Here is the total detail of it.

Here is a link that can help you understand all of the functions even better: Bitcoin uses a scripting.

Hope you find this useful! :slight_smile:

If you have any doubt, please let us know so we can help you!

Carlos Z.

  1. What is the practical difference between OP_OP_CHECKSIG and OP_OP_CHECKSIGVERIFY?

“The entire transaction’s outputs, inputs, and script (from the most recently-executed OP_CODESEPARATOR to the end) are hashed. The signature used by OP_CHECKSIG must be a valid signature for this hash and public key. If it is, 1 is returned, 0 otherwise.” - Wiki

A) The Hex is different
B) Check sig Hash is a True/False with a 1 for true and a 0 for False
Check Sig verify is the same but then runs the verify after which if the value does not come back as true will remove from the top of the stack.

  1. What is the “Pop” functions called in Script? (It is not called OP_POP)
    OP_DROP
  1. What is the hexadecimal OP Code for OP_CHECKMULTISIG?
    0xae
1 Like
  1. using op_checksig a true or false statement is put on the stack. Due to this it is possible to execute or perform other operations (e. g. IF ELSE) when false is put on the stack. That means your operations are not finished immidiately. Op_verify mark it as invalid but false is not put on stack. Now the developer can perform some other piece of code .

  2. OP_DROP

  3. 0xae

1 Like
  1. What is the practical difference between OP_CHECKSIG and OP_CHECKSIGVERIFY?

The commands are the same except that OP_CHECKSIGVERIFY also executes OP_VERIFY

  1. What is the “Pop” function called in Script? (It is not called OP_POP)

OP_DROP

  1. What is the hexadecimal OP Code for OP_CHECKMULTISIG?

0xae

1 Like
  1. OP_CHECKSIG makes a hash of the whole transaction’s outputs, inputs and script since the last OP_CODESEPARATOR. OP_CHECKSIGVERIFY does the same but also executes OP_VERIFY afterwards, marking the transaction as invalid if the top stack is not true.

  2. OP_DROP

  3. 0xae

1 Like
  1. What is the practical difference between OP_OP_CHECKSIG and OP_OP_CHECKSIGVERIFY?
    OP_OP_CHECKSIG Verifies if the signatue given as input is valid, and pushes 1 (true) to top of stack if it is, and zero (false) if not. OP_OP_CHECKSIGVERIFY, does the same, but on top of that executes OP_VERIFY, that tests if top on stack contains true (not 0), and if not marks transaction invalid. No matter the outcome top of stack is removed

  2. What is the “Pop” functions called in Script? (It is not called OP_POP)
    OP_DROP

  3. What is the hexadecimal OP Code for OP_CHECKMULTISIG?
    0xae

2 Likes
  1. What is the practical difference between OP_OP_CHECKSIG and OP_OP_CHECKSIGVERIFY?
    The practical difference is that the after the signature is checked the verify operation is performed whereby if the check sig operation did not return true, the transaction would be marked as invalid and removed from the top of the stack.

  2. What is the “Pop” functions called in Script? (It is not called OP_POP)
    op_drop is used to pop in Script. Also, op_2drop to pop the top 2 stack items or op_nip to pop the second to top stack item.

  3. What is the hexadecimal OP Code for OP_CHECKMULTISIG?
    0xae

2 Likes
  1. What is the practical difference between OP_OP_CHECKSIG and OP_OP_CHECKSIGVERIFY?

OP_CHECKSIG inputs a sig pubkey, output a Boolean value (True 1/false 0)
Its job is to validate a transaction’s outputs, inputs, and script are hashed accordingly.

OP_CHECKSIGVERIFY does not output anything, same as OP_CHECKSIG, but OP_VERIFY is executed afterward
OP_VERIFY inputs a Boolean value, then marks transaction as invalid if top stack value is not true. The top stack value is removed.

Bitcoin is all about keeping the only valid transactions into its blocks. OP_CHECKSIGVERIFY helps to make sure all of upcoming transactions valid and removed all of the invalid ones (refer to OP_VERIFY), which is a practical use case for Bitcoin infrastructure.

  1. What is the “Pop” functions called in Script? (It is not called OP_POP)

“Pop” function is OP_DROP removes the top stack item.
“Push” function can be OP_PUSHDATA to input bytes into a stack.

  1. What is the hexadecimal OP Code for OP_CHECKMULTISIG?
    OP_CHECKMULTISIG has hexadecimal OP Code 0xae, which is 10 x 16 + 14 = 174 in terms of decimal value.
2 Likes
  1. What is the practical difference between OP_OP_CHECKSIG and OP_OP_CHECKSIGVERIFY? That OP_VERIFY is executed afterward
  2. What is the “Pop” functions called in Script? (It is not called OP_POP) Proof of Payment
  3. What is the hexadecimal OP Code for OP_CHECKMULTISIG? 0xae
1 Like

POP means that it pops an element from the stack :smiley: not much to do with payments. The answer is OP_DROP :wink:

1 Like

I was looking and could not find.so just guessed, OP_DROP, thank you.for your reply.

1 Like
  1. OP_CHECKSIGVERIFY executes OP_VERIFY after executing OP_CHECKSIG
  2. OP_DROP, OP_2DROP
  3. 0xae
1 Like

This one actually pops the first two.

2 Likes
  1. OP_CHECKSIG: The transaction is being hashed, and, depending on the signature that has to be valid for the hash and the public key the signature, the funcion will return 0 (not valid signature) or 1 (valid).
    OP_CHECKSIGVERIFY: Does the same as checksig, but also marks the transaction as invalid if top stack value is not true (in this case it will be removed from the stack).

  2. OP_DROP

  3. 0xae

1 Like
  1. What is the practical difference between OP_OP_CHECKSIG and OP_OP_CHECKSIGVERIFY?
  • OP_CHECKSIGVERIFY is the same as OP_CHECKSIG, but OP_VERIFY is executed afterward.
  1. What is the “Pop” functions called in Script? (It is not called OP_POP)
    -OP_DROP removes the top stack item.
  2. What is the hexadecimal OP Code for OP_CHECKMULTISIG?
    -0xae
1 Like
  1. What is the practical difference between OP_OP_CHECKSIG and OP_OP_CHECKSIGVERIFY?
  • OP_CHECKSIG: the signature is part of the transaction hash (non - segwit). It is hashed together with the other data when valid.

  • OP_CHECKSIGVERIFY: the ‘signature check’ happens after the transaction hash (segwit)

  1. What is the “Pop” functions called in Script? (It is not called OP_POP)
  • OP_DROP - it removes the top stack item.
  1. What is the hexadecimal OP Code for OP_CHECKMULTISIG?
  • 0xae
1 Like