A +----------------+ B +---------------------------------------------+ MSIG A B | | | 10 BTC | | +------------------+ | | | ++---------------+ | event 1: A sends 2 to B | | | | +------------------+ | | | | INITIAL STATE | event 2: A sends 5 to B | +> | A 10 | | | | B 0 | | | +------------------+ means B must have the preimage <> | | to be able to spend. v | +-------------------------> this could be a transaction from A to B STATE 2 | STATE 1 | or could be a transaction from A to X, Y or Z, +----------------------+---------------+ | +-------------------+--+---------------+ as long as A knows the hash so it can build | if hash(<>) = h | | | | if hash(<>) = h | | the transaction and B recovers the preimage +----------------------+ if block > t | +--------> +----------------------+ if block > t | from the next in line before t arrives. | if sig A | if sig B | | | if sig A | if sig B | | +-+-+------+----+-+----+-------+-------+ +-----+-+--+--------+-++---------+-----+ | | | | | | | | | | +------+ | | +------+ | | | +------+ | | +------+ | | | | | | | | | | | v | | | | | | | | | | CSV | | | | CSV | | | +------+--------+ | CSV | | | | CSV | | | | +--------------+ for the first event, | 144 | <+ | | 144 | <+ | | | | 144 | <+ | | 144 | <+ | +-> | | prev state is a | | | | | | | PREV STATE | | | | | | | | PREV STATE | transaction equal to +--+---+ | +---+--+ | | | +--+---+ | +---+--+ | | | INITIAL STATE | | | | +---------------+ | | | | +--------------+ v | v | v | v | | | for the second event | | +-----+ | +-----+ | prev state will be +-----+ | +-----+ | | A 9 | | | A 9 | | a transaction equal | A 9 | | | A 9 | | | B 1 | | | B 1 | | to the following part | B 1 | | | B 1 | | +-----+ v +-----+ | of STATE 1 | +-----+ v +-----+ | v | v +----------+ | +----------+ |if secret | +----------+ | |if secret | +----------+ |from A: | |if secret | | |from A: | |if secret | | A 0 | |from B: | | | A 0 | |from B: | | B 10 | | A 10 | | | B 10 | | A 10 | +----------+ | B 0 | | +----------+ | B 0 | +----------+ | +----------+ v -----------+-----------+ | if sig A | if sig B | +------+-+-+---------+-+ | | | | +------+ | | +------+ | | | | | | | | | | | CSV | | | | CSV | | | | 144 | <+ | | 144 | <+ | | | | | | | +--+---+ | +---+--+ | | | | | v | v | | | +-----+ | +-----+ | | A 9 | | | A 9 | | | B 1 | | | B 1 | | +-----+ v +-----+ | v +----------+ |if secret | +----------+ |from A: | |if secret | | A 0 | |from B: | | B 10 | | A 10 | +----------+ | B 0 | +----------+