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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 \
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 ...
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 email@example.com:9735 to peer with ...
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: ...
// 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 ...
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
sudo make install
it aggregates ...
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 ...
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 ...
Short answer: yes.
However that depends on the question if liquid supports segwit and creation of a lightning network. I have not looked at the details of liquid but I believe it does.
The lightning network protocol itself is pretty agnostic to the underlaying blockchain. If you look at the channel announcement messages defined in BOLT7 you will see that ...
First of all yes these are your earnings from routing. You can check lightning-cli listforwards to get a list (in json) to see through wich channel routings have been attempted and settled or failed. In particular you can analyze the routing fees per channel from the output of that command.
If you are interested in channel balances you can use lightning-cli ...
In your c-lightning node you have configured your maximum fee rate which is used by the pay command to do the payment.
The BOLT04 describes how overpaying up to twice the amount to obfuscate payments in order to have better privacy is part of the protocol:
if the amount paid is more than twice the amount expected:
SHOULD fail the HTLC.
I found it. The port 9735 is not open to the public.
Go to google cloud console
Home -> VPC network -> Firewall rules
+ Create firewall rule:
Name Type Targets Filters Protocols / ports Action Priority Network
lightning Ingress Apply to all IP ranges: 0.0.0.0/0 tcp:9735 Allow 1000 default
LND is experimenting with the new Neutrino BIP157-style SPV at the moment. Check out their repo for news.
Both Bitcoin Lightning Wallet and Eclair on Android use a trusted server for syncing with the network.
BIP-37-style SPV is not a good choice for anyone (because of privacy issues), but particularly not for Lightning wallets, because it is very easy ...
I thought we had that question before but the only one similar I could find was this one 1ML shows larger number of nodes comparing to other lightning network explorers which was not quite the same.
So to answer your question: listchannels depicts information your node knows from the gossip protocol. If your node is new this could take some time which is ...
c-lightning uses this code to obtain the node's private key from the hsm_secret.
I've came up with a way to do the same using Python and posted my highly-commented tutorial-like code in this gist.
Basically you have to call an hkdf function with the hsm_secret contents, a salt which will usually be zero, \x00, and the label "nodeid".
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 ...