Let's disect this function call:
void sha256(struct sha256 *sha, const void *p, size_t size)
First we realize that the return value is void which means the function does not return the sha256 of the data. However we see that the first argument struct sha256 *sha is a pointer to a sha256 struct with the name sha. This suggests that the pointer that we pass ...
The first three scenarios are indeed possible, the last one is identical to the second.
This is called a collaborative close. It has the advantage of using a lower on-chain fee since the transactions are not time critical and the users get their coins back immediately (no dispute time).
If the other node is unresponsive (offline or doesn't sign a ...
With the current specification it is not possible to make a spontaneous payment to somebody on the network. However, this will likely change very soon, as it is one of the features on the roadmap and will be discussed in the specification group in November.
There are tricks on how to do a payment by delivering a large fee at the destination and continue ...
It is possible to run Lightning (both LND and c-lightning) with bitcoind pruned mode.
There is a lot of conflicting information online, because it became possible only recently in Bitcoin Core 0.16.0. The change that enabled txid lookups in pruned mode is BIP159.
There are already packages turning the pruned mode on when disk space is limited: Lightning ...
Plugins can be written in any language as long as a client library for that language exists.
The command line API and the Plugins communicate with lightningd over a unix domain socket using JSON RPC 2.0.
As far as I know no Java / Scala lib exists. I have started creating one at this pull request: https://github.com/ElementsProject/lightning/pull/2223
First of all welcome to the lightning network and keep asking excellent questions!
the important information is within the result of the listfunds command. For example here:
The channel_total_sat says that the capacity of your channel is 500k satoshi. Whereas the channel_sat says that you own 500k ...
As you mentioned your question is almost a duplicate of Why does my c-lightning node pay more than the invoice plus routing fees?
But you asked if there is a way of knowing how much you will overpay before you pay.
There are two ways :
You can configure lightningd with a maximum allowed fee for a payment. In that case your node won't use a route with ...
Natively c-lightning does not support paying invoices to yourself. But I have provided a trick described in this video: https://www.youtube.com/watch?v=Dwl-0cY6KkU&t=1s:
The trick is to create an invoice and then use getroute to find a route to some node and then go back (possible over another route with another getroute call). once you have such a ...
You basically answered the question already yourself. Besides the 1% channel reserve you as the funder are responsible for paying onchain fees in case you need to force close the channel by spending the commitment transaction.
C Lightning (and lightning nodes in general) are rather overestimating onchain fees as they cannot rely on the fact that the fees ...
Yes, there are basically two ways to avoid becoming a forwarding node:
Do not announce your channels, and keep them private
Reject any incoming HTLC that is not destined for you
The first is supported by the protocol itself, and is a proactive measure against forwarding any payment that is not destined for you, while the latter is a reactive measure and ...
listpeers returns data on nodes that you have connected with OR the nodes with which you have an open channel. If you have an open channel with a node, but the connection with that node has been lost, then the node will still appear in the output, with "connected": false. If you are connected with a node but do not have open channels, then it will ...
OK, the three figures you care about here are:
They have 1600000 - 1599884 millisatoshis, ie 116. But they need to keep at least 546 satoshis reserve, ie. 546,000. Until they do, we won't let them spend any.
Hence the warning when you created an invoice: there's ...
The protocol is purposefully built in such a way that DoS attacks are mitigated and reduced in impact. Each channel_announcement contains a reference to the funding transaction, and each node verifies that this funding transaction matches the information in the announcement. This makes the creation of a channel_announcement non-free, and binds some resources ...
Whether you run a full node or a lightweight node is a first layer question. It is a question about how you keep track about what happens on the blockchain. And even though this is important for you, the Lightning nodes that are communicating with your Lightning node do actually not care about it and in fact they don't even (have to) know about your Bitcoin ...
When I set up a lightning channel with a node, have I need to put some bitcoins in it?
Generally, yes. The person who initiates the channel creation process (i.e. the person that says "I want to open a channel with you") is the one who funds the channel.
Then, if I wanted to buy something using lightning network (for example, a sticker from Blockstream), ...
One lightweight alternative that I use quite often when setting up a Lightning node is spruned. The following will get you up and running:
Install some dependencies:
apt-get install -y git python3 \
In order for list nodes to provide some output you need to first connect to at least one peer on the network. Because the peer is giving you all the information from the gossip protocol about announced nodes and announced channels.
So do lightning-cli connect firstname.lastname@example.org:9735 to peer with ...
Currently, no. The receiver will reject an attempt for less than the requested amount and fail with incorrect_or_unknown_payment_details.
Each invoice has a payment_hash which a payment corresponds to, and the payment hash is generated from a random payment_preimage. This preimage must be unique for each payment, else it may be possible for any party along ...
Lightning invoices are signed by the node issuing the invoice in order to verify the signature we need to know the node id. Thus it is included in the invoice. Lightning nodes provide an API to decode invoices.
In c-lightning you can do (lnd below!)
lightning-cli decodepay ...
The TL;DR answer is: Yes it is totally possible, but as far as I know not implemented in any lightning node software at this time.
However I wish to elaborate a little bit. In your question you wrote:
The reasons could be that forwarding a payment will require it to forward the htlc, fulfill it as well as compute the onion for routing to the next node ...
It is complaining about not being able to find the bitcoin-cli binary of the Bitcoin Core installation (which is normal since you are running it from a location that is not on the $PATH hence it can't find it).
To fix this issue you can tell lightningd explicitly which binary to use as bitcoin-cli by doing this:
C-lightning does not save logs by default. One can ensure that the logs are saved to the drive by including log-file=<file_name>.log in the config file. When staring lightningd you can include the level of logs that the file has to capture by including --log-level=LEVEL, where LEVEL can be io, debug, info, unusual, or broken.
I have divided this post into three sections: Download, Verification and Installation to make it easier for people needing help with specific sections. The installation steps have been reproduced using Ubuntu 18.04 but can easily be used for other versions as well. Just make sure to download the specific pre-built binaries from the release page for the OS ...
listpeers show current peers, which means your node has been peered to other nodes that are shown in the command. It also means you are ready to fund channels with these nodes.
listnodes show nodes in your local network information.
After a lot of research I found the solution to my problem.
I didn't know this, but in nodejs there's a huge difference if your server runs on 127.0.0.1 and on 0.0.0.0.
It isn't said in the lightning-charge docs, but except the --port attribute you also have --host which you can set.
Starting lightning-charge with this line charged --api-token ...
when starting lightningd, you want to add the option:
--addr=[insert your IP address here]
so maybe when starting your lightning node, at your command line you would enter:
lightningd --alias DavideRivola --network bitcoin --log-level debug --port 9735 -ipaddr 192.168.1.1
Where 192.168.1.1 you would of course, put your own IP address.
Also, since you ...
You should be able to just stop the old version, download the new binaries, unpack them, and run them. On the first start lightningd will take care of updating the database if necessary and
Alternatively you can also compile the binaries yourself, like you did before the release:
git clone https://github.com/ElementsProject/lightning.git /opt/lightning
The specification of the short_channel_id describes the format as follows:
The short_channel_id is the unique description of the funding transaction. It is constructed as follows:
the most significant 3 bytes: indicating the block height
the next 3 bytes: indicating the transaction index within the block
the least significant 2 bytes: ...