Reading Assignment: Script

  1. It sounds like the signature used by OP_CHECKSIG must match the hash signature and the public key signature. If it matches 1 is pushed onto the stack. But with OP_CHECKSIGNVERIFY, the transaction will be removed from the stack if its invalid.

  2. The opcode for “pop” is OP_DROP

  3. 0xae

1 Like
  1. Running the hash versus checking the validity
  2. OP_DROP
  3. Oxae
1 Like

1. The practical difference is that OP_CHECKSIGVERIFY completes the same action that OP_CHECKSIG does execute it afterwards (The entire transaction’s Output, Inputs and script being hashed).

2. OP_DROP

3.0xae

1 Like

op_checksig / true or false output. The entire transaction’s outputs, inputs, and script are hashed and the signature used by op_checksig must be a valid signature for this hash and public key.
op_checksigverify / nothing or fail output. Same as op_checkings but is executed afterward.

op_drop
0xae

1 Like

1 What is the practical difference between OP_OP_CHECKSIG and OP_OP_CHECKSIGVERIFY?
With OP_CHECKSIG the entire transaction’s output, input and script are hashed. The signature used must be a valid signature for this hash and public key if it is true(1) is returned if not false(0). OP_CHECKSIGVERIFY does the same, however, if the signature used if not valid for this hash and public key i.e. it is false(0) , it will be removed of the top of the stack.

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. NONE, the both do not exist. OP_OP_* is the wrong syntax. The practical difference between OP_CHECKSIG and OP_CHECKSIGVERIFY however is: Different time of execution and OP_CHECKSIG has an output of true/false and OP_CHECKSIGVERIFY outputs nothing to the stack, it exualy removes the last value.
  2. OP_DROP
  3. 0xae
1 Like
  1. 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 acts same, but OP_VERIFY is executed afterward.
  2. OP_Drop
  3. 0xae
1 Like
  1. OP_CHECKSIGVERIFY is the same as OP_CHECKSIG and OP_VERIFY executed sequentially.
    OP_CHECKSIG: takes signature and public key as inputs. Returns TRUE if the signature is valid for the transaction hash and public key; otherwise FALSE. The hash is computed by hashing inputs, outputs and script of the entire transaction.
    OP_VERIFY: if top of the stack is false, then transaction marked as invalid; and vice versa. Then the top value of the stack (produced by OP_CHECKSIG) is removed.
  2. OP_DROP.
  3. 0xae.
1 Like
  1. What is the practical difference between OP_OP_CHECKSIG and OP_OP_CHECKSIGVERIFY?
    CHECKSIGVERIFY is different because it also runs OP_VERIFY after wards, which marks the transaction as invalid if the top stack item is not 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?
    174 0xae
1 Like
  • What is the practical difference between OP_OP_CHECKSIG and OP_OP_CHECKSIGVERIFY?
    CHECKSIG=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.
    VERFY=Same as OP_CHECKSIG, but OP_VERIFY is executed afterward.

  • 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

1 Like
  1. CHECKSIGVERIFY takes the extra step of marking the transaction as invalid if the binary response is not verified, and also removes the top stack if it is not verified. In other words it just takes CHECKSIG a step further for you assuming you dont want an unverified transaction on top of the stack.

  2. The “Pop” function is called OP_DROP

  3. The hexadecimal OP Code or OP_CHECKMULTISIG is 0xae

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

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

  1. What is the hexadecimal OP Code for OP_CHECKMULTISIG?

0xae

1 Like

1.) OP_CHECKSIG: will return (push to stack) 1 (true) [OR] 0 (false) -> the whole transaction (inputs, outputs, script, …) is checked against a (valid) signature (correct hash for a public key)
OP_CHECKSIGVERIFY: combines OP_CHECKSIG [AND] OP_VERIFY

2.) Pop is done by: OP_DROP

3.) hexcode for OP_CHECKMULTISIG is: 0xae

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

“Same as OP_CHECKSIG, but OP_VERIFY is executed afterward.”

First, OP_OP_CHECKSIG is exectuted then OP_VERIFY checks to see the value returned is 1 if it is 0, then, “ Marks transaction as invalid if top stack value is not true. The top stack value is removed.”

  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_CHECKSIG and OP_CHECKSIGVERIFY?

OP_CHECKSIG checks if the hash is true (1) or false (0) giving the corresponding output.
OP_CHECKSIGVERIFY does the same though it calls OP_VERIFY to check the top stack value. If the value is false (0) it’s marked as invalid and then removed.

  1. What are the “Push” and “Pop” functions called in Script? (They are not called OP_PUSH and OP_POP)

Push:
OP_CHECKLOCKTIMEVERIFY
OP_DUP
OP_HASH160
OP_EQUALVERIFY
OP_CHECKSIG

POP: OP_DROP

  1. What is the hexadecimal OP Code for OP_CHECKMULTISIG?
    0xae
2 Likes
  1. OP_CHECKSIGVERIFY is the same as OP_CHECKSIG but it will also verify that it is a valid transaction afterward and will fail if it previously came back false, removing it from the stack.

  2. OP_DROP

  3. 0xae

1 Like
  1. OP_CHECKSIG: if the signature for the tx hash is correct then in returns true else flase. OP_CHECKSIGVERIFY makes the same and execute OP_VERIFY which checks the last entry of stack if there is a true or false value. If there the val is false then the tx would be marked as invalid. after the check, thes last entry in stack would be removed
  2. OP_DROP
  3. 0xae
1 Like

you’ve added ‘op_drop’ also in the push list :wink:

2 Likes

Thanks! Fixed it now :sweat_smile:

1 Like

Check verify only runs if checks if true
Ox1

1 Like