7

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 ...


6

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 ...


6

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 ...


5

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 ...


5

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 ...


5

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: "channel_sat": 500000, "channel_total_sat": 500000, The channel_total_sat says that the capacity of your channel is 500k satoshi. Whereas the channel_sat says that you own 500k ...


5

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 ...


4

Here's a site with all the nodes on mainnet https://1ml.com


4

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 ...


4

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 ...


4

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 ...


3

OK, the three figures you care about here are: "msatoshi_total": 1600000, "msatoshi_to_us": 1599884, "their_channel_reserve_satoshis": 546, 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 ...


3

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 ...


3

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 ...


3

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), ...


3

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 \ libleveldb-dev \ python3-dev \ git \ gcc \ g+...


3

I am developer of https://lightblock.me It's a tool which lets you search for nodes which you wish to connect to, take the URI of the node you want to connect and use it with "connect" command.


3

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 03efccf2c383d7bf340da9a3f02e2c23104a0e4fe8ac1a880c8e2dc92fbdacd9df@144.76.235.20:9735 to peer with ...


3

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 ...


3

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 ...


3

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 ...


3

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: ./clightning-v0.7.2.1/bin/lightningd \ ...


3

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 ...


3

listpeers 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 ...


2

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 ...


2

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 ...


2

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 cd ...


2

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: ...


2

https://github.com/lightningnetwork/lnd/blob/8379bbaa9b259544c2c8591782a78d7384680b2a/lnwire/short_channel_id.go#L25-L43 // NewShortChanIDFromInt returns a new ShortChannelID which is the decoded // version of the compact channel ID encoded within the uint64. The format of // the compact channel ID is as follows: 3 bytes for the block height, 3 bytes // for ...


2

Use the RPC-Interface listfunds lightning-cli listfunds which lists all payment channels and UTXO. If you wish to have a more nicely display you can use this small tool: https://github.com/renepickhardt/lightning-helpers git clone https://github.com/renepickhardt/lightning-helpers.git cd lightning-helpers sudo make install listfunds it aggregates ...


Only top voted, non community-wiki answers of a minimum length are eligible