Skip to content

Commit

Permalink
fundchannel_start & multifundchannel: add channel_type.
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
rustyrussell committed Dec 13, 2023
1 parent a39b1b3 commit ba016fe
Show file tree
Hide file tree
Showing 19 changed files with 362 additions and 116 deletions.
7 changes: 6 additions & 1 deletion doc/lightning-fundchannel.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ On success, an object is returned, containing:
- **txid** (txid): The txid of the transaction which funded the channel
- **outnum** (u32): The 0-based output index showing which output funded the channel
- **channel\_id** (hex): The channel\_id of the resulting channel (always 64 characters)
- **channel\_type** (object): channel\_type as negotiated with peer *(added v24.02)*:
- **bits** (array of u32s): Each bit set in this channel\_type *(added v24.02)*:
- Bit number
- **names** (array of strings): Feature name for each bit set in this channel\_type *(added v24.02)*:
- Name of feature bit (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even")
- **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`
- **mindepth** (u32, optional): Number of confirmations before we consider the channel active.

Expand Down Expand Up @@ -135,4 +140,4 @@ RESOURCES

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

[comment]: # ( SHA256STAMP:a8329cdb3f13f5bd0047824bed82c2e10516af2735dc59aa2cd71e4cc4f0250a)
[comment]: # ( SHA256STAMP:2a9b49a923bd6dce39823b245338f86a9ffcd3c4a3b8fc407f4dab91366bd317)
7 changes: 6 additions & 1 deletion doc/lightning-fundchannel_start.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ On success, an object is returned, containing:

- **funding\_address** (string): The address to send funding to for the channel. DO NOT SEND COINS TO THIS ADDRESS YET.
- **scriptpubkey** (hex): The raw scriptPubkey for the address
- **channel\_type** (object): channel\_type as negotiated with peer *(added v24.02)*:
- **bits** (array of u32s): Each bit set in this channel\_type *(added v24.02)*:
- Bit number
- **names** (array of strings): Feature name for each bit set in this channel\_type *(added v24.02)*:
- Name of feature bit (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even")
- **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`
- **mindepth** (u32, optional): Number of confirmations before we consider the channel active.

Expand Down Expand Up @@ -102,4 +107,4 @@ RESOURCES

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

[comment]: # ( SHA256STAMP:ed685f91a9242a38a2d48b82ed7ba063a1a4d754d95283ad232cbe7d12471659)
[comment]: # ( SHA256STAMP:4052f73b3eb8091a313aa6eefa66fa4df8e3cd73678fe72260272c3802a768b6)
7 changes: 6 additions & 1 deletion doc/lightning-multifundchannel.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ On success, an object is returned, containing:
- **id** (pubkey): The peer we opened the channel with
- **outnum** (u32): The 0-based output index showing which output funded the channel
- **channel\_id** (hex): The channel\_id of the resulting channel (always 64 characters)
- **channel\_type** (object): channel\_type as negotiated with peer *(added v24.02)*:
- **bits** (array of u32s): Each bit set in this channel\_type *(added v24.02)*:
- Bit number
- **names** (array of strings): Feature name for each bit set in this channel\_type *(added v24.02)*:
- Name of feature bit (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even")
- **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`
- **failed** (array of objects, optional): any peers we failed to open with (if *minchannels* was specified less than the number of destinations):
- **id** (pubkey): The peer we failed to open the channel with
Expand Down Expand Up @@ -209,4 +214,4 @@ RESOURCES
Main web site: <https://github.com/ElementsProject/lightning>
[comment]: # ( SHA256STAMP:9922effdfb4bcd5ab95057fb0c043f0597446f4da4e7d5033520a3138ffc8ff8)
[comment]: # ( SHA256STAMP:2a1903512adf241247ba2540d376a2ee86fe2189c272e10849b4ca1881bf997d)
7 changes: 6 additions & 1 deletion doc/lightning-openchannel_bump.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ RETURN VALUE
On success, an object is returned, containing:

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

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

[comment]: # ( SHA256STAMP:b70ef93977f0316da57fcecdfe1337f810f391afb00be1d0523dd00e178b19b5)
[comment]: # ( SHA256STAMP:12f64927a9aa380083c5e573272e7b13b98a7e628375cd5a785c245d566949ba)
7 changes: 6 additions & 1 deletion doc/lightning-openchannel_init.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ On success, an object is returned, containing:
- **channel\_id** (hex): the channel id of the channel (always 64 characters)
- **psbt** (string): the (incomplete) PSBT of the funding transaction
- **channel\_type** (object): channel\_type as negotiated with peer *(added v24.02)*:
- **bits** (array of u32s): Each bit set in this channel\_type *(added v24.02)*:
- Bit number
- **names** (array of strings): Feature name for each bit set in this channel\_type *(added v24.02)*:
- Name of feature bit (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even")
- **commitments\_secured** (boolean): whether the *psbt* is complete (always *false*)
- **funding\_serial** (u64): the serial\_id of the funding output in the *psbt*
- **requires\_confirmed\_inputs** (boolean, optional): Does peer require confirmed inputs in psbt?
Expand Down Expand Up @@ -119,4 +124,4 @@ RESOURCES
Main web site: <https://github.com/ElementsProject/lightning>
[comment]: # ( SHA256STAMP:40121e2e7b0db8c99de12b4fd086f58f63e0d6643b9da1c1697a34dd5057454e)
[comment]: # ( SHA256STAMP:f8abbafd1893590e69c88c07d34bfc5de8495f981b583149b59b3dcc2b581ffe)
7 changes: 6 additions & 1 deletion doc/lightning-openchannel_update.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ RETURN VALUE
On success, an object is returned, containing:

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

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

[comment]: # ( SHA256STAMP:8916c7600248fc14275508962f9ea09c55d43157f525a4bbe385b621074384e6)
[comment]: # ( SHA256STAMP:c4e466356d4cd783c185e36b9854b554ef3f5357a89cea751381f3f47d45db2a)
38 changes: 38 additions & 0 deletions doc/schemas/fundchannel.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"tx",
"txid",
"outnum",
"channel_type",
"channel_id"
],
"properties": {
Expand All @@ -27,6 +28,43 @@
"minLength": 64,
"maxLength": 64
},
"channel_type": {
"type": "object",
"description": "channel_type as negotiated with peer",
"added": "v24.02",
"additionalProperties": false,
"required": [
"bits",
"names"
],
"properties": {
"bits": {
"type": "array",
"description": "Each bit set in this channel_type",
"added": "v24.02",
"items": {
"type": "u32",
"description": "Bit number"
}
},
"names": {
"type": "array",
"description": "Feature name for each bit set in this channel_type",
"added": "v24.02",
"items": {
"type": "string",
"enum": [
"static_remotekey/even",
"anchor_outputs/even",
"anchors_zero_fee_htlc_tx/even",
"scid_alias/even",
"zeroconf/even"
],
"description": "Name of feature bit"
}
}
}
},
"close_to": {
"type": "hex",
"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`"
Expand Down
38 changes: 38 additions & 0 deletions doc/schemas/fundchannel_start.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"required": [
"funding_address",
"scriptpubkey",
"channel_type",
"warning_usage"
],
"properties": {
Expand All @@ -16,6 +17,43 @@
"type": "hex",
"description": "The raw scriptPubkey for the address"
},
"channel_type": {
"type": "object",
"description": "channel_type as negotiated with peer",
"added": "v24.02",
"additionalProperties": false,
"required": [
"bits",
"names"
],
"properties": {
"bits": {
"type": "array",
"added": "v24.02",
"description": "Each bit set in this channel_type",
"items": {
"type": "u32",
"description": "Bit number"
}
},
"names": {
"type": "array",
"description": "Feature name for each bit set in this channel_type",
"added": "v24.02",
"items": {
"type": "string",
"enum": [
"static_remotekey/even",
"anchor_outputs/even",
"anchors_zero_fee_htlc_tx/even",
"scid_alias/even",
"zeroconf/even"
],
"description": "Name of feature bit"
}
}
}
},
"close_to": {
"type": "hex",
"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`"
Expand Down
38 changes: 38 additions & 0 deletions doc/schemas/multifundchannel.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"required": [
"id",
"channel_id",
"channel_type",
"outnum"
],
"properties": {
Expand All @@ -41,6 +42,43 @@
"minLength": 64,
"maxLength": 64
},
"channel_type": {
"type": "object",
"description": "channel_type as negotiated with peer",
"added": "v24.02",
"additionalProperties": false,
"required": [
"bits",
"names"
],
"properties": {
"bits": {
"type": "array",
"description": "Each bit set in this channel_type",
"added": "v24.02",
"items": {
"type": "u32",
"description": "Bit number"
}
},
"names": {
"type": "array",
"description": "Feature name for each bit set in this channel_type",
"added": "v24.02",
"items": {
"type": "string",
"enum": [
"static_remotekey/even",
"anchor_outputs/even",
"anchors_zero_fee_htlc_tx/even",
"scid_alias/even",
"zeroconf/even"
],
"description": "Name of feature bit"
}
}
}
},
"close_to": {
"type": "hex",
"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`"
Expand Down
38 changes: 38 additions & 0 deletions doc/schemas/openchannel_bump.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"additionalProperties": false,
"required": [
"channel_id",
"channel_type",
"psbt",
"commitments_secured",
"funding_serial"
Expand All @@ -15,6 +16,43 @@
"maxLength": 64,
"minLength": 64
},
"channel_type": {
"type": "object",
"description": "channel_type as negotiated with peer",
"added": "v24.02",
"additionalProperties": false,
"required": [
"bits",
"names"
],
"properties": {
"bits": {
"type": "array",
"description": "Each bit set in this channel_type",
"added": "v24.02",
"items": {
"type": "u32",
"description": "Bit number"
}
},
"names": {
"type": "array",
"description": "Feature name for each bit set in this channel_type",
"added": "v24.02",
"items": {
"type": "string",
"enum": [
"static_remotekey/even",
"anchor_outputs/even",
"anchors_zero_fee_htlc_tx/even",
"scid_alias/even",
"zeroconf/even"
],
"description": "Name of feature bit"
}
}
}
},
"psbt": {
"type": "string",
"description": "the (incomplete) PSBT of the RBF transaction"
Expand Down
38 changes: 38 additions & 0 deletions doc/schemas/openchannel_init.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"required": [
"channel_id",
"psbt",
"channel_type",
"commitments_secured",
"funding_serial"
],
Expand All @@ -19,6 +20,43 @@
"type": "string",
"description": "the (incomplete) PSBT of the funding transaction"
},
"channel_type": {
"type": "object",
"description": "channel_type as negotiated with peer",
"added": "v24.02",
"additionalProperties": false,
"required": [
"bits",
"names"
],
"properties": {
"bits": {
"type": "array",
"description": "Each bit set in this channel_type",
"added": "v24.02",
"items": {
"type": "u32",
"description": "Bit number"
}
},
"names": {
"type": "array",
"description": "Feature name for each bit set in this channel_type",
"added": "v24.02",
"items": {
"type": "string",
"enum": [
"static_remotekey/even",
"anchor_outputs/even",
"anchors_zero_fee_htlc_tx/even",
"scid_alias/even",
"zeroconf/even"
],
"description": "Name of feature bit"
}
}
}
},
"commitments_secured": {
"type": "boolean",
"enum": [
Expand Down
Loading

0 comments on commit ba016fe

Please sign in to comment.