Superseded by revised description here - https://gist.github.com/antiochp/e54fece52dc408d738bf434a14680988
A channel consists of a single multisig output. Alice and Bob agree to fund the channel.
Txfund ([InA, InB] -> Outchannel, Kernfund)
A pair of endpoint specific "close" and "settle" txs are negotiated for both Alice and Bob. Each "settle" tx has a relative lock height from the corresponding "close" tx kernel, introducing a delay between "close" and "settle" (24 hours for example).
The "close" and "settle" txs are negotiated between Alice and Bob before the channel is funded to prevent funds being locked up by either party.
Close and settle txs for Alice -
Txclose_0_A (Inchannel -> Outclose_0_A, Kernclose_0_A)
Txsettle_0_A (Inclose_0_A -> [OutA0, OutB0], Kernsettle_0_A,close_0_A,1440)
A matching pair of txs are created for Bob.
The channel can be closed cooperatively at any time by building a tx to spend from the multisig "channel" output, distributing funds back to Alice and Bob.
Alternatively either party can non-cooperatively close the channel by broadcasting their version of the current "close" tx (Txclose_0_A for Alice or Txclose_0_B for Bob).
To update the channel state a new "close" and "settle" pair of txs is negotiated, along with a "revoke" tx that revokes the previous state. The "revoke" tx simply spends the "close" funds back to the main "channel" output.
Txclose_1_A (Inchannel -> Outclose_1_A, Kernclose_1_A)
Txsettle_1_A (Inclose_1_A -> [OutA1, OutB1], Kernsettle_1_A,close_1_A,1440)
Txrevoke_0_B (Inclose_0_A -> Outchannel, Kernrevoke_0_B)
Note: Alice possesses the "close" and "settle" txs. Bob possesses the tx to revoke the previous state attributed to Alice. Bob can revoke any previous close broadcast by Alice.
Note: Alice cannot lock funds by repeatedly closing and revoking old states. Only Bob can revoke if Alice closes.
At this point Alice can non-cooperatively close the latest state by broadcasting Txclose_1_A, waiting for the delay and then broadcasting Txsettle_1_A.
Alternatively Alice could attempt to close a previous state by broadcasting Txclose_1_A.
Bob can "revoke and close" to immediately close the channel for the latest state as follows -
Txrevoke_0_B
(Inclose_0_A -> Outchannel, Kernrevoke_0_B)
Txclose_1_B
(Inchannel -> Outclose_1_B, Kernclose_1_B)
=> Txrevoke_close_B (Inclose_0_A -> Outclose_1_B, [Kernrevoke_0_B, Kernclose_1_B])
A "revoke and close" cut-through tx can be built for any previous "close" to the latest state with a single "revoke" kernel and the latest "close" kernel.
The example above used states 0 and 1 but the same thing applies for any arbitrary states. There is still only a single "revoke" tx with a single kernel and a single close tx for the latest state. An aggregate cut-through tx with 2 kernels is required to "revoke and close" any previous state.
In the cooperative case there will be a single funding tx and a single close tx.
Txfund ([InA, InA] -> Outchannel, Kernfund)
Txclose (Inchannel -> [OutA', OutB'], Kernclose)
In the non-cooperative case there will be a close and settle pair. The relative lock height between close and settle will be visible.
Txfund ([InA, InA] -> Outchannel, Kernfund)
Txclose (Inchannel -> Outclose, Kernclose)
Txsettle (Inclose -> [OutA', OutB'], Kernsettle,close,1440)
In the revocation case we will see a close followed by a revoke and close and a final settle tx.
Txfund ([InA, InA] -> Outchannel, Kernfund)
Txclose (Inchannel -> Outclose, Kernclose)
Txrevoke_close (Inclose -> Outclose', [Kernrevoke, Kernclose'])
Txsettle (Inclose' -> [OutA', OutB'], Kernsettle,close',1440)
Each party must maintain a single "close" and "settle" tx pair for the latest channel state.
To allow revocation of any previous state they must also store the revocation kernel for each previous channel state.
So this is like Poon-Dryja but with punish replaced by undo.
If you don't punish publication of old states, then you need not assign blame either.
So why do you have separate closes for A and B?
In principle this is a nice design for a "forgiving" payment channel,
with potential for needing only half the outputs/txs of the direct Poon-Dryja if you don't distinguish A/B closes.
But I see a big problem with designs that recycle outputs, in this case for the channel funds.
How do you pay the required fees?
To do a revoke+latest close seemingly requires that both the earlier close and revoke tx pay 0 fees?!