Browse Source

doc: document HTLC 2drop optimization.

We can save an opcode in both HTLC send and receive scripts by using
OP_2DROP instead of OP_DROP twice.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 10 years ago
parent
commit
88ca0c91d9
  1. 28
      doc/deployable-lightning.lyx
  2. BIN
      doc/deployable-lightning.pdf

28
doc/deployable-lightning.lyx

@ -1906,11 +1906,7 @@ OP_ELSE Must be A, after HTLC has timed out.
\begin_inset space ~ \begin_inset space ~
\end_inset \end_inset
OP_CHECKLOCKTIMEVERIFY OP_CHECKLOCKTIMEVERIFY Ensure (absolute) time has passed.
\begin_inset space ~
\end_inset
OP_DROP Ensure (absolute) time has passed.
\end_layout \end_layout
\begin_layout Description \begin_layout Description
@ -1918,11 +1914,12 @@ OP_DROP Ensure (absolute) time has passed.
\begin_inset space ~ \begin_inset space ~
\end_inset \end_inset
OP_CHECKSEQUENCEVERIFY OP_CHECKSEQUENCEVERIFY Delay gives B enough time to use revocation if it
\begin_inset space ~ has it.
\end_inset \end_layout
OP_DROP Delay gives B enough time to use revocation if it has it. \begin_layout Description
OP_2DROP Drop the delay and htlc-timeout from the stack.
\end_layout \end_layout
\begin_layout Description \begin_layout Description
@ -1963,20 +1960,17 @@ OP_IF
\end_layout \end_layout
\begin_deeper \begin_deeper
\begin_layout Description
OP_DROP Remove extra hash
\end_layout
\begin_layout Description \begin_layout Description
<DELAY> <DELAY>
\begin_inset space ~ \begin_inset space ~
\end_inset \end_inset
OP_CHECKSEQUENCEVERIFY OP_CHECKSEQUENCEVERIFY Delay gives A enough time to use revocation if it
\begin_inset space ~ has it.
\end_inset \end_layout
OP_DROP Delay gives A enough time to use revocation if it has it. \begin_layout Description
OP_2DROP Drop extra hash and delay from the stack
\end_layout \end_layout
\begin_layout Description \begin_layout Description

BIN
doc/deployable-lightning.pdf

Binary file not shown.
Loading…
Cancel
Save