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

1059 Commits

Author SHA1 Message Date
Rusty Russell
83d918a4a1 BOLT 7: add explicit feature bits to channel_announce and node_announce.
We're going to want these eventually, so let's add them now.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-12-13 10:14:54 +10:30
Rusty Russell
397a27f1b4 BOLT 7: spell out signature checks for receivers.
The sending side says it needs to bitcoin-style sign double-SHA, but the
receiving side doesn't.  Make it clear.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-12-13 10:14:54 +10:30
Rusty Russell
f58bda73c0 BOLT 7: remove padding.
Having 2 bytes of padding before a string is pointless.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-12-13 10:14:54 +10:30
pm47
abe0e8c3cc fixed toc inconsistency 2016-12-12 12:05:06 +01:00
Rusty Russell
125b9a3657 BOLT 3: Fix commitment transaction input sequence number.
From BIP 68:

	If bit (1 << 31) of the sequence number is set, then no consensus
	meaning is applied to the sequence number and can be included in any
	block under all currently possible circumstances.

Which is what we want.

Reported-by: Olaoluwa Osuntokun <laolu32@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-12-12 11:13:29 +10:30
Rusty Russell
2f998f3741 BOLT 3: make upper bits of commit tx locktime and sequence explicit.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-12-12 10:38:10 +10:30
Christopher Jämthagen
b0379781a4 Some minor fixes 2016-12-12 10:37:45 +10:30
Christopher Jämthagen
f8f5fa6312 Make it clear that lower 24 bits of locktime is lower 24 bits of the obscured commitment transaction number 2016-12-12 10:37:45 +10:30
Christian Decker
669babb843 bolt04: Added reference to RFC 2104
FIPS 198 is based on RFC 2104, but further restricts the hashing
functions to the SHA-family, so this is a bit redundant, but my hope
is to avoid confusion about whether there is a difference.

