Page 73 - ITU Journal Future and evolving technologies Volume 2 (2021), Issue 5 – Internet of Everything
P. 73
ITU Journal on Future and Evolving Technologies, Volume 2 (2021), Issue 5
IoT Device LN Gateway Bridge LN Node follows the exact same steps given for the IoT channel clo‑
sure case above. The only difference is the on‑chain fee
1. ChannelClosingRequest
2. shutdown part. This time, channel closing is requested by the LN
gateway; therefore, it pays the on‑chain fee. The same
3. shutdown
Complete any mechanism is used: the on‑chain fee is deducted from the
pending HTLC LN gateway’s balance on the channel. There is a chance
...
that the LN gateway might not have enough balance in
4. closing_signed the channel to cover the on‑chain fee. Thus, we propose
5. closing_signed that the LN gateway does not attempt to close the channel
... without collecting enough service fees on the channel.
k. closing_signed
k+1. closing_signed 5.3.3 Bridge LN node channel closure
k+2. ClosingTxRequest
{Type: ClosingTxRequest, Similar to the LN gateway channel closure case, the bridge
Closing Transaction} LN node can close the channel unilaterally or mutually. In
k+3. Generates the signature both scenarios, the LN gateway will learn about closure of
k+4. ClosingTxSigned the channel. We propose that the LN gateway noti ies the
{Type: ClosingTxSigned, IoT device about the channel closure by sending it a Chan‑
Signature}
k+5. Broadcasts the nelClosed message. This serves as a noti ication to the IoT
closing transaction to device so that it does not attempt to use the channel in the
Bitcoin network
future.
Fig. 7 – Protocol steps for the IoT device channel closure when the LN 5.4 Changes to LN’s BOLT #3
gateway performs a mutual close with the bridge LN node. Messages in
red show the default messages in BOLT #2. We explained in Section 3.3.2 the BOLT #3 speci ication.
Since the channels were made 3‑of‑3 multisignature with
LN gateway in a ClosingTxSigned message that has the fol‑ the introduction of the IoT device, it requires changes to
lowing ields: Type: ClosingTxSigned, Signature. With this the LN’s Bitcoin scripts. In this section, we show the pro‑
signature, the LN gateway can now broadcast the closing posed changes to the funding transaction output, the com‑
mitment transactions, and the HTLC transactions.
transaction to the Bitcoin network and close the channel.
The on‑chain fee of this transaction is paid by the IoT de‑ Changes to the Funding Transaction Output: Instead
vice by deducting the fee from its balance on the channel. of sending the funds to a 2‑of‑2 multisignature address,
We illustrated the protocol steps for this mutual close case we propose to send them to a 3‑of‑3 multisignature ad‑
in Fig. 7. dress. Thus, the new proposed witness script of the
funding transaction output is: 3 <pubkey1> <pubkey2>
Unilateral Close: For the unilateral close case, the LN
<pubkey3> 3 OP_CHECKMULTISIG.
gateway sends its most recent commitment transaction
to the IoT device in a SignTxRequest message which has Changes to the Commitment Transaction Inputs: We
the following ields: Type: SignTxRequest, Commitment propose to change the commitment transaction input wit‑
Transaction. Upon receiving the message, the IoT device ness to: 0 <sig_for_pubkey1> <sig_for_pubkey2>
generates a signature for this commitment transaction <sig_for_pubkey3> as now 3 signatures are needed in‑
and sends it to the LN gateway in a TxSigned message that stead of 2.
has the following ields: Type: TxSigned, Signature. Af‑ Addition of to_IoT Output to the Commitment Trans‑
ter the LN gateway receives the signature, it can broad‑
actions: The LN gateway is not funding the channel. In‑
cast the commitment transaction to the Bitcoin network
stead, the channel is funded by the IoT device. Therefore,
to close the channel. Similarly, the on‑chain fee is paid by
the IoT device needs its own output in commitment trans‑
the IoT device.
actions. Thus, we propose adding a to_IoT output to the
LN gateway’s and bridge LN node’s commitment transac‑
5.3.2 LN gateway channel closure tions. This output pays to the IoT_pubkey that the IoT
device can spend with the witness <IoT_sig>.
The LN gateway can also close the channel it opened to
Changes to to_local Output of the Commitment
the bridge LN node due to the IoT device’s request. The
Transactions: Since the channel is funded by the
steps are very similar to the IoT channel closure case with
minor differences. We explain it below: IoT device, the to_local output in the LN gateway’s
commitment transaction only holds the LN gate‑
LN Gateway Channel Closing Request: The LN gateway
way’s service fees which are sent to the LN gateway’s
sends a ChannelClosingRequest message to the IoT device.
<local_delayedpubkey>. The bridge LN node’s
Closing the Channel: The LN gateway can close the chan‑ to_local output is not modi ied.
nel unilaterally or mutually and it needs the IoT device’s
signature to be able to close the channel. Therefore, it
© International Telecommunication Union, 2021 61