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

927 Commits

Author SHA1 Message Date
Rusty Russell
fcc93d480a BOLT 8: Nonces should be little-endian, 64 bit.
This follows the Noise spec.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-12-22 11:33:14 +10:30
Pierre-Marie Padiou
856331e347 fixed numbering 2016-12-21 11:44:15 +01:00
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
Fabrice Drouin
d02681a53b BOLT 3: fix fee computations
1. HTLC must be able to pay for their HTLC success/timeout transaction fees
2. add examples
2016-12-21 14:55:26 +10:30
Pierre-Marie Padiou
bf68c6253e fixed typo 2016-12-20 19:00:58 +01:00
pm47
951fe14775 added a table of contents to bolt3 2016-12-20 16:43:08 +01:00
Rusty Russell
6e99d24619 BOLT 7: allow multiple address descriptors. (Take II) (#60)
This lets us have both IPv4 and IPv6 (and Tor etc in future) address,
while still preserving the ability to add other fields to the message
in future.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-12-20 14:23:11 +10:30
Olaoluwa Osuntokun
69b8767017 BOLT04: specify per-hop-payload format (#56)
* BOLT04: specify per-hop-payload format
2016-12-20 10:54:42 +10:30
fivepiece
66ffc6c624 BOLT 3: Fix funding output script
remove `0` from the funding output script as it is not part of a normal 2-of-2 multisig script
2016-12-18 10:36:49 +10:30
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
Rusty Russell
9f979bae5b BOLT 8: clarify the hkdf args. (#57)
They're salt and ikm respectively (using language from RFC5869).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-12-13 10:46:54 -08:00
pm47
93f948cbd9 typos and consistency 2016-12-13 15:44:14 +01:00
Fabrice Drouin
291c93bfd0 Merge pull request #55 from rustyrussell/alias-fix
BOLT 7: fix 21-byte limit typo, allow alias to use all characters.
2016-12-13 10:37:33 +01:00
Rusty Russell
3f1948ec12 BOLT 4, BOLT 8: use libsecp256k1-style ECDH.
You should probably be using this library anyway, so let's use their
ECDH style.

Closes: #49
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-12-13 10:25:25 +10:30
Rusty Russell
8c8664452b BOLT 7: fix 21-byte limit typo, allow alias to use all characters.
Reported-by: Fabrice Drouin <fabrice.drouin@acinq.fr>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-12-13 10:18:11 +10:30
Rusty Russell
653e12730b BOLT 7: minor clarifications
Suggested-by: Christian Decker <cdecker@blockstream.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-12-13 10:14:54 +10:30
Rusty Russell
666c13c204 BOLT 7: spell out the proof chain for channel_announcement
Inspired by Andrew Samokhvalov's PR, this makes the relationship
between the signatures in `channel_announcement` explicit.

Closes: #27
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-12-13 10:14:54 +10:30
Rusty Russell
63bd16bf28 BOLT 7: specify that we don't have to rebroadcast huge packets.
We could spam the network with 64k announcements, and each node has to
rememeber them for rebroadcasting.  There's a tradeoff between
allowing future expansions and this potential DoS, so allow nodes to
choose.

My current implementation thinking is: each extra byte reduces chance
of rebroadcast by a small amount, such that if you're twice the
minimum size your chance of rebroadcast hits 0.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-12-13 10:14:54 +10:30
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