OP_BOOLAND - Logical AND
From TeachMeBitcoin, the free encyclopedia
Reading time: 1 min
7. OP_BOOLAND — Logical AND
Opcode Reference
Opcode: OP_BOOLAND
Hex: 0x9A
Decimal: 154
Input: a b
Output: 1 if a != 0 AND b != 0, else 0
Overview
OP_BOOLAND performs a logical AND operation on the top two stack elements. Both are treated as booleans: zero is false, any non-zero value is true. The result is 1 only if both inputs are non-zero.
Truth Table
``` a | b | Output
☕ Help support TeachMeBitcoin
TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation:
Ethereum:
0x578417C51783663D8A6A811B3544E1f779D39A85
Bitcoin:
bc1q77k9e95rn669kpzyjr8ke9w95zhk7pa5s63qzz
Solana:
4ycT2ayqeMucixj3wS8Ay8Tq9NRDYRPKYbj3UGESyQ4J