62

Say, you and I want to open a payment channel. 1) Putting funds into Lightning We both send 0.05 BTC into a shared 2-of-2 multisig address. This requires a transaction on the Bitcoin blockchain. As a "balance sheet", we each create a 2-of-2 multisig transaction that pays out 0.05 BTC to you and 0.05 BTC to me. I sign one payout transaction and give it to ...


53

What are Channel Factories? In short, Channel Factories are payment channels that can be used to create more payment channels. That sounds weird, but it's really pretty simple: In a regular payment channel, you always have a transaction signed by all participating parties that's ready to commit the current channel balances to the block chain. For example,...


22

Note: This answer was written in Spring 2016 and has since been overtaken by an actual spec and multiple implementations. I'm hoping to update this answer shortly. Summarizing mostly from r/bitcoin: How are paths found in Lightning Network?, the currently suggested routing would be similar to the Border Gateway Protocol. At intervals, the following process ...


18

TL;DR: The security assumptions of using a LN channel for payments: The blockchain is functioning well (confirming transactions quickly) Channel nodes can keep secret data safe There aren't any significant bugs in the software With the Lightning network specifically, the security of the off-chain payment always depends on being able to take the ...


15

“Centralization” is now a word constantly repeated but is one that, generally speaking, no one tries to define accurately. ---Alexis de Tocqueville, Democracy in America, Vol.1, Part 1, ch.5. Lightning Network channels will naturally tend to form along the paths of economic activity. If you assume (as I do) that most economic activity in Bitcoin ...


15

Lightning forwards payments using a construction called a "hashed timelock contract" (HTLC), which allows the payee to redeem the transaction if they know the preimage to a given hash, or allows the payer to redeem the transaction after a given timeout. So eg if I'm selling you something for $2 over lightning, I might say "I'll tell you the sha256 preimage ...


13

The idea that Lightning will reduce the amount of fees going to miners is very common, and we probably won't know for sure until we actually try it. However, I'll try to provide some arguments as to why I don't believe it'll result in a drop in fees for miners, let alone a drop in hashrate. I think the idea that Lightning will drain transaction fees from ...


12

Two issues with Bitcoin's design Scalability of everyone checks everything Bitcoin is a gossip network: P2P nodes connect mostly randomly to each other and pass-on new information to each other as they receive it. That way, information floods through the network quickly: each step further increases the nodes that were informed exponentially (until most are)...


12

There is no substitute in terms of security and trust for running a full node. There are different "lightweight client" concepts. Some of them are... BIP37 (bloom filter): [minus] With current used false-positive rates, peers may learn all wallet addresses [minus] Usually done over an unencrypted channel (p2p 8333), ISPs, etc. learn also all your ...


12

It takes about 200 vbytes to spend from a Lightning Network (LN) Hashed Time-Locked Contract (HTLC) output used for routing a payment. At the default minimum feerate of 10 nBTC/vbyte, that makes it uneconomical to attempt to claim a routed micropayment below about 2,000 nBTC ($0.008 USD at $4,000 USD/BTC). As fees rise, larger and larger micropayments ...


11

