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

125 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
c053ce7afb
Merge pull request #688 from joostjager/anchor-outputs
Anchor outputs
2020-08-19 16:41:08 -07:00
Joost Jager
1739746afa
Anchor outputs
This commit extends the specification with a new commitment format that
adds two anchor outputs to the commitment transaction. Anchor outputs
are a safety feature that allows a channel party to unilaterally increase
the fee of the commitment transaction using CPFP and ensure timely
confirmation on the chain. There is no cooperation required from the
remote party.
2020-08-19 15:27:21 +02:00
Rusty Russell
0ac9a6c409
BOLT 3: fix definition of flip(B) in P. (#779)
It turns out everyone does `P[B / 8] ^= (1 << (P % 8))`,
which is not what the spec says to do (it implies you
would treat P as a bitstring numbered 255 to 0).

See this stackoverflow question:
	https://stackoverflow.com/questions/49928131/lightning-secret-generation-from-seed

Reported-by: Janus Troelsen @ysangkok (on Twitter)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-07-07 08:58:08 +02:00
Joost Jager
bfc66e5e4a
Fixes to existing spec 2020-06-26 09:18:49 +02:00
Antoine Riard
11fd658059
Make explicit witness must conform to MINIMALIF (#764) 2020-04-27 21:50:57 +02:00
Bastien Teinturier
dcbf858397
Clarify numerical comparison of pubkeys (#743)
We are using lexixographic order (which is the same as big-endian
when inputs have the same size, such as compressed public keys).
2020-02-18 09:53:12 +01:00
Tim Ruffing
fb7102e034
Remove reference to DER encoding for public keys in compressed format (#742)
ECDSA signatures in Bitcoin are DER-encoded but public keys are not.

The compressed format for public keys is for example standardized in
Sections 2.3.3 and 2.3.4 of

  Standards for Efficient Cryptography, SEC 1: Elliptic Curve
  Cryptography, Certicom Research, Version 2, 2009,
  https://www.secg.org/sec1-v2.pdf
2020-02-17 11:00:30 +01:00
Jan Xie
2afe097f68
Fix a typo in insert_secret pseudo code (#741)
... to make it consistent with the `where_to_put_secret` above.
2020-02-14 09:45:32 +01:00
Rusty Russell
2afe3559e8 option_static_remotekey: final draft.
This separates out the static remotekey changes from the more ambitious
option_simplified_commitment (which also included pushme outputs and
bring-your-own-fee for HTLC outputs).

As per http://www.erisian.com.au/meetbot/lightning-dev/2019/lightning-dev.2019-09-02-20.06.html

Thanks to everyone for feedback: @araspitzu @roasbeef @bitconner

Suggested-by: @roasbeef
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-09-26 06:19:58 +00:00
Darosior
d669b01ba7 BOLT #3: Use space to indent in key derivation algorithms (#665) 2019-09-05 07:44:38 +00:00
Nadav Kohen
8555709811 BOLT 3: Explicit description of implicitly enforced timelocks on HTLC outputs (#601)
* Added descriptions of how a 2-of-2 multisignature verification is used for enforcing timelocks when timing out on-chain offered HTLCs as well as spending on-chain received HTLCs in the success case.
2019-08-19 21:52:09 +00:00
Alex Bosworth
636b9f2e28 Change opcode reference format (#594)
OP_CHECKLOCKTIMEVERIFY and OP_CSV use an inconsistent naming convention.
Update OP_CSV to match the OP_CHECKLOCKTIMEVERIFY convention as OP_CHECKSEQUENCEVERIFY.
2019-07-09 10:40:29 +02:00
Antoine Riard
6508af5145 Specify OP_DATA to express accepted/offered_htlc_script with same
convention
2019-02-04 23:44:25 +00:00
Orfeas Stefanos Thyfronitis Litos
064d6feed0 Align offered and received HTLC scripts similarly 2019-01-22 21:45:06 +01:00
Rusty Russell
a57ff00e93 BOLT #2: order htlc_signatures by BIP69 + increasing CLTV.
We express it has how the outputs are ordered, but the only way you can
detect that is by the htlc_signatures order, which is the part which really
matters.

I finally reproduced this, BTW, which is why I'm digging it up!

Closes: #448
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-01-22 21:43:58 +01:00
Antoine Riard
681f3c3621 Fix ambiguity on HTLC transactions spendable by a penalty one
Both HTLC-success/HTLC-timeout can be spent by a valid penalty
transaction
2019-01-15 22:52:30 +00:00
Rusty Russell
af2e94b22d
Merge pull request #529 from nayuta-gondo/pr/20181206a-remote_htlcpubkey
BOLT 3: add description of `remote_htlcpubkey` in `Key Derivation`.
2019-01-07 19:40:57 +00:00
Hiroki Gondo
626fff28c9 BOLT 3: fix the rationale of Closing Transaction. 2019-01-07 19:38:55 +00:00
Hiroki Gondo
eba1c70f6b BOLT 3: fix trivial typo. 2019-01-07 20:18:31 +01:00
Hiroki Gondo
e64c9863b5 BOLT 3: add description of remote_htlcpubkey in Key Derivation. 2018-12-06 21:30:01 +09:00
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