709 / 736JIT

Just-in-Time Channels

결제가 도착할 때 비로소 열리는 채널

Just-in-Time Channel은 incoming payment에 반응해 LSP가 여는 Lightning channel이다. 수신자는 미리 capacity를 사지 않고 받을 수 있고 opening cost는 첫 payment에서 차감된다.

LSPS2, 즉 bLIP 52는 parameters를 협상하고 payment data에 특별한 identifier를 넣어 LSP를 통과할 때 private zero-confirmation channel 개설과 opening fee 차감 후 payment 전달을 시작한다.

Just-in-Time Channel은 public Lightning Network의 incoming payment가 LSP를 통해 도착할 때만 만들어진다. 수신자는 channel, outbound capacity, on-chain funds를 미리 보유할 필요가 없고 새 inbound liquidity 비용은 첫 payment에서 낸다. [1]

Client는 먼저 lsps2.get_info를 호출해 min_fee_msat, ppm proportional rate, valid_until, min_lifetime, max_client_to_self_delay, payment size limits가 든 offers를 받는다. 선택한 offer와 LSP가 만든 promise를 lsps2.buy로 보내며 만료, 너무 작은 payment, liquidity 부족이면 error가 난다. [2]

성공한 lsps2.buy는 jit_channel_scid와 lsp_cltv_expiry_delta를 돌려준다. Client는 LSP node ID와 이 SCID를 BOLT11 invoice route hint의 유일한 hop으로 넣거나 blinded path 같은 미래 방식으로 같은 정보를 전한다. Expiry는 valid_until을 넘지 않으며 payment 도착 때 client가 연결돼 있어야 한다. [1]

LSP가 incoming HTLC에서 jit_channel_scid를 알아보면 표준 BOLT 2 channel establishment를 시작한다. Channel은 payment_size_msat에서 opening_fee를 뺀 금액과 reserve를 담아야 하고 unannounced 상태로 option_scid_alias를 쓰며 funding transaction 확인 전 zero-confirmation channel로 payment를 전달할 수 있다. [4]

LSPS2는 두 trust models를 정의한다. LSP trusts client에서는 provider가 valid funding transaction을 먼저 공개하고 client가 preimage를 풀지 않을 위험을 진다. Client trusts LSP에서는 provider가 broadcast를 미룰 수 있고 client는 preimage를 풀며 valid funding outpoint 생성을 신뢰한다. [3]

JIT는 무조건적인 delivery가 아니다. Payment는 opening fee, limits, minimum HTLC를 충족해야 하며 funding_signed 전 disconnect는 temporary_channel_failure를 낸다. Naive prepayment probe는 LSP trusts client에서 LSP가 payment를 받지 못할 channel open을 일으킬 수 있다. [1]

bLIP 52는 active specification이며 transport로 LSPS0, 즉 bLIP 50이 필요하다. Reference crate lightning-liquidity는 LSPS2 client와 service handlers를 제공하지만 documentation은 service-side support를 beta라 한다. API 존재만으로 wallet이나 LSP의 production readiness가 증명되지는 않는다. [5]

Verification은 lsps2.get_info와 max(min_fee_msat, proportional fee)의 정확한 계산, valid_until, promise, payment limits, min_lifetime, max_client_to_self_delay 확인부터 시작한다. Payment 뒤 deducted fee, funding outpoint, channel parameters, channel_ready, alias, actual inbound capacity를 확인해야 하며 invoice만으로 open channel은 증명되지 않는다. [1]

더 정확히 이해하려면 이 항목과 함께 다음도 읽어 보세요 Lightning Service Provider, Inbound Liquidity, Payment Channel, Price Channel, BOLT 11, BOLT 12.

01Just-in-Time Channel은 무료인가?

아니다. LSP는 첫 incoming payment에서 opening fee를 차감한다. Client는 offer의 minimum과 proportional fee, payment limits, parameters validity period를 미리 확인해야 한다.

02Payment 수령 전에 Just-in-Time Channel이 on-chain 확인되는가?

보통 아니다. LSPS2는 payment에 반응해 zero-confirmation channel을 열며 trust model에 따라 funding transaction은 mempool에만 있거나 broadcast 전일 수 있다. Client가 confirmation threshold와 LSP risk를 선택해야 한다.

DOC · 001bLIP 52 — LSPS2 JIT Channel Negotiation명세 DOC · 002bLIP 50 — LSPS0 Transport Layer명세 DOC · 003bLIP 25 — Forward less than onion value명세 DOC · 004BOLT 2 — Peer Protocol for Channel Management명세 DOC · 005LDK lightning-liquidity — LSPS2 module문서
개정일: 1차 출처 우선 · 투자 조언이 아닙니다