2016-11-15 02:23:20 +01:00
|
|
|
# BOLT #0: Introduction and Index
|
|
|
|
|
copy-edit 00-introduction for appropriate grammer, punctuation, and style
Edit 00-introduction copy for clarity (minor rephrasing, punctuation),
correctness (grammar, capitalization, punctuation),
consision (minimizing wordiness, redundancy),
and consistency (document style, e.g. 1 space between sentences,
capitalization of headers, etc.)
2017-11-04 16:53:23 +01:00
|
|
|
Welcome, friend! These Basis of Lightning Technology (BOLT) documents
|
2017-11-18 21:00:36 +01:00
|
|
|
describe a layer-2 protocol for off-chain bitcoin transfer by mutual
|
2016-11-15 02:23:20 +01:00
|
|
|
cooperation, relying on on-chain transactions for enforcement if
|
|
|
|
necessary.
|
|
|
|
|
|
|
|
Some requirements are subtle; we have tried to highlight motivations
|
copy-edit 00-introduction for appropriate grammer, punctuation, and style
Edit 00-introduction copy for clarity (minor rephrasing, punctuation),
correctness (grammar, capitalization, punctuation),
consision (minimizing wordiness, redundancy),
and consistency (document style, e.g. 1 space between sentences,
capitalization of headers, etc.)
2017-11-04 16:53:23 +01:00
|
|
|
and reasoning behind the results you see here. I'm sure we've fallen
|
2017-11-22 20:13:31 +01:00
|
|
|
short; if you find any part confusing or wrong, please contact us and
|
2016-11-15 02:23:20 +01:00
|
|
|
help us improve.
|
|
|
|
|
|
|
|
This is version 0.
|
|
|
|
|
2016-12-04 01:06:34 +01:00
|
|
|
1. [BOLT #1](01-messaging.md): Base Protocol
|
2016-11-15 02:23:20 +01:00
|
|
|
2. [BOLT #2](02-peer-protocol.md): Peer Protocol for Channel Management
|
|
|
|
3. [BOLT #3](03-transactions.md): Bitcoin Transaction and Script Formats
|
|
|
|
4. [BOLT #4](04-onion-routing.md): Onion Routing Protocol
|
|
|
|
5. [BOLT #5](05-onchain.md): Recommendations for On-chain Transaction Handling
|
2016-12-04 00:53:08 +01:00
|
|
|
7. [BOLT #7](07-routing-gossip.md): P2P Node and Channel Discovery
|
|
|
|
8. [BOLT #8](08-transport.md): Encrypted and Authenticated Transport
|
2017-02-07 01:53:39 +01:00
|
|
|
9. [BOLT #9](09-features.md): Assigned Feature Flags
|
2017-08-22 02:02:57 +02:00
|
|
|
10. [BOLT #10](10-dns-bootstrap.md): DNS Bootstrap and Assisted Node Location
|
2017-06-27 12:38:13 +02:00
|
|
|
11. [BOLT #11](11-payment-encoding.md): Invoice Protocol for Lightning Payments
|
2016-11-15 02:23:20 +01:00
|
|
|
|
|
|
|
## Glossary and Terminology Guide
|
|
|
|
|
2017-11-22 20:13:31 +01:00
|
|
|
* *Node*:
|
|
|
|
* A computer or other device connected to the Bitcoin network.
|
|
|
|
|
|
|
|
* *Peers*:
|
2017-12-16 07:50:30 +01:00
|
|
|
* *Nodes* transacting bitcoins with one other through a *channel*.
|
2017-11-22 20:13:31 +01:00
|
|
|
|
2017-11-28 23:02:16 +01:00
|
|
|
* *MSAT*:
|
|
|
|
* A millisatoshi, often used as a field name.
|
2017-11-22 20:13:31 +01:00
|
|
|
|
copy-edit 00-introduction for appropriate grammer, punctuation, and style
Edit 00-introduction copy for clarity (minor rephrasing, punctuation),
correctness (grammar, capitalization, punctuation),
consision (minimizing wordiness, redundancy),
and consistency (document style, e.g. 1 space between sentences,
capitalization of headers, etc.)
2017-11-04 16:53:23 +01:00
|
|
|
* *Funding transaction*:
|
2017-11-22 20:13:31 +01:00
|
|
|
* An irreversible on-chain transaction that pays to both *peers* on a *channel*.
|
2017-11-10 03:32:52 +01:00
|
|
|
It can only be spent by mutual consent.
|
2016-11-15 02:23:20 +01:00
|
|
|
|
|
|
|
* *Channel*:
|
2017-11-15 11:55:16 +01:00
|
|
|
* A fast, off-chain method of mutual exchange between two *peers*.
|
2017-11-22 20:13:31 +01:00
|
|
|
To transact funds, peers exchange signatures to create an updated *commitment transaction*.
|
2016-11-15 02:23:20 +01:00
|
|
|
|
copy-edit 00-introduction for appropriate grammer, punctuation, and style
Edit 00-introduction copy for clarity (minor rephrasing, punctuation),
correctness (grammar, capitalization, punctuation),
consision (minimizing wordiness, redundancy),
and consistency (document style, e.g. 1 space between sentences,
capitalization of headers, etc.)
2017-11-04 16:53:23 +01:00
|
|
|
* *Commitment transaction*:
|
2017-11-22 20:13:31 +01:00
|
|
|
* A transaction that spends the *funding transaction*.
|
|
|
|
Each *peer* holds the other peer's signature for this transaction, so that each
|
|
|
|
always has a commitment transaction that it can spend. After a new
|
2017-11-10 03:32:52 +01:00
|
|
|
commitment transaction is negotiated, the old one is *revoked*.
|
2016-11-15 02:23:20 +01:00
|
|
|
|
|
|
|
* *HTLC*: Hashed Time Locked Contract.
|
2017-11-22 20:13:31 +01:00
|
|
|
* A conditional payment between two *peers*: the recipient can spend
|
2017-11-10 03:32:52 +01:00
|
|
|
the payment by presenting its signature and a *payment preimage*,
|
|
|
|
otherwise the payer can cancel the contract by spending it after
|
|
|
|
a given time. These are implemented as outputs from the
|
|
|
|
*commitment transaction*.
|
2016-11-15 02:23:20 +01:00
|
|
|
|
2017-11-22 20:13:31 +01:00
|
|
|
* *Payment hash*:
|
|
|
|
* The *HTLC* contains the payment hash, which is the hash of the
|
2017-12-16 07:50:30 +01:00
|
|
|
*payment preimage*.
|
2017-11-22 20:13:31 +01:00
|
|
|
|
2017-12-16 07:50:30 +01:00
|
|
|
* *Payment preimage*:
|
2017-11-22 20:13:31 +01:00
|
|
|
* Proof that payment has been received, held by
|
|
|
|
the final recipient, who is the only person who knows this
|
|
|
|
secret. The final recipient releases the preimage in order to
|
2017-11-27 23:32:02 +01:00
|
|
|
release funds. The payment preimage is hashed as the *payment hash*
|
2017-11-22 20:13:31 +01:00
|
|
|
in the *HTLC*.
|
2016-11-15 02:23:20 +01:00
|
|
|
|
2017-11-22 20:13:31 +01:00
|
|
|
* *Commitment revocation secret key*:
|
|
|
|
* Every *commitment transaction* has a unique *commitment revocation* secret-key
|
|
|
|
value that allows the other *peer* to spend all outputs
|
2017-11-10 03:32:52 +01:00
|
|
|
immediately: revealing this key is how old commitment
|
2017-12-16 07:50:30 +01:00
|
|
|
transactions are revoked. To support revocation, each output of the
|
2017-11-22 20:13:31 +01:00
|
|
|
commitment transaction refers to the commitment revocation public key.
|
2016-11-15 02:23:20 +01:00
|
|
|
|
|
|
|
* *Per-commitment secret*:
|
2017-11-22 20:13:31 +01:00
|
|
|
* Every *commitment transaction* derives its keys from a per-commitment secret,
|
2016-11-15 02:23:20 +01:00
|
|
|
which is generated such that the series of per-commitment secrets
|
2017-01-08 16:43:38 +01:00
|
|
|
for all previous commitments can be stored compactly.
|
2016-11-15 02:23:20 +01:00
|
|
|
|
copy-edit 00-introduction for appropriate grammer, punctuation, and style
Edit 00-introduction copy for clarity (minor rephrasing, punctuation),
correctness (grammar, capitalization, punctuation),
consision (minimizing wordiness, redundancy),
and consistency (document style, e.g. 1 space between sentences,
capitalization of headers, etc.)
2017-11-04 16:53:23 +01:00
|
|
|
* *Mutual close*:
|
2017-11-22 20:13:31 +01:00
|
|
|
* A cooperative close of a *channel*, accomplished by broadcasting an unconditional
|
|
|
|
spend of the *funding transaction* with an output to each *peer*
|
2017-11-10 03:32:52 +01:00
|
|
|
(unless one output is too small, and thus is not included).
|
2016-11-15 02:23:20 +01:00
|
|
|
|
copy-edit 00-introduction for appropriate grammer, punctuation, and style
Edit 00-introduction copy for clarity (minor rephrasing, punctuation),
correctness (grammar, capitalization, punctuation),
consision (minimizing wordiness, redundancy),
and consistency (document style, e.g. 1 space between sentences,
capitalization of headers, etc.)
2017-11-04 16:53:23 +01:00
|
|
|
* *Unilateral close*:
|
2017-11-22 20:13:31 +01:00
|
|
|
* An uncooperative close of a *channel*, accomplished by broadcasting a
|
2017-11-10 03:32:52 +01:00
|
|
|
*commitment transaction*. This transaction is larger (i.e. less
|
2017-11-22 20:13:31 +01:00
|
|
|
efficient) than a *mutual close* transaction, and the peer whose
|
2017-11-10 03:32:52 +01:00
|
|
|
commitment is broadcast cannot access its own outputs for some
|
|
|
|
previously-negotiated duration.
|
2016-11-15 02:23:20 +01:00
|
|
|
|
copy-edit 00-introduction for appropriate grammer, punctuation, and style
Edit 00-introduction copy for clarity (minor rephrasing, punctuation),
correctness (grammar, capitalization, punctuation),
consision (minimizing wordiness, redundancy),
and consistency (document style, e.g. 1 space between sentences,
capitalization of headers, etc.)
2017-11-04 16:53:23 +01:00
|
|
|
* *Revoked transaction close*:
|
2017-11-22 20:13:31 +01:00
|
|
|
* An invalid close of a *channel*, accomplished by broadcasting a revoked
|
|
|
|
*commitment transaction*. Since the other *peer* knows the
|
2017-11-10 03:32:52 +01:00
|
|
|
*commitment revocation secret key*, it can create a *penalty transaction*.
|
2016-11-15 02:23:20 +01:00
|
|
|
|
copy-edit 00-introduction for appropriate grammer, punctuation, and style
Edit 00-introduction copy for clarity (minor rephrasing, punctuation),
correctness (grammar, capitalization, punctuation),
consision (minimizing wordiness, redundancy),
and consistency (document style, e.g. 1 space between sentences,
capitalization of headers, etc.)
2017-11-04 16:53:23 +01:00
|
|
|
* *Penalty transaction*:
|
2017-11-22 20:13:31 +01:00
|
|
|
* A transaction that spends all outputs of a revoked *commitment
|
|
|
|
transaction*, using the *commitment revocation secret key*. A *peer* uses this
|
2017-11-10 03:32:52 +01:00
|
|
|
if the other peer tries to "cheat" by broadcasting a revoked
|
|
|
|
*commitment transaction*.
|
2016-11-15 02:23:20 +01:00
|
|
|
|
copy-edit 00-introduction for appropriate grammer, punctuation, and style
Edit 00-introduction copy for clarity (minor rephrasing, punctuation),
correctness (grammar, capitalization, punctuation),
consision (minimizing wordiness, redundancy),
and consistency (document style, e.g. 1 space between sentences,
capitalization of headers, etc.)
2017-11-04 16:53:23 +01:00
|
|
|
* *Commitment number*:
|
2017-11-09 22:30:31 +01:00
|
|
|
* A 48-bit incrementing counter for each *commitment transaction*; counters
|
2017-11-22 20:13:31 +01:00
|
|
|
are independent for each *peer* in the *channel* and start at 0.
|
2016-11-15 02:23:20 +01:00
|
|
|
|
2016-12-01 11:20:45 +01:00
|
|
|
* *It's ok to be odd*:
|
2017-11-22 20:13:31 +01:00
|
|
|
* A rule applied to some numeric fields that indicates either optional or
|
2016-12-01 11:20:45 +01:00
|
|
|
compulsory support for features. Even numbers indicate that both endpoints
|
|
|
|
MUST support the feature in question, while odd numbers indicate
|
|
|
|
that the feature MAY be disregarded by the other endpoint.
|
2016-11-15 02:23:20 +01:00
|
|
|
|
2017-07-24 21:44:14 +02:00
|
|
|
* `chain_hash`:
|
copy-edit 00-introduction for appropriate grammer, punctuation, and style
Edit 00-introduction copy for clarity (minor rephrasing, punctuation),
correctness (grammar, capitalization, punctuation),
consision (minimizing wordiness, redundancy),
and consistency (document style, e.g. 1 space between sentences,
capitalization of headers, etc.)
2017-11-04 16:53:23 +01:00
|
|
|
* Used in several of the BOLT documents to denote the genesis hash of a
|
2017-11-22 20:13:31 +01:00
|
|
|
target blockchain. This allows *nodes* to create and reference *channels* on
|
|
|
|
several blockchains. Nodes are to ignore any messages that reference a
|
2017-11-09 22:30:31 +01:00
|
|
|
`chain_hash` that are unknown to them. Unlike `bitcoin-cli`, the hash is
|
copy-edit 00-introduction for appropriate grammer, punctuation, and style
Edit 00-introduction copy for clarity (minor rephrasing, punctuation),
correctness (grammar, capitalization, punctuation),
consision (minimizing wordiness, redundancy),
and consistency (document style, e.g. 1 space between sentences,
capitalization of headers, etc.)
2017-11-04 16:53:23 +01:00
|
|
|
not reversed but is used directly.
|
2017-07-24 21:44:14 +02:00
|
|
|
|
|
|
|
For the main chain Bitcoin blockchain, the `chain_hash` value MUST be
|
|
|
|
(encoded in hex):
|
2017-09-05 01:30:55 +02:00
|
|
|
`6fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d6190000000000`.
|
2017-07-24 21:44:14 +02:00
|
|
|
|
2016-11-15 02:23:20 +01:00
|
|
|
## Theme Song
|
|
|
|
|
|
|
|
Why this network could be democratic...
|
|
|
|
Numismatic...
|
|
|
|
Cryptographic!
|
|
|
|
Why it could be released Lightning!
|
|
|
|
(Release Lightning!)
|
|
|
|
|
|
|
|
|
|
|
|
We'll have some timelocked contracts with hashed pubkeys, oh yeah.
|
|
|
|
(Keep talking, whoa keep talkin')
|
|
|
|
We'll segregate the witness for trustless starts, oh yeah.
|
|
|
|
(I'll get the money, I've got to get the money)
|
|
|
|
With dynamic onion routes, they'll be shakin' in their boots;
|
|
|
|
You know that's just the truth, we'll be scaling through the roof.
|
|
|
|
Release Lightning!
|
|
|
|
(Go, go, go, go; go, go, go, go, go, go)
|
|
|
|
|
|
|
|
|
|
|
|
[Chorus:]
|
|
|
|
Oh released Lightning, it's better than a debit card..
|
|
|
|
(Release Lightning, go release Lightning!)
|
|
|
|
With released Lightning, micropayments just ain't hard...
|
|
|
|
(Release Lightning, go release Lightning!)
|
|
|
|
Then kaboom: we'll hit the moon -- release Lightning!
|
|
|
|
(Go, go, go, go; go, go, go, go, go, go)
|
|
|
|
|
|
|
|
|
|
|
|
We'll have QR codes, and smartphone apps, oh yeah.
|
|
|
|
(Ooo ooo ooo ooo ooo ooo ooo)
|
|
|
|
P2P messaging, and passive incomes, oh yeah.
|
|
|
|
(Ooo ooo ooo ooo ooo ooo ooo)
|
|
|
|
Outsourced closure watch, gives me feelings in my crotch.
|
|
|
|
You'll know it's not a brag when the repo gets a tag:
|
|
|
|
Released Lightning.
|
|
|
|
|
|
|
|
|
|
|
|
[Chorus]
|
|
|
|
[Instrumental, ~1m10s]
|
|
|
|
[Chorus]
|
|
|
|
(Lightning! Lightning! Lightning! Lightning!
|
|
|
|
Lightning! Lightning! Lightning! Lightning!)
|
|
|
|
|
|
|
|
|
|
|
|
C'mon guys, let's get to work!
|
|
|
|
|
|
|
|
|
|
|
|
-- Anthony Towns <aj@erisian.com.au>
|
|
|
|
|
|
|
|
## Authors
|
|
|
|
|
|
|
|
[ FIXME: Insert Author List ]
|
|
|
|
|
2016-11-22 20:52:59 +01:00
|
|
|
![Creative Commons License](https://i.creativecommons.org/l/by/4.0/88x31.png "License CC-BY")
|
|
|
|
<br>
|
|
|
|
This work is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/).
|