lightning hubにお金が入る理由

原理的には、HTLCを利用したマルチホップの双方向ペイメントチャネルにおいて、中間者が利益を得る仕組みはない。 なぜhubがお金稼ぐみたいに言われているのか調べた。

Multihop payments

この言葉の定義自体があやふやだった。HTLCを利用した第三者を介した送金、をこう呼ぶということで良さそうだ。
そのプロセスはMultihop paymentsをみるのが正確。

https://medium.com/coinmonks/the-lightning-network-how-to-install-and-hopefully-make-money-6e3058e3fa7c

この記事が良さそう。

どこにお金が発生するか

BOLTの解説記事に料金の定義がある。

自分のノードを介して、他のノードに対する支払いが発生したときに、お金をもらう。 というのが基本。送信先ノードは、それぞれのhubの設定した手数料を見て最適なパスを選択していく。

https://mainnet.yalls.org/network/562252x1989x0

このサイトを見ると、各ノードが請求する手数料を確認することも可能。

LNDでの手順

```
lncli openchannel -h  
NAME:  
   lncli openchannel - Open a channel to an existing peer.

USAGE:  
   lncli openchannel [command options] node-key local-amt push-amt

DESCRIPTION:

  Attempt to open a new channel to an existing peer with the key node-key
  optionally blocking until the channel is 'open'.

  The channel will be initialized with local-amt satoshis local and push-amt
  satoshis for the remote node. Once the channel is open, a channelPoint (txid:vout)
  of the funding output is returned.

  One can manually set the fee to be used for the funding transaction via either
  the --conf_target or --sat_per_byte arguments. This is optional.

  NOTE: peer_id and node_key are mutually exclusive, only one should be used, not both.

OPTIONS:  
   --peer_id value        the relative id of the peer to open a channel with (default: 0)
   --node_key value       the identity public key of the target peer serialized in compressed format
   --local_amt value      the number of satoshis the wallet should commit to the channel (default: 0)
   --push_amt value       the number of satoshis to push to the remote side as part of the initial commitment state (default: 0)
   --block                block and wait until the channel is fully open
   --conf_target value    (optional) the number of blocks that the transaction *should* confirm in, will be used for fee estimation (default: 0)
   --sat_per_byte value   (optional) a manual fee expressed in sat/byte that should be used when crafting the transaction (default: 0)
   --private              make the channel private, such that it won't be announced to the greater network, and nodes other than the two channel endpoints must be explicitly told about it to be able to route through it
   --min_htlc_msat value  (optional) the minimum value we will require for incoming HTLCs on the channel (default: 0)

この辺から設定できそうかな・・・、まだざっくりしかわからないけど、手数料にもいろいろ種類がありそうだ。

ちなみに、ここにlappsがいろいろ並んでいておもしろい。 https://lightningnetworkstores.com/