Lightning close-channel transaction example? From this article, I can understand that a punishment-based bidirectional payment channel (the type used by Lightning) would contain roughly this bitcoin script as one of the outputs:

OP_IF
“+7 days” OP_CHECKSEQUENCEVERIFY OP_DROP
&lt;Bob pubkey&gt; OP_CHECKSIG
OP_ELSE
OP_SHA256 &lt;sha256(Bob secret)&gt; OP_EQUALVERIFY
&lt;Alice pubkey&gt; OP_CHECKSIG
OP_ENDIF


I guess there are some block explorers that let you visualize the real script being used in a transaction, so can anyone point me to a real LN transaction (in mainnet) that follows the template above?

Thanks
The actual script implemented on Lightning Network is a little bit different from what you quoted. This is the script below and the specification is here

OP_IF
    # Penalty transaction
    &lt;revocationpubkey&gt;
OP_ELSE
    `to_self_delay`
    OP_CSV
    OP_DROP
    &lt;local_delayedpubkey&gt;
OP_ENDIF
OP_CHECKSIG


I've created that transaction on Testnet as the following,

Txid:
4f8d776c85b1fc15c1125e7043a9aee70e33f0793b472823e3946a8de075bec4

Rawdata:

6321026644cb387614f66421d14da3596c21cffa239011416c9adf3f351ee8551a9fc767029000b27521029654f80732769d7c435a184a3559f12178315526c53bbf003349390811c7590a68ac


Decoded by here

{
    "result": {
        "asm": "OP_IF 026644cb387614f66421d14da3596c21cffa239011416c9adf3f351ee8551a9fc7 OP_ELSE 144 OP_CHECKSEQUENCEVERIFY OP_DROP 029654f80732769d7c435a184a3559f12178315526c53bbf003349390811c7590a OP_ENDIF OP_CHECKSIG",
        "type": "nonstandard",
        "p2sh": "35M7MGVGd3ajyiTMvriUiyUM3H2cT5sgb4"
    },
    "error": null,
    "id": null
}