🔧 Bitcoin Script Type Reference
📥 Decoder Input
📊 Execution Stack Visualizer

Step through script execution to see the stack state.

Click "Step Execution" to start.
⚡ HTLC & Lightning Network Examples
Hash Time-Locked Contract (HTLC):
Used in Lightning Network for atomic swaps and payment channels.

OP_IF
  OP_HASH160 <payment_hash> OP_EQUALVERIFY
  OP_DUP OP_HASH160 <receiver_pubkey_hash>
OP_ELSE
  <timeout_blocks> OP_CHECKLOCKTIMEVERIFY OP_DROP
  OP_DUP OP_HASH160 <sender_pubkey_hash>
OP_ENDIF
OP_EQUALVERIFY OP_CHECKSIG


How it works: Receiver can claim funds by revealing the preimage of payment_hash before timeout. If they don't, sender can reclaim funds after timeout_blocks — enabling trustless off-chain payment routing.
🧩 Miniscript Policy Compiler (Simplified)

Enter a policy in plain English-like syntax: