Skip to content

Commit 9e0a0e8

Browse files
Roasbeefrustyrussell
authored andcommitted
BOLT 02: add a chain-hash field to the open_channel msg (#135)
This commit adds a `chain-hash` field to message that commences a funding workflow. This field is used to specify a _target_ chain for the proposed channel. In order to uniquely identity blockchains in a manner that doesn't require strict coordination between developers, the genesis hash of the target chain is used. For channels opened on the Bitcoin blockchain, the `chain-hash` field should _always_ be set to: 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f. Introducing this new field _immediately_ allows nodes within the network to open a channel within any Satoshi-derived blockchain. Nodes can have channels open across different blockchains globally, but also have many channels open across distinct blockchains with the same peer.
1 parent 351ea92 commit 9e0a0e8

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

02-peer-protocol.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ desire to set up a new channel.
8383

8484
1. type: 32 (`open_channel`)
8585
2. data:
86+
* [32:chain-hash]
8687
* [32:temporary-channel-id]
8788
* [8:funding-satoshis]
8889
* [8:push-msat]
@@ -100,6 +101,12 @@ desire to set up a new channel.
100101
* [33:first-per-commitment-point]
101102

102103

104+
The chain-hash value denotes the exact blockchain the opened channel will
105+
reside within. This is usually the genesis hash of the respective blockchain.
106+
The existence of the chain-hash allows nodes to open channel
107+
across many distinct blockchains as well as have channels within multiple
108+
blockchains opened to the same peer (if they support the target chains).
109+
103110
The `temporary-channel-id` is used to identify this channel until the funding transaction is established. `funding-satoshis` is the amount the sender is putting into the channel. `dust-limit-satoshis` is the threshold below which output should be generated for this node's commitment or HTLC transaction; ie. HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain. This reflects the reality that tiny outputs are not considered standard transactions and will not propagate through the Bitcoin network.
104111

105112
`max-htlc-value-in-inflight-msat` is a cap on total value of outstanding HTLCs, which allows a node to limit its exposure to HTLCs; similarly `max-accepted-htlcs` limits the number of outstanding HTLCs the other node can offer. `channel-reserve-satoshis` is the minimum amount that the other node is to keep as a direct payment. `htlc-minimum-msat` indicates the smallest value HTLC this node will accept.
@@ -113,6 +120,10 @@ FIXME: Describe Dangerous feature bit for larger channel amounts.
113120

114121
#### Requirements
115122

123+
A sending node MUST ensure that the chain-hash value identifies the chain they
124+
they wish to open the channel within. For the Bitcoin blockchain, the
125+
chain-hash value MUST be (encoded in hex):
126+
`000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f`.
116127

117128
A sending node MUST ensure `temporary-channel-id` is unique from any other
118129
channel id with the same peer. The sender MUST set `funding-satoshis`
@@ -198,6 +209,9 @@ acceptance of the new channel.
198209
#### Requirements
199210

200211

212+
The receiving MUST reject the channel if the `chain-hash` value within the
213+
`open_channel` message is set to a hash of a chain unknown to the receiver.
214+
201215
The `temporary-channel-id` MUST be the same as the `temporary-channel-id` in the `open_channel` message. The sender SHOULD set `minimum-depth` to a number of blocks it considers reasonable to avoid double-spending of the funding transaction.
202216

203217
The receiver MAY reject the `minimum-depth` if it considers it unreasonably large.

0 commit comments

Comments
 (0)