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

105 Commits

Author SHA1 Message Date
Hiroki Gondo
56ada3d85c BOLT 3: commitment number not commitment transaction number.
Be consistent.
2018-11-29 04:24:28 +00:00
Orfeas Litos
24d5d33d67 Specify valid signature hash flags (SIGHASH_ALL)
Clarify that this flag is only used for signing and not transmitted
2018-11-29 04:18:04 +00:00
Mykola Sakhno
8e62fd3a08 BOLT 3: fix private key in internal part 2018-11-29 04:17:43 +00:00
Hajime Yamaguchi
a9195a84d0 BOLT 3/BOLT 7: Fix broken links. 2018-08-07 00:07:26 +00:00
Janus Troelsen
5c11b6a402 Fix TOC indentation and links 2018-06-25 10:58:03 +00:00
Carsten Otto
acfd90e009 fix fee calculation numbers 2018-06-11 11:18:16 +00:00
Li Xuanji
a495b3a74f Define P2WSH earlier 2018-04-11 03:42:05 +00:00
practicalswift
316882fcc5 Use a vs an consistently 2018-02-20 01:12:29 +00:00
Rusty Russell
4c8cb512d0 BOLT 2,3,5: always refer to shared/pubkey/private key.
Make it clear what kind of key we're talking about.  We use the abbreviation
pubkey for public key (as it's quite common to use in field names), but
generally spell out 'private'.

(I generally prefer 'secret' to 'private' but we use private far more often
already, and we use 'secret' for things which don't directly derive keys).

Fixes: #368
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-20 01:10:38 +00:00
Shannon Appelcline
852f1904f6 Updates for FIXMEs 2018-02-05 23:49:32 +00:00
Shannon Appelcline
9a04862469 BOLT-3 Edits
This is my final first-pass BOLT. Some grammar changes, some remote/local additions, a few questions.
2018-02-05 23:49:32 +00:00
Rusty Russell
ee5f4352bb BOLT 3: closing tx must also round outputs down to whole satoshis.
We specify this for the commitment tx, but not for the closing tx.

Reported-by: Christian Decker
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-05 19:19:10 +00:00
practicalswift
2c3466a2af Remove trailing whitespace 2018-01-30 04:54:31 +00:00
William Casarin
b2960b4267 transactions: fix broken anchor links
Signed-off-by: William Casarin <jb55@jb55.com>
2018-01-22 14:01:01 +01:00
Rusty Russell
47b8851037 BOLT 3: note that key derivation test vectors apply to HTLC keys too.
Reported-by: Matt Corallo
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-22 13:58:45 +01:00
Matt Corallo
2551b602c5 BOLT 3: fix secret gen requirements layout
It misrenders on GitHub. Matt had a patch which changed the actual
form of the requiremnt, this uses ``` instead.

Based-on-Patch-By: Matt Corallo @TheBlueMatt
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-12-22 00:40:29 +00:00
Rusty Russell
a83f2b42e9 BOLT 0, BOLT 3: minor typo fixes.
Reported-by: Shannon Appelcline <shannon.appelcline@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-12-21 14:39:06 +10:30
Landon Mutch
214e5d7f57 BOLT 3: remove rogue a.k.a. 2017-12-21 04:08:33 +00:00
Landon Mutch
34eec6ce14 BOLT 3: apply a.k.a. abbreviation 2017-12-21 04:08:33 +00:00
Landon Mutch
641c6ab7b1 stylesheet update and apply to BOLT 2,3 2017-12-21 04:08:33 +00:00
Olaoluwa Osuntokun
f4d2d62920 BOLT3: the closing transaction now uses version 2
In this commit, we modify the cooperative closing transaction to use
version 2. Currently eclair and lnd already use version 2, while
c-lightning uses version 1. The commitment transaction already uses
version 2, so making this additional transaction (which spends the
funding output) also use version 2 would be consistent. Additionally,
as a best practice, we should be using the highest currently
defined/use transaction version.
2017-12-11 22:58:56 +00:00
Landon Mutch
5db55df16a BOLT 1,2,3: apply updated stylesheet guidelines for list capitalization, punctuation 2017-12-07 02:36:10 +00:00
Landon Mutch
7a8a5d88dd BOLT 2,3: fix changes requested 2017-11-28 23:11:55 +00:00
Landon Mutch
cd3c49eb88 BOLT 3: fix typo 2017-11-28 23:11:55 +00:00
Landon Mutch
785d69de41 BOLT 3: complete first pass copy-edit according to stylesheet guidelines; 2017-11-28 23:11:55 +00:00
Landon Mutch
f23e3dd56b BOLT 1,2,3: first pass copy-edit;
BOLT 1,2: minor header spacing fixes
BOLT 3: first pass copy edit, according to capitalization, formatting stylesheet guidelines;
2017-11-28 23:11:55 +00:00
Rusty Russell
4f91f0bb2a htlckey: new basepoint avoid holding the payment secret.
This is stolen from @sstone's #243 "reduce attack surface".

This breaks compatibility, as agreed at the 2017-11-13 meeting.
Note also that it does not update the test vectors.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-11-14 22:58:11 +00:00
ueno
6d43b28258 fix some links 2017-10-17 07:25:48 +00:00
Pierre-Marie Padiou
2aa9f971af fixed typo htlc->HTLC (#262) 2017-10-12 11:40:05 +02:00
Jim Posen
31ae0035c0 BOLT 03: Correct txid of funding transaction in test vector.
The txid has the wrong endianness since Bitcoin reverses the byte
order of double-SHA256 hashes.
2017-09-25 12:28:40 +09:30
Jim Posen
fc31c379e2 BOLT 03: Remove extra 0x01 byte from private keys in test vectors.
An 0x01 byte is appended to the end of private keys in the test
vectors to mark them as using compressed serialization to derive the
pubkeys. Two of the private keys have two 0x01 bytes appended,
presumably by accident.
2017-09-25 12:28:40 +09:30
Jim Posen
22dfcbabcc BOLT 03: Fix appendix numbers and TOC links. 2017-09-25 12:28:40 +09:30
Jim Posen
a01f4c55d3 BOLT 03: Fix pseudcode for shachain algorithm.
When deriving a secret from a seed and index, the bits of the index
must be iterated in reverse order.
2017-09-25 12:28:40 +09:30
Janus Troelsen
49edc5417f Fix link to localkey-remotekey-local_delayedkey-and-remote_delayedkey-derivation 2017-08-26 16:42:32 +09:30
Rusty Russell
4dc97605cc BOLT 3: define closing transaction.
The only surprise here (maybe?) is that we use the commitment number encoding.
I think that makes sense, but it was unspecified before.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-08-08 10:05:18 +09:30
Rusty Russell
95e7196560 BOLT 3: fix references to RIPEMD160(revocationkey)
They should be HASH160, aka RIPEMD160(SHA256()).

Closes: #179
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-05-23 17:56:53 +02:00
Olaoluwa Osuntokun
61b5b3f7b4 BOLT 3: clarify description of revocation key derivation (#170)
This commit attempts to clarify some ambiguity in the way the
revocation key derivation was formerly described. Rather than framing
the description in terms of local vs remote nodes, we instead frame the
description around the _process_ of creating a new commitment
transaction for a remote node,

[ minor typos and remove weird part-sentence -- RR ]
2017-05-20 09:50:51 +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
5f06896403 BOLT 3: instead of ripemd-of-X, use RIPEMD160(X).
This is more specific and clearer.

Reported-by: Olaoluwa Osuntokun <laolu32@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-05-15 12:54:53 -07:00
Rusty Russell
63edd2e869 BOLT 3: use correct field name for HTLC timeout value.
It's called cltv_expiry in BOLT 2's update_add_htlc.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-05-15 12:54:53 -07:00
Rusty Russell
407b9927bf BOLT 3: Replace many hyphens with underscores in descriptions.
Not sure how I missed these:
1. funding-pubkey -> funding_pubkey
2. to-self-delay -> to_self_delay
3. per-commitment-point -> per_commitment_point
4. per-commitment-secret -> per_commitment_secret
5. revocation-basepoint -> revocation_basepoint
6. delayed-payment-basepoint -> delayed_payment_basepoint
7. payment-basepoint -> payment_basepoint

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-05-15 12:54:53 -07:00
Rusty Russell
c0fa965036 BOLT 3: Add URL for BIP69.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-05-11 11:20:36 +09:30
Rusty Russell
8c0e55ac37 BOLT 4: underscores and backticks everywhere.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-05-11 11:20:36 +09:30
Rusty Russell
925b39a619 BOLT 3: typo fixes.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-05-03 13:08:07 +09:30
Rusty Russell
5ed243de2d BOLT 3: fix labels on test vectors.
As per ElementsProject/lightning#134 Fabrice points out that to calculate
our own commitment tx, we use the *other* side's revocation basepoint:

	The revocationkey is a blinded key: the remote node provides the base,
	and the local node provides the blinding factor which it later
	reveals

Thus, we fix the test vectors by renaming "local_revocation_basepoint"
to "remote_revocation_basepoint", which is what we should be using.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-03-24 12:24:24 +10:30
Rusty Russell
e6aa70ebc0 BOLT 3: update test vectors for new scripts and weight calculation.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-03-08 05:50:44 +10:30
Rusty Russell
aeb6e45d7e BOLT 3: fix internal remote_secret_key documentation.
We didn't update it for 394da29189
"BOLT 3: fix test vector derivation."

This doesn't actually change any results, just fixes an intermediate
calculation.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-03-08 05:50:44 +10:30
Rusty Russell
7c59d6990b BOLT 3: update numbers in example calculation.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-03-08 05:50:44 +10:30
Rusty Russell
392008a7d3 BOLT 3,5: update weight calculations for revocation key hash in script.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-03-08 05:50:44 +10:30
Rusty Russell
a597738b94 BOLT 3: Use revocation key hash rather than revocation key in scripts.
This means more bytes if we need to create a penalty tx, but less for
normal operation:

Witness script for offered htlcs: 139 bytes -> 133 bytes.
Witness script for accepted htlcs: 156 bytes -> 139 bytes.

It's also a little simpler; it's just an OP_IF around the old scripts
to test for the revocation key being the top arg.

Suggested-by: Joseph Poon <joseph@lightning.network>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-03-08 05:50:44 +10:30