Connect LDK sample node with Polar network
ドキュメント読めば送金までできた
lnd から ldk に対してチャネルをあけるときに以下のエラーが生じる場合があったのでメモ
EVENT: Channel 18eed08873a6b06ad8b1f65661efb58b9a80fd0f5dc0e9bee1676f2844bb7714 closed due to: ProcessingError { err: "dust_limit_satoshis (573) is greater than the implementation limit (546)" }
LDK version commit 39a4c4561a61f6c7601e52a06b26f7820b74998a lnd(run in Polar) version 0.12.1-beta Released at Feb 24, 2021
dust limit に関する変更が入った commit が Sep, 2021 なのでそれ以降の lnd 使えばうまく行く気がする(試してはいない) polar でも新しいバージョンはダウンロードできた
channel open のときに送るデータの一つ
The receiving node MAY fail the channel if: it considers dust_limit_satoshis too large.
The receiving node MUST fail the channel if: dust_limit_satoshis is greater than channel_reserve_satoshis.
dust_limit_satoshis is smaller than 354 satoshis (see BOLT 3).
つまり lnd v0.12.1 が指定した dust limit が ldk に取っては多きすぎると判断されたっぽい
The receiver should not accept large dust_limit_satoshis, as this could be used in griefing attacks, where the peer publishes its commitment with a lot of dust htlcs, which effectively become miner fees.
Definition of dust
bitcoind の default dustRelayFee が 3000sats/kvB = 3sats/vB
P2PKH の input が148byte output が 34byte で合計 182byte * 3 = 546 sats は手数料に最低でもかかる OTXO が 546 以下は dust とみなす
code:code lightnin
lightning-cli connect <node pubkey>(start with 02) <host> <port>
Poler がホストマシーンに割り当てている host を確認する必要がある
IPAM -> Config -> Gateway かなと思ったらそうだった
詳細は調べる
bitcoind rpc の password を間違って unauthorized になったときの動作がおかしい
body の length が 0 なので out of range のエラーが変えるが、unauthorized だと教えてほしい