1
0
mirror of https://github.com/lightning/bolts.git synced 2024-11-19 10:00:04 +01:00
Commit Graph

141 Commits

Author SHA1 Message Date
Rusty Russell
41790a9cd7 BOLT 2: add suggestion to retransmit errors, and rationale section.
Moves it together with the similarly-reasoned `closing_signed`
retransmission.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-05-18 09:49:19 +09:30
Olaoluwa Osuntokun
3a359c8e1e BOLT 2: correct sat/Kb to sat/Kw conversion to avoid over paying (#176)
This commit fixes an advisory error in the current spec draft. We
currently use `fee-per-kw` where `kw = 1000` weight to determine the
proper fee to pay for commitment transactions. Currently, the spec
advises implementer to take the typical sat/Kb at _multiply_ by 4. This
will result in implementations overpaying for commitment transactions
as the scaling should actually be in the _opposite_ direction. As the
weight is scaled up by 4, for fee-per-kw should be scaled down by 4.
So: sat/Kb * 1/4, instead of sat/Kb * 4.

[Minor fixup: "1/4th" to "1/4", better english, and doesn't trip spellcheck. -- RR]
2017-05-18 09:48:29 +09:30
Rusty Russell
f0da3978e9 Underscores for all terms, not just fields.
Plus a few more missing ones, and some consistency fixes in names
as pointed out by Roasbeed and Fabrice.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-05-15 12:54:53 -07:00
Rusty Russell
43b0b1c284 BOLT 2: sha256-of-onion -> sha256_of_onion in descriptions.
Missed this replacement.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-05-15 12:54:53 -07:00
Rusty Russell
44fe02edbf BOLT 2: underscores and backticks everywhere.
Many old fieldnames fixed up:
1. funding_amount -> funding_satoshis
2. max_htlc_value_in_flight -> max_htlc_value_in_flight_msat
3. update_commit -> commitment_signed
4. route -> onion_routing_packet

Typo fixes:
1. fee_rate -> feerate_per_kw
2. amount_sat -> amount_msat
3. script_pubkey -> scriptpubkey

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-05-11 11:20:36 +09:30
ZmnSCPxj
77c9272ed6 02-peer-protocol.md: Minor typo: update_htlc_add, verb should come first 2017-05-09 16:27:36 +09:30
Rusty Russell
8bc2304705 BOLT 2: remove requirement for missing field.
minimum-depth is no longer in the opening message.

Closes: #157
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-05-09 16:26:52 +09:30
EmelyanenkoK
85f4365c47 Fix typo
max-htlc-value-in-flight-msat had two different designations
2017-05-03 13:10:27 +09:30
Rusty Russell
c3b078bad2 BOLT 2: typo fixes.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-05-03 13:08:07 +09:30
Rusty Russell
8b29062f78 BOLT 4: Simplify onion format.
1. Only one per-hop thing, called `per-hop`, or `hops_data` when in aggregate.
2. Move HMAC to the end of stuff it covers, both of the packet itself, and the per-hop.
3. Use `channel-id` instead of RIPEMD(nodepubkey).
4. Use 4 byte amounts.
5. This is all for realm "0", we can have future realms.  We also have 16
   bytes of unused padding.
6. No longer need the `gamma` key, but document the `_um_` key used for
   errors.
7. Use normal 32-byte HMAC, not truncated 20-bytes, which more than eats
   up the room we saved.

The result is that the onion is now 1366 not 1254 bytes, but simpler.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-04-26 09:59:30 +09:30
Rusty Russell
809ad65ea0 BOLT 2: fix dangling sentence.
`channel-id` which identifies , which is derived
=>
	`channel-id` to identify the channel, which is derived

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-04-08 08:17:20 +09:30
Rusty Russell
9d29e98eec BOLT 2: htlc-cltv must be in blocks.
ie. < 500 million.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-03-30 12:04:20 +10:30
Rusty Russell
a39b236e80 BOLT 2: require that we don't fulfill close to timeout either.
It was never mentioned, but fulfilling a timedout HTLC means a race
between timing out and fulfilling, which is bad.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-03-24 12:10:24 +10:30
Olaoluwa Osuntokun
9e0a0e893d 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.
2017-03-24 12:09:41 +10:30
Clark
351ea92a6b Fix typo
Instead of "ensure the blockchain," it should be "enter the blockchain"
2017-03-22 20:08:04 +01:00
Rusty Russell
41f400a378 BOLT 2: simplify shutdown constraints.
As per discussion in #115, we now allow `shutdown` immediately following
`commitment_signed`.

This means that revoke-and-ack doesn't *always* ack the shutdown.  Rather
than specify that a revoke-and-ack which is caused by an update-commit
following the shutdown acknowledges, we leave this unacknowledged until
we actually start closing.

This means we will retransmit it on every reconnect until then.  But
that's not all that wasteful, and fairly robust.

Suggested-by: Pierre-Marie Padiou <pm.padiou@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-03-22 11:38:04 +10:30
Rusty Russell
b18322e06e BOLT 2: change dust limit for closing to each use their own.
Using the receiver's dust limit implies a naive node can be fooled
(by a peer with massive dust limit) into not getting its own output.

Using our own opens the possibility of creating different transactions,
so we explicitly allow the tractable case, while accepting failure on
the case where disagreement is real.

Closes: #128
Reported-by: Pierre-Marie Padiou
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-03-22 11:37:39 +10:30
Rusty Russell
9a572ff0a3 BOLT 2: fix remaining commit_sig references.
Left over from 00a8e97a68, which purported
to change commit_sig -> commitment_signed.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-03-21 10:28:18 +01:00
Pierre-Marie Padiou
373de09154 revoke_and_ack is acknowledged by closing_signed 2017-03-10 09:58:13 +10:30
Rusty Russell
0d7cf77970 BOLT 2: reduce HTLC maximum limit based on new penalty calculations.
We can no longer allow 511 each way; reduce it to match our calculations
so we can always create a single standard penalty transaction.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-03-08 05:50:44 +10:30
pm47
557db43378 make htlc outputs of the commitment tx spendable with revocation key
(Merge conflict in test vectors fixed by selecting Pierre's, will have to
 be re-evaluated).

Closes: #105
2017-03-07 09:21:40 +10:30
Rusty Russell
034c234829 BOLT 2,3: SHOULD NOT create malleable funding tx.
But note that our funding transaction example is.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-03-07 06:39:28 +10:30
Rusty Russell
4af8e18411 BOLT 0,1,2,7: use txout not channel-id for demuxing. (#119)
At cost of a few extra bytes between peers, this avoids the whole "oops, we were on a chain fork" problem, and simplifies generation of temporary channel-ids (just pick a random one).

Now we move the announcement_signature exchange to at least 6 confirms, which makes re-xmit tricky; I resolved that by insisting on reconnect that we send if we haven't received, and reply to the first one.

The term "channel shortid" wasn't used anywhere, so I removed it; it's now a gossip-only thing anyway.

One subtle change: pkt_error on unknown channels is now "MUST ignore"; this section was reworked anyway, and we'll want this if the #120 goes through, where one side might have forgotten unformed channels).

Closes: #114
Suggested-by: Olaoluwa Osuntokun <laolu32@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

* FIXUP! Two bytes for funding-output-index.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

* FIXUP! Channel-id rework, temp ids, 32 bits only.

Re-add the idea of temporary channel ids: far simpler since they're now
big enough we can just fill with noise.

Remove the alignment issues by combining txid and outnum using XOR; we
could reduce to 128 bit if we really wanted to, but we don't.

Error handling is now simple again, but while editing I changed the
behaviour for unknown channels to MUST ignore (this is important for

Change the 8-byte gossip channel id to `short-channel-id`.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

* FIXUP!  Minor text tweaks from Pierre-Marie and Christian

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-03-02 14:50:13 +10:30
Pierre-Marie Padiou
03a917fa6b revoke_and_ack is not acked by update messages 2017-02-20 12:05:29 +10:30
Rusty Russell
f63d89c207 BOLT 2: document requirements of max-htlc-value-in-flight-msat
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-02-16 11:30:17 +01:00
pm47
0958747fe0 BOLT 2: added requirements on htlc forwarding 2017-02-16 10:07:51 +10:30
Otto Allmendinger
5114f58b0e BOLT 02: fix state listing in "Normal Operation"
Markdown wants a newline there.
2017-02-14 09:06:53 +10:30
Otto Allmendinger
560439ddf8 BOLT 02: change "responser" to "responder" 2017-02-14 09:06:53 +10:30
Otto Allmendinger
c977e7ea18 BOLT 02: Remove reference to nonexistent field
Field was removed from the message in commit b228a2e, but it's still
referenced in the description.
2017-02-14 09:06:53 +10:30
Rusty Russell
c5b0bfb620 BOLT 2: specify requirement not to send fulfill until both sides locked in.
Otherwise you can lose funds!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-02-13 06:30:48 +10:30
Christian Decker
4e3ad54a90 BOLT 2&7: Cleaner separation of concerns wrt announcement signatures (#97)
* BOLT 2&7: Cleaner separation of concerns wrt announcement signatures

So far we did not have any indication on what to do if a node does not
allow announcing the channel and we had a mix of concerns in the
`funding_locked` message, which would also transfer the signatures
needed for the announcement. This is a proposal about splitting the
signatures into their own message, so that simple omission is an
opt-out of announcements, and it does not mix announcement/gossip
stuff into the peer-protocol.

(It also ended up adding a localfeatures flag to opt-into the channel-announcement, and thus creating BOLT 9)
2017-02-07 11:23:39 +10:30
Pierre-Marie Padiou
240f914cde BOLT 2: fixed broken table of contents 2017-02-01 13:52:52 +01:00
Pierre-Marie Padiou
74c9fa7493 replaced payment-key by payment-hash 2017-02-01 20:46:38 +10:30
Rusty Russell
40b747806e BOLT 2, BOLT 5: restrict to ASCII characters.
’ -> '

LANG=C python3 complains otherwise.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-01-25 10:40:10 +10:30
Rusty Russell
9308eb145a BOLT 2: clarify comment about reversing uncommitted changes on reconnect, and timeouts.
Olaoluwa pointed out that peers can make work for us by starting to open
connections then disconnecting: we need to allow timeouts, since it's
the simplest solution.

The comment about remembering `r` values (ie. `payment-preimage`) from
update_fulfill_htlc was also vague: it was meant to simply note that
it's not completely reversible, since the knowledge is (and probably
should be!) used to fulfill an incoming HTLC.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-01-24 06:51:06 +10:30
Rusty Russell
614af24071 BOLT 2: Message retransmission and reconnect semantics.
1) Make it clear that `init` needs to be sent every time.
   - This means if you upgrade and no longer support an old connection, it's
     clear, plus it simplifies the question of re-transmission of `init`.
2) Spell out the retransmission requirements for reconnection.
   - We agreed in Milan to simply use retransmit and ignore-dups.
   - This needs actual testing by implementations, but this is my best guess
     on exactly how far back to retransmit.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-01-24 06:51:06 +10:30
Rusty Russell
fddc992b2d BOLT 2, BOLT 3: fee-per-kw kilo == 1000, not 1024.
I checked the bitcoin source to be sure, too.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-01-22 16:17:30 -08:00
Rusty Russell
c93bf5cf8c BOLT 4: make format of failure codes the same as normal messages.
This reduces failure codes to 2 bytes, places them into data itself.

Now we can use the same parsing code for them as we use for normal packets.

BOLT 2 is adjusted to match, and order of args changed to restore sha256
alignment to a nice 8 bytes.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-01-16 12:37:31 -08:00
Rusty Russell
62b5eedb4a BOLT 2: allow more leniancy with forks during channel establishment. (#77)
* BOLT 2: allow more leniancy with forks during channel establishment.

Christoper points out that two nodes with aggressive minimum-depth settings
may see different blocks and the protocol requires they close the channel
since their funding_locked messages will disagree.

This can also happen when only one side has an aggressive minimum-depth
setting: if it sends funding_locked referring to a block which is orphaned,
it can't update it.

There are three changes here, two optional.
- Allow sending of an updated funding_locked.  This fixes this case where
  one side is on an orphan and uses a v. low minimum-depth.
- Require accepting of an updated funding_locked.
- Allow waiting instead of immediate failure if funding_lock disagrees.
  eg. you might wait another block or two to see if one side reorgs.

Reported-by: Christopher Jämthagen
Closes: #73
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-01-13 11:39:39 +10:30
Rusty Russell
467429249f BOLT 2: fix duplicate numbers.
revoke-and-ack is already 133.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-01-06 13:22:39 +10:30
Rusty Russell
d57b33d3c3 BOLT #2: allow different handling of update_fail_malformed_htlc if SHA wrong.
Suggested-by: Olaoluwa Osuntokun <laolu32@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-01-06 10:01:09 +10:30
Rusty Russell
c7cca57e32 BOLT 2: add another method of failing HTLCs.
If we get sent junk (or unknown version), we can't encrypt the
failure.  Currently that's only if the onion version is non-zero, or
the ephemeral key is malformed.

We do check the BADONION bit so the origin can tell that we're
reporting it on the next peer's behalf, in case that ever matters.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>


Header from folded patch 'fix__feedback_from_roasbeef.patch':

FIX: Feedback from roasbeef.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-01-06 10:01:09 +10:30
Rusty Russell
ab2c5bf3c9 BOLT 2, BOLT 4: error response is not fixed-length.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-01-06 10:01:09 +10:30
Rusty Russell
0c4a8ae6b8 BOLT 2, BOLT 7: rename expiry to cltv-expiry / cltv-expiry-delta.
I can't remember who suggested this, but it's a good idea!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-01-06 10:01:09 +10:30
pm47
2c4cd03b4c added a section about who pays the fee 2017-01-04 15:55:41 +10:30
Rusty Russell
00a8e97a68 BOLT 1: recommend full tx in error pkt if signature fails. (#65)
* BOLT 1: recommend full tx in error pkt if signature fails.

This will usually be the commitment tx, but could also be the HTLC
tx.

Reported-by: pm47 <pm.padiou@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

* FIX: Feedback

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

* BOLT 1: tighten error message `len` requirement.

Of course it has to match data length exactly.

Reported-by: pm47 <pm.padiou@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

* BOLT 1, BOLT 2, BOLT 5: commitsig -> commitment_signed.

Consistency FTW.

Reported-by: pm47 <pm.padiou@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-12-21 11:37:47 +01:00
Pierre-Marie Padiou
eebbd617bd BOLT 2: Specify ordering of htlc-timeout signatures (minor) (#59)
* specify ordering of htlc-timeout signatures
* made commitsig and revoke_and_ack requirements more consistent
2016-12-14 16:18:41 +01:00
pm47
abe0e8c3cc fixed toc inconsistency 2016-12-12 12:05:06 +01:00
Christopher Jämthagen
b0379781a4 Some minor fixes 2016-12-12 10:37:45 +10:30
Christian Decker
336717ea61 trivial: Fixing links in BOLT02. 2016-12-11 11:08:53 +10:30
Christian Decker
a868d1381d onion: Specifying payment-key commitment in onion (#47)
Specifying that the `onion-routing-packet` commits to the
`payment-key` by setting the associated data. This avoids replay
attacks and specifying it here keeps the onion-routing spec clean.
2016-12-09 17:15:44 -08:00
Christopher Jämthagen
d076039df2 Use "Bitcoin" with capital "B" where it is appropriate
pseudo random -> pseudo-random
onchain -> on-chain
2016-12-09 10:50:19 +01:00
pm47
1bb765819e moved update_fee message to 'normal operations' 2016-12-07 11:20:38 +10:30
pm47
248281738b fixed toc 2016-12-06 17:18:25 +01:00
Pierre-Marie Padiou
9bb732f991 Moved msg type description from BOLT#2 to BOLT#1 (#35)
* moved msg type description from BOLT#2 to BOLT#1
* added a ToC
2016-12-06 15:54:10 +01:00
Christopher Jämthagen
9fff656d70 Some spelling and language fixes in BOLTs 0,1,2 2016-12-06 15:30:48 +01:00
Olaoluwa Osuntokun
57235bbd50
BOLT 02: update opening channel establishment paragraph
This commit updates the opening paragraph in the channel establishment
section. The messages referenced are were from the prior iteration of
the funding messages and naming scheme. The section has been updated to
properly reference the latest messages and also to give a bit more
context to the reader to start with.
2016-12-05 12:16:35 -08:00
Rusty Russell
b228a2e77d BOLT 2: remove attempts to align signatures.
They're really a blob of bytes, and we weren't aligning them correctly in
two cases anyway.  This gets rid of gratuitous padding, too.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-11-29 12:58:13 +10:30
Rusty Russell
14e199d823 BOLT 1, BOLT 2, BOLT 5: 2-byte lengths everywhere.
Since our cryptopacket limits us to 2 bytes, and since people will
send 1-message-per-crypto-packet and nobody will test the
multiple-messages-in-one-cryptopacket code, let's just restrict to
64k messages.

1. Make cryptopacket length not include the HMAC, so we can actually send
   64k messages.
2. Remove len prefix from packet, make type 2 bytes, note alignment properties.
3. Change message internal lengths/counts from 4 to 2 bytes, since more
   is nonsensical anyway, and this removes a need to check before allocating:
    - init feature bitfield length
    - error message length
    - shutdown scriptpubkey length
    - commit_sig number of HTLC signatures
    - revoke_and_ack number of HTLC-timeout signatures
4. Change max-accepted-htlcs to two bytes, and limit it to 511 to ensure
   that commit_sig will always be under 64k.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-11-29 10:34:43 +10:30
Rusty Russell
d12f245b4d BOLT 2: clarify what feerate-per-kw stands for and how it's calculated.
Bitcoin still uses feerate-per-kb, which needs to be multiplied by 4
in segwit.  It's more than a little confusing.

Split the paragraphs, too, as it's a little overwhelming.

Reported-by: Olaoluwa Osuntokun <laolu32@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-11-28 13:18:09 +10:30
Rusty Russell
2e0b7266d1 Merge pull request #14 from lightningnetwork/extraction-tools
tools/extract-formats.py: produce structure definitions and check alignment
2016-11-28 11:34:09 +10:30
Rusty Russell
727295e6bb Merge pull request #25 from lightningnetwork/open-first-commitment-point
Adding a first-per-commitment-point field to open_channel
2016-11-25 10:44:18 +10:30
Rusty Russell
be3b72b768 BOLT 2: rename open_channel's max-num-htlcs to max-accepted-htlcs.
This is what it actually is (and how it's documented): you can't control
the total since both sides can add at the same time, you can only tell
the other side how many *it* can add, and control how many you add.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-11-25 10:31:47 +10:30
Pierre-Marie Padiou
a0bc945260 typo 2016-11-24 16:47:33 +01:00
Pierre-Marie Padiou
f8ad90b680 adding first-per-commitment-point to open_channel 2016-11-24 15:40:01 +01:00
Pierre-Marie Padiou
1781d28a97 fix tabs->spaces 2016-11-24 14:35:39 +01:00
Rusty Russell
0dd4583db1 Merge pull request #17 from lightningnetwork/funding-created-single-byte-outindex
BOLT 2: Only single byte for channel-index.
2016-11-24 12:42:36 +10:30
Rusty Russell
bfc392c6f9 Merge pull request #19 from lightningnetwork/fix-funding-locked-announce-sigs
BOLT 2: fix funding_locked announcement signatures.
2016-11-24 12:42:20 +10:30
Christian Decker
4dde8e6a26 Merge pull request #18 from lightningnetwork/license
Add CC-BY.
2016-11-23 15:49:46 +01:00
Rusty Russell
b742d2f73d BOLT 1, BOLT 2, BOLT 7: Remove message enums
The MSG_XXX is trivially derived from the name of the message if
people want to do that, so just change it to the actual message name.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-11-23 11:33:25 +10:30
Rusty Russell
2ea334a17f BOLT 2: fix funding_locked announcement signatures.
We need to supply a pair (a signature using our bitcoin key which signs the
node id, and a signature using our node key which signs the announce message),
and the length was wrong.  Move them to make alignment nicer, too (though
it probably doesn't matter, they're 4-byte aligned everywhere else).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-11-23 11:23:08 +10:30
Rusty Russell
5f5f87d124 Merge pull request #10 from lightningnetwork/feerate
BOLT 02/03: Add fee calculation details.
2016-11-23 06:27:50 +10:30
Rusty Russell
193bbef972 Add CC-BY.
Closes: #2
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-11-23 06:22:59 +10:30
Rusty Russell
1a132d4fab BOLT 2: Only single byte for channel-index.
And make it channel-index not channel_index to match the others (markdown
doesn't treat - specially, unlike _).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-11-23 06:07:08 +10:30
BitfuryLightning
25db6434fc Merge pull request #11 from rustyrussell/more-complex-gossip
BOLT #7: More complex proposal, using three separate message types.
2016-11-22 14:59:52 +02:00
Rusty Russell
9137aed167 BOLT #2: fill in descriptions and requirements for remaining fields. 2016-11-22 13:20:46 +10:30
Pierre-Marie Padiou
7bf986da23 close_signature -> closing_signed 2016-11-21 11:45:49 +01:00
Rusty Russell
2e93a4184e BOLT #7: More complex proposal, using three separate message types.
Contents stolen from Christian's draft.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-11-21 16:18:12 +10:30
Rusty Russell
bf80e07df0 BOLT 02/03: Add fee calculation details.
Make the fee amount by kiloweight, not by kilobyte, and spell out how
to calculate it.  Note that we have to trim HTLCs outputs whose second-stage
would also fall below dust limit, and we also make some reasonable
approximations on transaction size (which is unknowable before signatures
anyway).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-11-21 13:43:42 +10:30
Rusty Russell
a15f3f9ca3 BOLT #2: delete duplicate sentence.
It's already in the next paragraph.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-11-21 11:32:20 +10:30
Rusty Russell
60d91f2758 MSG_REVOCATION -> MSG_REVOKE_AND_ACK.
The fact that a revocation response also serves to acknowledge the
pending changes (and thus indicate the sender should apply them
to itself) is documented in the desciption, but still terribly
subtle.  Joseph suggested making it clearer, I think this
does that.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-11-21 10:34:43 +10:30
Rusty Russell
57b457ebd7 Merge pull request #8 from rustyrussell/fix-derivation
BOLT 2/3: watcher-compatible key derivation.

Nobody complained!
2016-11-19 10:31:40 +10:30
Pierre-Marie Padiou
db9ad2e63d BOLT #2: Add TOC
(Rebased by Rusty Russell <rusty@rustcorp.com.au>)
2016-11-18 14:02:32 +10:30
Pierre-Marie Padiou
e81ffb304c BOLT #2: Rename fee-per-kilobyte to feerate-per-kilobyte for clarity.
(Rebased by Rusty Russell <rusty@rustcorp.com.au>)
2016-11-18 14:02:21 +10:30
Pierre-Marie Padiou
18824a803a BOLT #2: Fix indent levels
(Rebased by Rusty Russell <rusty@rustcorp.com.au>)
2016-11-18 14:02:09 +10:30
Rusty Russell
32779962b5 BOLT 2/3: watcher-compatible key derivation.
After much discussion with Tadge and Laolu, I think we have something
which is nicely outsourcable, and yetnot insanely complex.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-11-17 14:33:22 +10:30
Pierre-Marie Padiou
fc9975f529 minor: updated open channel diagram 2016-11-16 16:24:50 -08:00
Olaoluwa Osuntokun
6c095bca5f BOLT 2: specify size of reason field in htlc fails 2016-11-15 12:30:00 -08:00
Rusty Russell
d1b7c783ac BOLT #2: fix cross-references.
And remove a duplicate sentence.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-11-15 14:00:37 +10:30
Rusty Russell
9b7a2922b1 BOLT #2, #5: derive maximum HTLC limit based on penalty size.
Calculations are put in 05-onchain.md, and referred to by 02-peer-protocol.

The number is 600, comfortably under the 626 theoretical limit.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-11-15 13:56:45 +10:30
Rusty Russell
76dfd378ff Transfer from google doc.
Minimal markdown and consistency fixes, more to come.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-11-15 11:53:20 +10:30