Skip to content

Commit ba016fe

Browse files
committed
fundchannel_start & multifundchannel: add channel_type.
Let's tell the caller what channel_type they got! Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Added: JSON-RPC: `fundchannel`, `multifundchannel`, `fundchannel_start` and `openchannel_init`: new field `channel_type`.
1 parent a39b1b3 commit ba016fe

19 files changed

+362
-116
lines changed

doc/lightning-fundchannel.7.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ On success, an object is returned, containing:
107107
- **txid** (txid): The txid of the transaction which funded the channel
108108
- **outnum** (u32): The 0-based output index showing which output funded the channel
109109
- **channel\_id** (hex): The channel\_id of the resulting channel (always 64 characters)
110+
- **channel\_type** (object): channel\_type as negotiated with peer *(added v24.02)*:
111+
- **bits** (array of u32s): Each bit set in this channel\_type *(added v24.02)*:
112+
- Bit number
113+
- **names** (array of strings): Feature name for each bit set in this channel\_type *(added v24.02)*:
114+
- Name of feature bit (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even")
110115
- **close\_to** (hex, optional): The raw scriptPubkey which mutual close will go to; only present if *close\_to* parameter was specified and peer supports `option_upfront_shutdown_script`
111116
- **mindepth** (u32, optional): Number of confirmations before we consider the channel active.
112117

@@ -135,4 +140,4 @@ RESOURCES
135140

136141
Main web site: <https://github.com/ElementsProject/lightning>
137142

138-
[comment]: # ( SHA256STAMP:a8329cdb3f13f5bd0047824bed82c2e10516af2735dc59aa2cd71e4cc4f0250a)
143+
[comment]: # ( SHA256STAMP:2a9b49a923bd6dce39823b245338f86a9ffcd3c4a3b8fc407f4dab91366bd317)

doc/lightning-fundchannel_start.7.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ On success, an object is returned, containing:
6363

6464
- **funding\_address** (string): The address to send funding to for the channel. DO NOT SEND COINS TO THIS ADDRESS YET.
6565
- **scriptpubkey** (hex): The raw scriptPubkey for the address
66+
- **channel\_type** (object): channel\_type as negotiated with peer *(added v24.02)*:
67+
- **bits** (array of u32s): Each bit set in this channel\_type *(added v24.02)*:
68+
- Bit number
69+
- **names** (array of strings): Feature name for each bit set in this channel\_type *(added v24.02)*:
70+
- Name of feature bit (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even")
6671
- **close\_to** (hex, optional): The raw scriptPubkey which mutual close will go to; only present if *close\_to* parameter was specified and peer supports `option_upfront_shutdown_script`
6772
- **mindepth** (u32, optional): Number of confirmations before we consider the channel active.
6873

@@ -102,4 +107,4 @@ RESOURCES
102107

103108
Main web site: <https://github.com/ElementsProject/lightning>
104109

105-
[comment]: # ( SHA256STAMP:ed685f91a9242a38a2d48b82ed7ba063a1a4d754d95283ad232cbe7d12471659)
110+
[comment]: # ( SHA256STAMP:4052f73b3eb8091a313aa6eefa66fa4df8e3cd73678fe72260272c3802a768b6)

doc/lightning-multifundchannel.7.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,11 @@ On success, an object is returned, containing:
122122
- **id** (pubkey): The peer we opened the channel with
123123
- **outnum** (u32): The 0-based output index showing which output funded the channel
124124
- **channel\_id** (hex): The channel\_id of the resulting channel (always 64 characters)
125+
- **channel\_type** (object): channel\_type as negotiated with peer *(added v24.02)*:
126+
- **bits** (array of u32s): Each bit set in this channel\_type *(added v24.02)*:
127+
- Bit number
128+
- **names** (array of strings): Feature name for each bit set in this channel\_type *(added v24.02)*:
129+
- Name of feature bit (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even")
125130
- **close\_to** (hex, optional): The raw scriptPubkey which mutual close will go to; only present if *close\_to* parameter was specified and peer supports `option_upfront_shutdown_script`
126131
- **failed** (array of objects, optional): any peers we failed to open with (if *minchannels* was specified less than the number of destinations):
127132
- **id** (pubkey): The peer we failed to open the channel with
@@ -209,4 +214,4 @@ RESOURCES
209214
210215
Main web site: <https://github.com/ElementsProject/lightning>
211216
212-
[comment]: # ( SHA256STAMP:9922effdfb4bcd5ab95057fb0c043f0597446f4da4e7d5033520a3138ffc8ff8)
217+
[comment]: # ( SHA256STAMP:2a1903512adf241247ba2540d376a2ee86fe2189c272e10849b4ca1881bf997d)

doc/lightning-openchannel_bump.7.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ RETURN VALUE
3939
On success, an object is returned, containing:
4040

4141
- **channel\_id** (hex): the channel id of the channel (always 64 characters)
42+
- **channel\_type** (object): channel\_type as negotiated with peer *(added v24.02)*:
43+
- **bits** (array of u32s): Each bit set in this channel\_type *(added v24.02)*:
44+
- Bit number
45+
- **names** (array of strings): Feature name for each bit set in this channel\_type *(added v24.02)*:
46+
- Name of feature bit (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even")
4247
- **psbt** (string): the (incomplete) PSBT of the RBF transaction
4348
- **commitments\_secured** (boolean): whether the *psbt* is complete (always *false*)
4449
- **funding\_serial** (u64): the serial\_id of the funding output in the *psbt*
@@ -83,4 +88,4 @@ RESOURCES
8388

8489
Main web site: <https://github.com/ElementsProject/lightning>
8590

86-
[comment]: # ( SHA256STAMP:b70ef93977f0316da57fcecdfe1337f810f391afb00be1d0523dd00e178b19b5)
91+
[comment]: # ( SHA256STAMP:12f64927a9aa380083c5e573272e7b13b98a7e628375cd5a785c245d566949ba)

doc/lightning-openchannel_init.7.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ On success, an object is returned, containing:
6969
7070
- **channel\_id** (hex): the channel id of the channel (always 64 characters)
7171
- **psbt** (string): the (incomplete) PSBT of the funding transaction
72+
- **channel\_type** (object): channel\_type as negotiated with peer *(added v24.02)*:
73+
- **bits** (array of u32s): Each bit set in this channel\_type *(added v24.02)*:
74+
- Bit number
75+
- **names** (array of strings): Feature name for each bit set in this channel\_type *(added v24.02)*:
76+
- Name of feature bit (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even")
7277
- **commitments\_secured** (boolean): whether the *psbt* is complete (always *false*)
7378
- **funding\_serial** (u64): the serial\_id of the funding output in the *psbt*
7479
- **requires\_confirmed\_inputs** (boolean, optional): Does peer require confirmed inputs in psbt?
@@ -119,4 +124,4 @@ RESOURCES
119124
120125
Main web site: <https://github.com/ElementsProject/lightning>
121126
122-
[comment]: # ( SHA256STAMP:40121e2e7b0db8c99de12b4fd086f58f63e0d6643b9da1c1697a34dd5057454e)
127+
[comment]: # ( SHA256STAMP:f8abbafd1893590e69c88c07d34bfc5de8495f981b583149b59b3dcc2b581ffe)

doc/lightning-openchannel_update.7.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ RETURN VALUE
3232
On success, an object is returned, containing:
3333

3434
- **channel\_id** (hex): the channel id of the channel (always 64 characters)
35+
- **channel\_type** (object): channel\_type as negotiated with peer *(added v24.02)*:
36+
- **bits** (array of u32s): Each bit set in this channel\_type *(added v24.02)*:
37+
- Bit number
38+
- **names** (array of strings): Feature name for each bit set in this channel\_type *(added v24.02)*:
39+
- Name of feature bit (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even")
3540
- **psbt** (string): the PSBT of the funding transaction
3641
- **commitments\_secured** (boolean): whether the *psbt* is complete (if true, sign *psbt* and call `openchannel_signed` to complete the channel open)
3742
- **funding\_outnum** (u32): The index of the funding output in the psbt
@@ -77,4 +82,4 @@ RESOURCES
7782

7883
Main web site: <https://github.com/ElementsProject/lightning>
7984

80-
[comment]: # ( SHA256STAMP:8916c7600248fc14275508962f9ea09c55d43157f525a4bbe385b621074384e6)
85+
[comment]: # ( SHA256STAMP:c4e466356d4cd783c185e36b9854b554ef3f5357a89cea751381f3f47d45db2a)

doc/schemas/fundchannel.schema.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"tx",
77
"txid",
88
"outnum",
9+
"channel_type",
910
"channel_id"
1011
],
1112
"properties": {
@@ -27,6 +28,43 @@
2728
"minLength": 64,
2829
"maxLength": 64
2930
},
31+
"channel_type": {
32+
"type": "object",
33+
"description": "channel_type as negotiated with peer",
34+
"added": "v24.02",
35+
"additionalProperties": false,
36+
"required": [
37+
"bits",
38+
"names"
39+
],
40+
"properties": {
41+
"bits": {
42+
"type": "array",
43+
"description": "Each bit set in this channel_type",
44+
"added": "v24.02",
45+
"items": {
46+
"type": "u32",
47+
"description": "Bit number"
48+
}
49+
},
50+
"names": {
51+
"type": "array",
52+
"description": "Feature name for each bit set in this channel_type",
53+
"added": "v24.02",
54+
"items": {
55+
"type": "string",
56+
"enum": [
57+
"static_remotekey/even",
58+
"anchor_outputs/even",
59+
"anchors_zero_fee_htlc_tx/even",
60+
"scid_alias/even",
61+
"zeroconf/even"
62+
],
63+
"description": "Name of feature bit"
64+
}
65+
}
66+
}
67+
},
3068
"close_to": {
3169
"type": "hex",
3270
"description": "The raw scriptPubkey which mutual close will go to; only present if *close_to* parameter was specified and peer supports `option_upfront_shutdown_script`"

doc/schemas/fundchannel_start.schema.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"required": [
66
"funding_address",
77
"scriptpubkey",
8+
"channel_type",
89
"warning_usage"
910
],
1011
"properties": {
@@ -16,6 +17,43 @@
1617
"type": "hex",
1718
"description": "The raw scriptPubkey for the address"
1819
},
20+
"channel_type": {
21+
"type": "object",
22+
"description": "channel_type as negotiated with peer",
23+
"added": "v24.02",
24+
"additionalProperties": false,
25+
"required": [
26+
"bits",
27+
"names"
28+
],
29+
"properties": {
30+
"bits": {
31+
"type": "array",
32+
"added": "v24.02",
33+
"description": "Each bit set in this channel_type",
34+
"items": {
35+
"type": "u32",
36+
"description": "Bit number"
37+
}
38+
},
39+
"names": {
40+
"type": "array",
41+
"description": "Feature name for each bit set in this channel_type",
42+
"added": "v24.02",
43+
"items": {
44+
"type": "string",
45+
"enum": [
46+
"static_remotekey/even",
47+
"anchor_outputs/even",
48+
"anchors_zero_fee_htlc_tx/even",
49+
"scid_alias/even",
50+
"zeroconf/even"
51+
],
52+
"description": "Name of feature bit"
53+
}
54+
}
55+
}
56+
},
1957
"close_to": {
2058
"type": "hex",
2159
"description": "The raw scriptPubkey which mutual close will go to; only present if *close_to* parameter was specified and peer supports `option_upfront_shutdown_script`"

doc/schemas/multifundchannel.schema.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"required": [
2525
"id",
2626
"channel_id",
27+
"channel_type",
2728
"outnum"
2829
],
2930
"properties": {
@@ -41,6 +42,43 @@
4142
"minLength": 64,
4243
"maxLength": 64
4344
},
45+
"channel_type": {
46+
"type": "object",
47+
"description": "channel_type as negotiated with peer",
48+
"added": "v24.02",
49+
"additionalProperties": false,
50+
"required": [
51+
"bits",
52+
"names"
53+
],
54+
"properties": {
55+
"bits": {
56+
"type": "array",
57+
"description": "Each bit set in this channel_type",
58+
"added": "v24.02",
59+
"items": {
60+
"type": "u32",
61+
"description": "Bit number"
62+
}
63+
},
64+
"names": {
65+
"type": "array",
66+
"description": "Feature name for each bit set in this channel_type",
67+
"added": "v24.02",
68+
"items": {
69+
"type": "string",
70+
"enum": [
71+
"static_remotekey/even",
72+
"anchor_outputs/even",
73+
"anchors_zero_fee_htlc_tx/even",
74+
"scid_alias/even",
75+
"zeroconf/even"
76+
],
77+
"description": "Name of feature bit"
78+
}
79+
}
80+
}
81+
},
4482
"close_to": {
4583
"type": "hex",
4684
"description": "The raw scriptPubkey which mutual close will go to; only present if *close_to* parameter was specified and peer supports `option_upfront_shutdown_script`"

doc/schemas/openchannel_bump.schema.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"additionalProperties": false,
55
"required": [
66
"channel_id",
7+
"channel_type",
78
"psbt",
89
"commitments_secured",
910
"funding_serial"
@@ -15,6 +16,43 @@
1516
"maxLength": 64,
1617
"minLength": 64
1718
},
19+
"channel_type": {
20+
"type": "object",
21+
"description": "channel_type as negotiated with peer",
22+
"added": "v24.02",
23+
"additionalProperties": false,
24+
"required": [
25+
"bits",
26+
"names"
27+
],
28+
"properties": {
29+
"bits": {
30+
"type": "array",
31+
"description": "Each bit set in this channel_type",
32+
"added": "v24.02",
33+
"items": {
34+
"type": "u32",
35+
"description": "Bit number"
36+
}
37+
},
38+
"names": {
39+
"type": "array",
40+
"description": "Feature name for each bit set in this channel_type",
41+
"added": "v24.02",
42+
"items": {
43+
"type": "string",
44+
"enum": [
45+
"static_remotekey/even",
46+
"anchor_outputs/even",
47+
"anchors_zero_fee_htlc_tx/even",
48+
"scid_alias/even",
49+
"zeroconf/even"
50+
],
51+
"description": "Name of feature bit"
52+
}
53+
}
54+
}
55+
},
1856
"psbt": {
1957
"type": "string",
2058
"description": "the (incomplete) PSBT of the RBF transaction"

doc/schemas/openchannel_init.schema.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"required": [
66
"channel_id",
77
"psbt",
8+
"channel_type",
89
"commitments_secured",
910
"funding_serial"
1011
],
@@ -19,6 +20,43 @@
1920
"type": "string",
2021
"description": "the (incomplete) PSBT of the funding transaction"
2122
},
23+
"channel_type": {
24+
"type": "object",
25+
"description": "channel_type as negotiated with peer",
26+
"added": "v24.02",
27+
"additionalProperties": false,
28+
"required": [
29+
"bits",
30+
"names"
31+
],
32+
"properties": {
33+
"bits": {
34+
"type": "array",
35+
"description": "Each bit set in this channel_type",
36+
"added": "v24.02",
37+
"items": {
38+
"type": "u32",
39+
"description": "Bit number"
40+
}
41+
},
42+
"names": {
43+
"type": "array",
44+
"description": "Feature name for each bit set in this channel_type",
45+
"added": "v24.02",
46+
"items": {
47+
"type": "string",
48+
"enum": [
49+
"static_remotekey/even",
50+
"anchor_outputs/even",
51+
"anchors_zero_fee_htlc_tx/even",
52+
"scid_alias/even",
53+
"zeroconf/even"
54+
],
55+
"description": "Name of feature bit"
56+
}
57+
}
58+
}
59+
},
2260
"commitments_secured": {
2361
"type": "boolean",
2462
"enum": [

0 commit comments

Comments
 (0)