Nicolas Dorier [ARCHIVE] on Nostr: 📅 Original date posted:2016-03-07 📝 Original message: I'm amazed as I found a ...
📅 Original date posted:2016-03-07
📝 Original message:
I'm amazed as I found a useful case for OP_CODESEPARATOR.
I think the script can be improved to take less byte for removing the
duplication of <KeyA>, will take a look later.
Let's change escape redeem:
OP_HASH160 <RHashA> OP_EQUAL
OP_IF
<KeyB>
OP_ELSE
<Delay> OP_CSV OP_DROP
<KeyA>
OP_ENDIF
OP_CHECKSIG
To
<KeyA> OP_CHECKSIG
OP_IF
<KeyB>
OP_ELSE
<Delay> OP_CSV OP_DROP
OP_CODESEPARATOR <KeyA>
OP_ENDIF
OP_CHECKSIG
The Escape output would be
<SIG-B> <SIGA-Revocation> {<ESCAPE-REDEEM>}
Where SIGA-Revocation is the signature of KeyA computed with the
ScriptCode=<ESCAPE-REDEEM>
The second escape would be
<SIG-A> 0 {<ESCAPE-REDEEMSCRIPT>}
where <SIG-A> script equals to
<KeyA>
OP_ENDIF
OP_CHECKSIG
You would revoke a commitment by revealing <SIGA-Revocation>
Btw, you can play with
http://n.bitcoin.ninja/checkscript to test such
script (I'm checking it myself)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <
http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20160307/20fd0605/attachment.html>
Published at
2023-06-09 12:45:50Event JSON
{
"id": "c4ca277b80b85761bb49aabb5648079beba343a17854120a9c03ada4a7923295",
"pubkey": "bf0548dc0ad239e9e1e0bba3c969632ded402a68091cde1b21a0895e90bc9a57",
"created_at": 1686314750,
"kind": 1,
"tags": [
[
"e",
"9dffd851f36e0464b9b84a18f034d9a166bd96caa924994430620e4b51393055",
"",
"reply"
],
[
"p",
"9456f7acb763eaab2e02bd8e60cf17df74f352c2ae579dce1f1dd25c95dd611c"
]
],
"content": "📅 Original date posted:2016-03-07\n📝 Original message:\nI'm amazed as I found a useful case for OP_CODESEPARATOR.\nI think the script can be improved to take less byte for removing the\nduplication of \u003cKeyA\u003e, will take a look later.\nLet's change escape redeem:\n\nOP_HASH160 \u003cRHashA\u003e OP_EQUAL\nOP_IF\n\u003cKeyB\u003e\nOP_ELSE\n\u003cDelay\u003e OP_CSV OP_DROP\n\u003cKeyA\u003e\nOP_ENDIF\nOP_CHECKSIG\n\nTo\n\n\u003cKeyA\u003e OP_CHECKSIG\nOP_IF\n\u003cKeyB\u003e\nOP_ELSE\n\u003cDelay\u003e OP_CSV OP_DROP\nOP_CODESEPARATOR \u003cKeyA\u003e\nOP_ENDIF\nOP_CHECKSIG\n\nThe Escape output would be\n\n\u003cSIG-B\u003e \u003cSIGA-Revocation\u003e {\u003cESCAPE-REDEEM\u003e}\n\nWhere SIGA-Revocation is the signature of KeyA computed with the\nScriptCode=\u003cESCAPE-REDEEM\u003e\n\nThe second escape would be\n\n\u003cSIG-A\u003e 0 {\u003cESCAPE-REDEEMSCRIPT\u003e}\n\nwhere \u003cSIG-A\u003e script equals to\n\n\u003cKeyA\u003e\nOP_ENDIF\nOP_CHECKSIG\n\nYou would revoke a commitment by revealing \u003cSIGA-Revocation\u003e\n\nBtw, you can play with http://n.bitcoin.ninja/checkscript to test such\nscript (I'm checking it myself)\n-------------- next part --------------\nAn HTML attachment was scrubbed...\nURL: \u003chttp://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20160307/20fd0605/attachment.html\u003e",
"sig": "cbed4b7aac34e7ff5effeae0a0b552ac3f450bc0aa51cd707d25284f8f947940804fbf4eb9626e5acbcdfd566e069078566a2daec81b9b67dcc32c2e793b86d5"
}