In the image below from Rusty Russell's Deployable Lightning paper, you can see a visualization of the commitment transactions and their outputs: For each payment in a channel, there are two commitment transactions generated, one for Alice and one for Bob. Both Alice and Bob sign both commitment transactions, so they're both valid transactions (although ...


11

Lightning allows you to lock coins between two wallets, and then send special transactions between each wallet which only become "real" when they are added to the blockchain. But you don't do that, because on-chain costs you more fees, so you keep updating the transactions between each other. Lightning not only makes it possible to send transactions off-...


10

A sidechain has its own blockchain which is coupled to the Bitcoin blockchain via a two-way peg. This allows tokens on the Bitcoin blockchain to be frozen in order to make new tokens available on the sidechain. In turn tokens on the sidechain can be either destroyed or frozen to move money back to the Bitcoin blockchain. Lightning Network is not a sidechain....


10

If worried about the original closing transaction having too high of fees: The signed closing transaction that you're worried about (with too high of fees) has not yet been broadcast to the network, so no harm no foul (yet). If the two parties are cooperative, they can just agree to sign a new transaction with lower fees and broadcast that to close out ...


10

It's not a mistake, it's literally a thousandth of a satoshi. A satoshi is the smallest unit for bitcoin, but lightning can transact with even smaller units while channels are open. The amount is rounded down to the nearest satoshi when the channel is closed and broadcast to the blockchain to adhere to bitcoins limit.


9

How will the lightning network handle lightweight clients? Most steps during the payment process in an LN channel don't actually require full knowledge of the blockchain or even the unconfirmed (mempool) transactions. This is because the transactions involved deal with 2-of-2 multisig scripts, where both parties have to sign off on each transaction to make ...


9

TCP and other stream based protocols do not have a 1-to-1 correlation of application level messages and IP packets. If you call send() 3 times, it might result in sending a single IP packet over the wire (eg, due to Nagle's algorithm which is enabled by default), it might get sent individually as 3 packets, as you would expect from a packet oriented protocol ...


9

A very low value output in Bitcoin (or any similar system) has zero actual value because the cost in fees to spend it would be equal to or greater than the coins it provides. Like someone writing you a check for $0.01, you'd be best off throwing it out because the time it takes to handle it (much less the tiny risk that it bounces and causes you a bounced ...


8

Below describes these points during what's planned to be normal operation. Once a channel needs to be torn down because of a problem with one of the nodes (evil or accidental) some of these answers are a little different. privacy - Privacy is not a linear scale, but there are a few factors that clearly improve privacy: Very few transactions actually end up ...


8

The lightning network is comprised of bi-directional payment channels between two nodes. This means that either one of those nodes should be able to initialize a transaction at any time. These transactions require both parties to be actively participating in updating the smart contracts that keep the channel alive. If one party fails to respond, they are ...


8

They're exactly the same number; one is written in little endian notation and the other is big endian. Notice that the bytes (two-hex-digit pairs) are exactly reversed from one to the other. Block explorers like blockchain.info usually expect big-endian for block hashes. The proof-of-work requirement means that the most significant bits have to be zero, ...


7

When you open a lightning channel, you will receive from the other person their revocation_basepoint, and for each commitment transaction, you will send to the other person a per_commitment_point. The revocation_basepoint has a revocation_basepoint_secret which is a secret key that the other person keeps to themselves. The per_commitment_point has a ...


7

Yes, but just running a lightning node is not enough. In order for your node to be able to earn fees, it has to have payments passing through it. For this you need to have a routing node, which has at least 2 open channels (where is payment coming from, where is payment going). The more open channels your node has, the more it will be chosen by the routing ...


7

I agree with Alex Bosworth and I have pointed this out about one year ago when I have filed an issue about the strategy used by the LND autopilot which basically looks for nodes with a high channel count. This is one of the reasons why I have created a standalone autopilot and provided an integration for c-lightning. There are several kind of information we ...


7

Millisatoshi's are the unit in which channel balances are accounted for. They are a necessary accounting unit, if the aim is to enable very small lightning payments amounts, which represents a protocol design choice. If I wish to send, let's say, 1 satoshi on lightning, the routing fee should necessarily be denominated in a sub-satoshi unit, or else fees ...


7

If you want to route a lightning payment via your node, your channel(s) must hold at least a balance of the to-be-routed amount, right? If not, your node by definition cannot be chosen as a potential routing path. yes this is true. If you don't have enough bitcoin to forward you cannot forward a payment. So, in the future, when we dream about mass ...


7

Generally if you read BOLT 07 you will see that lightning nodes and channels can either be private or public. This is independent of the fact if they run on tor or not. The node announcment message explicitly supports announcing that it runs on tor as written in the BOLT 07 The following address descriptor types are defined: 1: ipv4; data = [4:...


6

The obvious one would be side chains, the idea being that the transactions on the side chain would be off the main chain. Most other scaling solutions are either on-chain or centralized. For example, segwit and block size increases are on-chain and using a service like coinbase to move coins off-chain are clearly centralized.


6

Calling Lightning a Proof-of-Stake system is orthogonal to the concept usually labeled as PoS. Him having done so will just generate loads of confusion. What we usually describe as PoS is a mechanism to achieve distributed consensus among a network of participants. Staking there is providing updates to the whole network's state, where you earn fees for ...


6

Lightning payment channels are established by two parties Alice and Bob paying into a 2-of-2 multisignature address. Concurrently, they create two "exit-transactions", one for each participant which pay out the current allotment of the payment channel, txAliceExit_1 and txBobExit_1. These exit transactions lock the fund of the executing party for some blocks....


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