Reading Assignment: Script

  1. Both OP_CHECKSIG and OP_CHECKSIGVERIFY initially do the same thing i.e. “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.”
    The difference is that OP_CHECKSIGVERIFY then additionally executes OP_VERIFY (which if the top of the stack is not True, it marks the transaction as invalid. The top stack value is removed.)

  2. In Script the “Pop” function is called OP_DROP (which "Removes the top stack item.)

  3. The OP_CHECKMULTISIG hexadecimal OP code is : 0xae (which equates to 174 in decimal)

1 Like
  1. OP_CHECKSIG checks the validity of the transaction signature, specifically: “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.”
    OP_CHECKSIGVERIFY does the same thing but calls OP_VERIFY afterwards, which renders the entire transaction invalid if the result of the signature check failed and hence the top of the stack would be OP_FALSE (aka 0).
  2. POP function is called OP_DROP.
  3. OP_CHECKMULTISIG has an OP code of 174 decimal, which is 0xae in hexidecimal.
1 Like
  1. What is the practical difference between OP_OP_CHECKSIG and OP_OP_CHECKSIGVERIFY?

OP_CHECKSIG returns 1/0 (true or false); OP_CHECKSIGVERIFY executes OP_VERIFY afterwards: OP_VERIFY marks the transaction as invalid if the top stack value is not true (and in this case top stack value is removed). Also OP_VERIFY returns nothing / fail.

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

OP_DROP. I found it by browsing the documentation’s “stack” chapter and seen the description “Removes the top stack item.”

  1. What is the hexadecimal OP Code for OP_CHECKMULTISIG?

0xae

1 Like
  1. What is the practical difference between OP_CHECKSIG and OP_CHECKSIGVERIFY?
    OP_CHECKSIG checks whether the signature matches the hash and public key is true/false, while OP_CHECKSIGVERIFY checks the signature + verifies whether the top stack value is true.

  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

1 Like
  1. Effectively, OP_CHECKSIG and OP_CHECKSIGVERIFY are the same, except OP_CHECKSIGVERIFY runs a verify afterwards

  2. OP_DROP is the pop command in Script

  3. 0xae is hex for OP_CHECKMULTISIG

What is the practical difference between OP_OP_CHECKSIG and OP_OP_CHECKSIGVERIFY?
OP_VERIFY
Same as OP_CHECKSIG, but OP_VERIFY is executed afterwar
Marks transaction as invalid if top stack value is not true. The top stack value is removed.

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

What is the hexadecimal OP Code for OP_CHECKMULTISIG?
0xae

Is this right_

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

OP_CHECKSIG is going to check if a signature can validate the hash and the public key

OP_CHECKSIGVERIFY is going to check the signature and also checks if the top stack value is correct.

  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. What is the practical difference between OP_OP_CHECKSIG and OP_OP_CHECKSIGVERIFY?
  • Runs OP_VERIFY afterwards
  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. What is the practical difference between OP_OP_CHECKSIG and OP_OP_CHECKSIGVERIFY?

The practical difference between CHECKSIG and CHECKSIGVERIFY is that OP_CHECKSIG will leave the result of the operation on the top of the stack, whether it is true or false. OP_CHECKSIGVERIFY, however, will remove the result from the stack if it returns false.

  1. What is the “Pop” functions called in Script?

OP_DROP: I wasted a lot of time thinking on this one, and then noticed in the forum that many other people agree with me in thinking that a POP and a DROP are not the same thing.

  1. What is the hexadecimal OP Code for OP_CHECKMULTISIG?

The Hex code for OP_CHECKMULTISIG is: 0xae

1 Like
  1. OP_CHECKSIG return true/false , OP_CHECKSIGVERIFY execute OP_VERITFY after OP_CHECKSIG and the output is nothing/fail

  2. OP_DROP

  3. 0xae

1 Like
  1. What is the practical difference between OP_OP_CHECKSIG and OP_OP_CHECKSIGVERIFY?
    OP_OP_CHECKSIG: The entire transactions outputs, inputs, and script are hashed
    OP_OP_CHECKSIGVERIFY: The same as CHECKSIG but is performed after it is executed
  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
1 Like
  1. OP_OP_CHECKSIG: If Signature is valid (for hash and public key), return 1, if not return 0
    after that the OP_OP_CHECKSIGVERIFY is executed and can return the value Failif the previous Checksig was 0.
  2. OP_DROP Removes the top stack item.
  3. 0xae
1 Like
  1. What is the practical difference between OP_OP_CHECKSIG and OP_OP_CHECKSIGVERIFY?

OP_CHECKSIG involves a single operation and OP_CHECKSIGVERIFY involves 2 operations

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

is it OP_DROP 117 0x75

  1. What is the hexadecimal OP Code for OP_CHECKMULTISIG?

OP_CHECKMULTISIG 174 0xae

Hello sir, please if you can describe what are the 2 operations of OP_CHECKSIGVERIFY.
If you have any doubt on it, let us know so we can help you understand it better! :slight_smile:

Carlos Z.

OP_CHECKSIGVERIFY involves 2 operations:

the first operation is the OP_CHECKSIG and then afterwards it will be followed by the OP_VERIFY operation

1 Like

1 What is the practical difference between OP_CHECKSIG and OP_CHECKSIGVERIFY?
A: OP_CHECKSIG is the script opcode used to verify that the signature for a tx input is valid…it verifies the signature of the script
OP_CHECKSIGVERIFY double checks leaving (0) nothing on the stack after evaluation

2- What is the “Pop” functions called in Script? (It is not called OP_POP)
A- OP_DROP, I found

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

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

1: Answer: OP_CHECKSIGVERIFY also runs OP_VERIFY afterwards which marks the transactions invalid if the value presented at the top of the stack is not True.

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

2: Answer: OP_DROP, OP_NIP, OP_2DROP

  1. What is the hexadecimal OP Code for OP_CHECKMULTISIG?

3: Answer: 0xae

1 Like
  1. OP_CHECKSIGVERIFY = OP_CHECKSIG OP_VERIFY
  2. OP_DROP
  3. 0xae

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

Hello sir, you are quite right, but could you please explain a little detail what is the difference?

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

Carlos Z.

  1. What is the practical difference between OP_CHECKSIG and OP_CHECKSIGVERIFY?
  • OP_CHECKSIG will return true(1) or false(0)
  • OP_CHECKSIGVERIFY is similar to the OP_CHECKSIG but will also execute OP_VERIFY which will return nothing or fail
  1. What is the “Pop” functions called in Script? (It is not called OP_POP)
  • OP_DROP will “pop” the top item and remove it from the stack.
  1. What is the hexadecimal OP Code for OP_CHECKMULTISIG?
  • 0xae
1 Like