Thanks @rustyrussell for pointing this one out.
2016-12-12 09:54:13 +10:30
Christian Decker
336717ea61 trivial: Fixing links in BOLT02. 2016-12-11 11:08:53 +10:30
Christian Decker
3378afe028 trivial: Consolidating inline code
Now using `<>` on inline code only when part of a script and extra
emphasis is warranted. Outside of scripts the variable names are
already highlighted, so no need to add further emphasis.
2016-12-11 11:08:53 +10:30
Christian Decker
71514b92df trivial: Minor markup fixes 2016-12-11 11:08:53 +10:30
Christian Decker
3a6b6584bb trivial: Fix footnotes in Bolt01 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
Christopher Jämthagen
6e4f7f0cc2 Consistently use 'transaction' instead of 'tx' 2016-12-09 10:41:48 +01:00
Christopher Jämthagen
c5ca57b853 [trivial] Some spelling and language fixes in BOLTs 6,7,8 (#41)
* Some spelling and language fixes in BOLTs 6,7,8
2016-12-09 10:32:23 +10:30
Rusty Russell
e6faf71c30 BOLT 3: Add test vectors for per-commitment-secret generation
These were generated (and recovery tested) by the command-line tool at:

	https://github.com/rustyrussell/ccan/tree/master/ccan/crypto/shachain/tools

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-12-08 11:00:05 +10:30
Rusty Russell
2c91aa869f BOLT 8: make temporary handshake keys explicit.
This makes it clear that we do reuse the second one (and hence must
increment the nonce there).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-12-08 10:58:03 +10:30
Rusty Russell
1da044eb06 BOLT 8: clarify handshake nonces.
Spell out the send/receive nonces for the normal message transport;
they're 0 except in one place where Act3 re-uses temp_k from Act2.

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


Header from folded patch 'typo-fixes.patch':

Typo fixes to squash.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-12-08 10:58:03 +10:30
Rusty Russell
15bda3eedd BOLT 8: explicit sn and rn nonces.
Spells it out that they are two separate nonces.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-12-08 10:58:03 +10:30
Rusty Russell
d251c7eef3 BOLT 8: fix sk,rk definition for responder.
Cut & paste and insufficiently mangled from initiator wording...

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-12-08 10:58:03 +10:30
Rusty Russell
df871d659e BOLT 8: fix handshake Act 3 receiver hash calculation.
We always hash in the ciphertext.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-12-08 10:58:03 +10:30
Christian Decker
3431ff587b Merge pull request #40 from pm47/logical-grouping
BOLT 1: Changed logical grouping of messages
2016-12-07 12:00:28 +01:00
pm47
a04dd425e8 changed logical grouping of messages 2016-12-07 10:38:37 +01:00
Christian Decker
890bb5f992 Merge pull request #39 from cjamthagen/temp
[trivial] Some spelling and language fixes in BOLTs 3,4,5
2016-12-07 10:14:39 +01:00
Christopher Jämthagen
6750398c97 Some spelling and language fixes in BOLTs 3,4,5 2016-12-07 10:04:57 +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
Rusty Russell
eb49bf3a17 BOLT 8: More minor clarifications.
1. Note that we're using the IETF chachapoly variant, which has 96 bit nonces.
2. Note that we send over the serialization of the pubkey on the wire.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-12-06 13:39:31 +10:30
Rusty Russell
ffed58f1a5 BOLT 8: minor clarifications and fixes.
1. More than three variables.
2. Make nonce encoding explicit (Big-endian, like everything else).
3. `e` is a keypair in this context; use `re` for their pubkey.
4. Explicitly note `re` and `le` notation.
5. Fix RFC reference.
6. Close `` around HKDF.
7. Use `ss` for the shared secret; `s` is already taken.
8. Use `re` for their pubkey.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-12-06 13:39:11 +10:30
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
pm47
58d1733d6d typo 2016-12-05 12:51:46 +01:00
pm47
844ee6910e fixed ToC links 2016-12-05 12:47:59 +01:00
pm47
8ae61d63e8 added a ToC 2016-12-05 12:45:47 +01:00
Christian Decker
61ccc9a378 Merge pull request #32 from esneider/patch-1
Fix typo
2016-12-04 12:12:57 +01:00
Dario Sneidermanis
b390d694d8 Fix typo 2016-12-04 01:16:08 -03:00
Rusty Russell
04d5cbc96c BOLT 0: Fix up name and link for BOLT 1
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-12-04 10:36:34 +10:30
Rusty Russell
4a6201232d BOLT 0: update index to add BOLT 7 and 8.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-12-04 10:23:08 +10:30
Rusty Russell
aa594c2608 BOLT 3: per-commitment not per-commit.
Be consistent.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-12-02 11:45:01 +10:30
Christian Decker
296075ec96 glossary: Added the _it's ok to be odd_ rule 2016-12-01 11:20:45 +01:00
Christian Decker
aa1ea27424 Merge pull request #31 from rustyrussell/remove-unneeded-padding
BOLT 2: remove attempts to align signatures.
2016-12-01 10:53:41 +01:00
Christian Decker
e7b029805d reorg: Deduplication and pointing to bolt08
Further separating the two specs by pointing to bolt08 for transport
details and deduplicating some of the information. Also fixed some
markup while I'm at it :-)
2016-11-30 19:40:55 -08:00
Christian Decker
e47c1af720 moveonly: Splitting BOLT 01 into two
So far we had both the transport layer, with its initialization details,
and part of the base protocol, with some generic messages like `init`
and `error` in a single spec. I propose we split the spec into two, one
for the transport layer and one for the communication on top of that
layer. This should make the independence of the two layers even clearer.

This commit is the first step towards that goal and simply moves blocks
of text into the new spec file. It should not change any semantics.
2016-11-30 19:40:55 -08:00
Rusty Russell
10f49ecb84 BOLT 3: Fix incorrect secret derivation.
There was talk of using a simple increment, but it was removed after
Tadge educated me.  Somehow this didn't get updated.

Reported-by: Tadge Dryja <tdryja@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-12-01 11:53:29 +10:30
Rusty Russell
e88dd27d12 BOLT 3: expand and correct HTLC transaction weights.
Inspired by Andrew Shvv's work, this expands the HTLC weight calculation
and fixes the gross errors (the witness program itself wasn't counted in
the weights!).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-11-30 06:58:27 +10:30
Rusty Russell
970b39a40d BOLT 3: Note assumption about to-remote output existing.
Commit a0c4f7cfd1 "BOLT 3: add more detailed commitment transaction
estimation (#26)" simplified the weight formula to assume there was a
to-remote output.

This worst-case 18% error, but it's simple.  Document it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-11-30 06:58:27 +10:30
andrew.shvv
a0c4f7cfd1 BOLT 3: add more detailed commitment transaction estimation (#26)
* add more detailed estimation
* fix miscalculations
2016-11-30 06:50:05 +10:30