Bitcoin

Script – How do items stay on the stack if there is no push opcode (check tx)

I was reading the following link and it says “Alice’s pubkey script pushes the pubkey hash that Bob gave her for the first transaction”. I mean, how? There is no opcode for this. The previous opcode was OP_HASH160, which pushes a hashed public key. Since there is no PUSH opcode after this, how is the pubkey hash pushed again?

I think there’s another question that’s exactly related to this as well. Does your signing script include push opcodes? If not, how are the signing/public keys pushed onto the stack? bitcoin.org directly states that this is nodes running in order.

<sig> <PubKey> OP_DUP OP_HASH160 <PubkeyHash> OP_EQUALVERIFY OP_CHECKSIG

So without push opcodes for the first two items, we don’t know how they are stored on the stack.

Thanks for your time.

Related Articles

Back to top button