Lightning close-channel transaction example?

2

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
<Bob pubkey> OP_CHECKSIG
OP_ELSE
OP_SHA256 <sha256(Bob secret)> OP_EQUALVERIFY
<Alice pubkey> 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

knocte

Posted 2018-05-04T04:03:02.770

Reputation: 1 531

Answers

2

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
    <revocationpubkey>
OP_ELSE
    `to_self_delay`
    OP_CSV
    OP_DROP
    <local_delayedpubkey>
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
}

Yuya Ogawa

Posted 2018-05-04T04:03:02.770

Reputation: 471

0

dtkav

Posted 2018-05-04T04:03:02.770

Reputation: 1

2mmm but those scripts don't match the template I posted in my questionknocte 2018-08-10T08:56:15.607