If you first create the channel, the very first thing Hitesh and Irene do is signal the preliminary commitments, which assigns the preliminary stability to themselves. That is what is named the refund, as a result of if one of many events determine to not proceed, the cash returns to the homeowners. This transaction is a traditional dedication transaction however is created as a result of if not, the funds could possibly be locked ceaselessly on a multisig if one of many events of the channel disappears!
First two examples
The primary two examples are dedication transactions created. Every person creates one dedication transaction with two outputs. In these, each Hitesh and Irene have two outputs:
- The primary output is a cost to the opposite particular person of the preliminary
stability (5 BTC). - The second output is a cost to the identical particular person making the
dedication however with alocktime
of1000 blocks
. (Thelocktime goes
there, not within the refund!)
This dedication just isn’t broadcasted, every one of many events has his personal model. Every one of many events at any second can signal it and broadcast it. In that case the opposite particular person would obtain the 5 BTC immediately and the particular person liable for the published should wait1000 blocks
.
Be aware that this dedication transactions are incomplete because the penalty mechanism is lacking in case some get together tries to cheat. Within the e-book they present this uncompleted model to provide an thought of the way it appears to be like
Third instance
This final instance exhibits how one can create an actual dedication transaction with the penalty mechanism included.
It provides a situation which permits a person to retrieve the funds of the second output if it has the revocation personal key. The revocation key’s a key which each events can calculate the general public key, however they’ll solely get half of the personal key. So that they solely have half of the personal key. If at any second, one of many two customers has the 2 halfs of the personal key, it might declare the funds within the second output.
If the channel state is up to date and a brand new dedication transaction is created, they trade their half of the revocation personal key. This provides them the safety that if the opposite particular person cheats and broadcast an outdated dedication transaction, the sufferer will be capable to declare the opposite particular person the funds as a punishment.
Think about Hitesh tries to cheat; since Irene can declare his 5 BTC immediately (output 1), and Hitesh has to attend 1000 blocks
to get the 5 BTC, Irene can declare Hitesh cash as she has the complete revocation personal key (that is the brand new situation we added within the third instance).
Be aware that if Irene would not declare the funds earlier than 1000 blocks
Hitesh will be capable to proceed and declare himself the cash.
Abstract
In order a abstract, dedication transactions appear to be the third instance because the penalty mechanism is required. Refund transaction is simply the primary dedication transaction that simply returns the funds to the customers. The penalty mechanism can also be wanted there as a result of when you do not add it you could possibly cheat and steal cash by broadcasting the refund transaction sooner or later when the channel state has superior.