Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: x3m on September 24, 2017, 09:48:53 PM



Title: Segwit and Lighting network
Post by: x3m on September 24, 2017, 09:48:53 PM
I have read that Segwit is a necessary condition for lighting network. In other works LN cannot be released without Segwit.
Where can I find a technical explanation about this?
Thanks.


Title: Re: Segwit and Lighting network
Post by: achow101 on September 24, 2017, 10:02:53 PM
The Lightning Network uses segwit because purely segwit transactions are not vulnerable to transaction malleability. This means that the transaction id for such a transaction cannot change and that property makes LN work much better. This need is explained in Appendix A of Lightning Network paper.


Title: Re: Segwit and Lighting network
Post by: anonymoustroll420 on September 24, 2017, 10:03:53 PM
It doesn't necessarily need segwit, rather it needs a fix for transaction malleability, which segwit includes. LN uses advanced smart contracts which don't work well when the transactions can be malleated. There are other proposed fixes for malleability other than segwit, however segwit is the most tested solution, though segwit is not the absolute cleanest solution, in particular the fee discount makes spam a bit easier, but in exchange gives a softfork blocksize increase.


Title: Re: Segwit and Lighting network
Post by: x3m on September 25, 2017, 07:50:36 PM
Thanks anonymoustroll420 and achow101 for your replies.
@anonymoustroll420: strictly speaking it is not a blocksize increase. Stuff has been moved in another place to make room for other transactions.
As far as I know blocksize is the same and that's the reason for "2x or not 2x". But this is another story.


Title: Re: Segwit and Lighting network
Post by: achow101 on September 25, 2017, 08:44:36 PM
@anonymoustroll420: strictly speaking it is not a blocksize increase. Stuff has been moved in another place to make room for other transactions.
As far as I know blocksize is the same and that's the reason for "2x or not 2x". But this is another story.
No, that is strictly false. Segwit is a block size increase; the size of a block message can be up to 4 MB now. 2x is yet another block size increase; it makes the maximum 8 MB.


Title: Re: Segwit and Lighting network
Post by: HeRetiK on September 25, 2017, 09:31:03 PM
@anonymoustroll420: strictly speaking it is not a blocksize increase. Stuff has been moved in another place to make room for other transactions.
As far as I know blocksize is the same and that's the reason for "2x or not 2x". But this is another story.
No, that is strictly false. Segwit is a block size increase; the size of a block message can be up to 4 MB now. 2x is yet another block size increase; it makes the maximum 8 MB.

To expand on that: Legacy nodes "perceive" SegWit blocks as staying within blocksize limitations, however the "physical" size of SegWit blocks can reach the aforementioned 4MB (ie. the "Stuff that has been moved in another place to make room for other transactions" is still part of the block, propagated over the network and stored in the blockchain, but ignored by legacy nodes).


Title: Re: Segwit and Lighting network
Post by: banake on September 26, 2017, 08:08:48 AM
Segwit is soft fork of token. Soft fork is used to add some advantage features for 1 token.
Lighting network just is a feature.
But LN is a over powerful feature.
Lightning Network. By creating a network of these two-party ledger entries, it is possible to find a path across the network similar to routing packets on the internet. The nodes along the path are not trusted, as the payment is enforced using a script which enforces the atomicity (either the entire payment succeeds or fails) via decrementing time-locks.

With LN, Transactions for the Future:

- Instant Payments. Lightning-fast blockchain payments without worrying about block confirmation times. Security is enforced by blockchain smart-contracts without creating a on-blockchain transaction for individual payments. Payment speed measured in milliseconds to seconds.

- Scalability. Capable of millions to billions of transactions per second across the network. Capacity blows away legacy payment rails by many orders of magnitude. Attaching payment per action/click is now possible without custodians.

- Low Cost. By transacting and settling off-blockchain, the Lightning Network allows for exceptionally low fees, which allows for emerging use cases such as instant micropayments.

