mirror of
https://github.com/bits-wallet/specs.git
synced 2025-12-17 05:34:21 +01:00
2.2 KiB
2.2 KiB
BDS-03 Base Channel Formation
draft mandatory author:brqgoo
This BDS defines the channel formation protocol for crediting channel addresses.
Channel Establishment
+-------+ +-------+
| |--(1)--- request_base_form ----->| |
| |<-(2)-- accept_base_form ----- | |
| CLI | | LSP |
| |--(3)--- refund_state_sig ----->| |
| |<-(4)-- credit_base ----- | |
+-------+ +-------+
The request_base_form Message
This message contains information about the channel address outpoint info for which the user wants to be credited by the LSP.
- For addri = channel address to be established:
-
- Let to_self = cbytes(pki).
-
- Let Qi, gacci, and tacci = keygen_ctxi.
-
- Let agg_key = xbytes(Qi).
-
- Let secnonce, pubnonce = NonceGen(to_self, agg_key).
-
- Let
child_key_cli= bytes(32, to_self).
- Let
-
- Let
public_nonce_cli= bytes(32, pubnonce).
- Let
request_base_form payload:
- [
32*byte:channel_addr_prevout] - [
u64:channel_addr_vout] - [
32*byte:child_key_cli] - [
32*byte:public_nonce_cli]
The accept_base_form Message
-
- Let to_self : 32-byte x-only well defined LSP key.
-
- Let to_remote :
child_key_clifromrequest_base_formmessage.
- Let to_remote :
-
- Let keygen_ctx = KeyAgg([to_self, to_remote]).
-
- Let Q, gacc, and tacc = keygen_ctx.
-
- Let agg_key = xbytes(Q).
-
- Let secnonce, pubnonce = NonceGen(to_self, agg_key).
-
- Let
public_nonce_lsp= bytes(32, pubnonce).
- Let
accept_base_form payload:
- [
32*byte:channel_addr_prevout] - [
u64:channel_addr_vout] - [
32*byte:public_nonce_lsp]
The refund_state_sig Message
refund_state_sig payload:
- [
32*byte:channel_addr_prevout] - [
u64:channel_addr_vout] - [
32*byte:half_sig_cli]
The credit_base Message
credit_base payload:
- [
32*byte:channel_addr_prevout] - [
u64:channel_addr_vout] - [
32*byte:half_sig_lsp]