mirror of
https://github.com/ChristopherA/Learning-Bitcoin-from-the-Command-Line.git
synced 2025-06-07 07:56:31 +00:00
edits
This commit is contained in:
parent
aac9234b89
commit
794dc7c2c0
@ -1,6 +1,37 @@
|
||||
## Lightning Network Review
|
||||
# 19.4: Expanding the Lightning Network
|
||||
|
||||
In this brief review we add some important features of C-lightning and we list the most widely used implementations in the lightning network Today, although there are more. All implementations follow the Basis of Lightning Technology (BOLT) documents describe a layer-2 protocol for off-chain bitcoin transfers. The specifications are currently a work-in-progress and currently being drafted.
|
||||
> :information_source: **NOTE:** This is a draft in progress, so that I can get some feedback from early reviewers. It is not yet ready for learning.
|
||||
|
||||
These two chapters have covered just a few of the most important activities with Lightning. There's lots more that can be done, and lots of variety possible. What follows are some pointers forward.
|
||||
|
||||
## Using c-lightning Plugins
|
||||
|
||||
c-lightning is a lightweight, highly customizable, and standard compliant implementation of the Lightning Network protocol. It extends it functionality using Plugins. Mainly, these are subprocesses that are initiated by the `lightningd` daemon and can interact with `lightningd` in a variety of ways:
|
||||
|
||||
* Command line options allow plugins to register their own command line arguments, which are then exposed through `lightningd`.
|
||||
* JSON-RPC command passthrough allows plugins to add their own commands to the JSON-RPC interface.
|
||||
* Event stream subscriptions provide plugins with a push-based notification mechanism for `lightnind`.
|
||||
* Hooks are a primitive option that allows plugins to be notified about events in the `lightningd` daemon and modify its behavior or pass on custom behaviors.
|
||||
|
||||
A plugin may be written in any language and can communicates with `lightningd` through the plugin's stdin and stdout. JSON-RPCv2 is used as protocol on top of the two streams, with the plugin acting as server and `lightningd` acting as client.
|
||||
|
||||
The `lightningd` GitHub repo maintains a updated list of [plugins](https://github.com/lightningd/plugins) available.
|
||||
|
||||
## Using Mobile Wallets
|
||||
|
||||
We currently know of two mobile lightning wallets that support the c-lightning implementation.
|
||||
|
||||
For iOS devices FullyNoded is an open-source iOS Bitcoin wallet that connects via Tor V3 authenticated service to your own full node. FullyNoded functionality is currently under active development and in early beta testing phase.
|
||||
|
||||
* [FullyNoded](https://github.com/Fonta1n3/FullyNoded/blob/master/Docs/Lightning.md)
|
||||
|
||||
SparkWallet is a minimalistic wallet GUI for c-lightning, accessible over the web or through mobile and desktop apps for Android.
|
||||
|
||||
* [SparkWallet](https://github.com/shesek/spark-wallet)
|
||||
|
||||
## Using Different Lightning Implementations
|
||||
|
||||
c-lightning isn't your only option. Today there are three widely used implementations of the Lightning Network. All of them follow the [Basis of Lightning Technology (BOLT) documents](https://github.com/lightningnetwork/lightning-rfc), which describe a layer-2 protocol for off-chain bitcoin transfers. The specifications are currently a work-in-progress that is now being drafted.
|
||||
|
||||
| Name | Description | BitcoinStandup | Language | Repository |
|
||||
| ------------- | ------------- | :---: | ------------- | ------------- |
|
||||
@ -8,31 +39,23 @@ In this brief review we add some important features of C-lightning and we list t
|
||||
| LND | Lightning Labs | X | Go | [Download](https://github.com/lightningnetwork/lnd) |
|
||||
| Eclair | ACINQ | - | Scala | [Download](https://github.com/ACINQ/eclair) |
|
||||
|
||||
## Maintaining Backups
|
||||
|
||||
### Plugins
|
||||
Your Lightning node needs to be online all the time, otherwise your counterparty could send a previous channel status and steal your funds. However, there is another scenario in which funds can be lost, and that is when a hardware failure occurs that prevents the node from establishing a cooperative closure with the counterparty. This will probably mean that if you do not have an exact copy of the state of the channel before the failure, you will have an invalid state that could cause the other node to assume it as an attempted fraud and use the penalty transaction. In this case, all funds will be lost. To avoid this undesirable situation a solution based on the high availability of postgresQL database [exists](https://github.com/gabridome/docs/blob/master/c-lightning_with_postgresql_reliability.md).
|
||||
|
||||
c-lightning is a lightweight, highly customizable and standard compliant implementation of the Lightning Network protocol. The way c-lightning extend the functionality is using Plugins, that are a powerful and easy way to do it. Mainly they are subprocesses that are initiated by lightningd daemon and can interact with lightningd in a different ways:
|
||||
We haven't tested this solution.
|
||||
|
||||
* Command line option that allows plugins to register their own command line options that are exposed through lightningd.
|
||||
* JSON-RPC command passthrough allows plugins to add their own commands to the JSON-RPC interface.
|
||||
* Event stream subscriptions provide plugins with a push-based notification mechanism about events from the lightningd.
|
||||
* Hooks are a primitive option that allows plugins to be notified about events in lightningd daemon and modify its behavior or pass custom behaviors.
|
||||
## Summary: Expanding the Lightning Network
|
||||
|
||||
A plugin may be written in any language, and communicates with lightningd through the plugin’s stdin and stdout. JSON-RPCv2 is used as protocol on top of the two streams, with the plugin acting as server and lightningd acting as client.
|
||||
You can use different implementations, plugins, mobile wallets, or backups to expand your Lightning experience.
|
||||
|
||||
Here is a updated list of [plugins](https://github.com/lightningd/plugins) available.
|
||||
## What's Next?
|
||||
|
||||
### Backup
|
||||
You've completed Learning Bitcoin from the Command Line, though if you never visited the [Appendices](A0_Appendices.md) of alternate setups, you can do so now.
|
||||
|
||||
As we mentioned on Closing a channel chapter your node needs to be online all the time otherwise your counterparty could send a previous channel status and steals your funds. However, there is another scenario in which funds can be lost, and that is when a hardware failure occurs that prevents the node from establishing a cooperative closure with the counterparty. This will probably imply that if you do not have an exact copy of the state of the channel before the failure, you will have an invalid state that could cause the other node to assume it as an attempted fraud and use the penalty transaction. In this case all funds will be lost. To avoid this undesirable situation exists a solution based on the high availability of postgresQL database [here](https://github.com/gabridome/docs/blob/master/c-lightning_with_postgresql_reliability.md). We haven't tested this solution.
|
||||
Otherwise, we encourage you to join developer communities, to program, and to put your new knowledge to work.
|
||||
|
||||
### Mobile wallets.
|
||||
|
||||
Today we know about two mobile lightning wallets that support c-lightning implementation. For iOS devices FullyNoded which is an open source iOS Bitcoin wallet that connects via Tor V3 authenticated service to your own full node. FullyNoded functionality is currently under active development and in early beta testing phase.
|
||||
|
||||
SparkWallet is a minimalistic wallet GUI for c-lightning, accessible over the web or through mobile and desktop apps for Android.
|
||||
|
||||
* [FullyNoded](https://github.com/Fonta1n3/FullyNoded/blob/master/Docs/Lightning.md) in TestFlight
|
||||
* [SparkWallet](https://github.com/shesek/spark-wallet)
|
||||
You can also help us here at Blockchain Commons with Issues or PRs for Learning Bitcoin or for any of our other repos, or you can even become a [Sponsor](https://github.com/sponsors/BlockchainCommons). You can also help out by spreading the word: let people know on social media about the course and what you learned from it!
|
||||
|
||||
Now get out there and make the Blockchain community a better place!
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user