- Cross Blockchains. Cross-chain atomic swaps can occur off-chain instantly with heterogeneous blockchain consensus rules. So long as the chains can support the same cryptographic hash function, it is possible to make transactions across blockchains without trust in 3rd party custodians.


Title: Re: Segwit and Lighting network
Post by: Samarkand on September 26, 2017, 09:07:25 AM
...

- Cross Blockchains. Cross-chain atomic swaps can occur off-chain instantly with heterogeneous blockchain consensus rules. So long as the chains can support the same cryptographic hash function, it is possible to make transactions across blockchains without trust in 3rd party custodians.

Could you expand a bit more on how this actually works?
Or alternatively link me a good explanation?

I´m really interested in the concept of cross-chain atomic swaps, but I have trouble
wrapping my head around the concept.

How would this affect the use cases of currencies like LTC that are supposed to support
atomic swaps with BTC?


Title: Re: Segwit and Lighting network
Post by: x3m on September 26, 2017, 12:33:00 PM
@anonymoustroll420: strictly speaking it is not a blocksize increase. Stuff has been moved in another place to make room for other transactions.
As far as I know blocksize is the same and that's the reason for "2x or not 2x". But this is another story.
No, that is strictly false. Segwit is a block size increase; the size of a block message can be up to 4 MB now. 2x is yet another block size increase; it makes the maximum 8 MB.

Cool, thanks for your reply.
When has it been released? I've compared bitcoin core 0.15.0.1 with 0.14.1 and MAX_BLOCK_WEIGHT (should be the right constant to check) is the same.
Does anyone know where to find a document, pdf, slides, ... with a graphical comparison schema of the differences before and after segwit?


Title: Re: Segwit and Lighting network
Post by: achow101 on September 26, 2017, 02:42:16 PM
Cool, thanks for your reply.
When has it been released? I've compared bitcoin core 0.15.0.1 with 0.14.1 and MAX_BLOCK_WEIGHT (should be the right constant to check) is the same.
Does anyone know where to find a document, pdf, slides, ... with a graphical comparison schema of the differences before and after segwit?
Segwit and Segwit2x are not the same thing. Segwit has already activated, segwit2x has not. Bitcoin Core does not support segwit2x so you won't find any code related to segwit2x in the Bitcoin Core codebase.


Title: Re: Segwit and Lighting network
Post by: x3m on September 26, 2017, 03:10:31 PM
Cool, thanks for your reply.
When has it been released? I've compared bitcoin core 0.15.0.1 with 0.14.1 and MAX_BLOCK_WEIGHT (should be the right constant to check) is the same.
Does anyone know where to find a document, pdf, slides, ... with a graphical comparison schema of the differences before and after segwit?
Segwit and Segwit2x are not the same thing. Segwit has already activated, segwit2x has not. Bitcoin Core does not support segwit2x so you won't find any code related to segwit2x in the Bitcoin Core codebase.

Yes I know, but I meant only segwit. I know Core is not supporting 2x.
So which is the first version released by Core with segwit? 
Same thing for comparison schema or slide ... are there some pictures showing block data structure and verification rules changed before and after segwit?
Thanks.


Title: Re: Segwit and Lighting network
Post by: achow101 on September 26, 2017, 03:36:19 PM
Yes I know, but I meant only segwit. I know Core is not supporting 2x.
So which is the first version released by Core with segwit?  
Bitcoin Core 0.13.0/.1 (0.13.0 had it implemented but had no deployment mechanism for segwit. 0.13.1 had the actual deployment parameters)

Block weight is a segwit specific thing and is only implemented and defined in segwit.

Same thing for comparison schema or slide ... are there some pictures showing block data structure and verification rules changed before and after segwit?
Thanks.
Read BIPs 141 (https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki), 143 (https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki), and 144 (https://github.com/bitcoin/bips/blob/master/bip-0144.mediawiki)