Nefelibato (OP)
Jr. Member
Offline
Activity: 42
Merit: 6
|
|
January 18, 2023, 10:06:54 PM |
|
What is the difference between a Layer 2 and a Sidechain? I have not found any article that distinguishes them well.
|
|
|
|
jackg
Copper Member
Legendary
Offline
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
|
|
January 18, 2023, 10:48:54 PM |
|
If I have it right, a sidechain can host layer 3 (things like applications that run on layer 2 tokens) while layer 2 tokens can't without one.
A sidechain often normally refers to tokens and ignores other things (like contracts on the lightning network) which are also layer 2.
|
|
|
|
HeRetiK
Legendary
Offline
Activity: 3150
Merit: 2184
Playgram - The Telegram Casino
|
|
January 18, 2023, 11:35:33 PM |
|
Sidechains run on separate blockchains while layer 2 solutions in general not necessarily require one. For example the channel states of Lightning Network are managed by each node separately, without the need for a common blockchain (except for settlement on the main layer, when opening and closing a channel).
Arguably sidechains are a kind of layer 2 solution, though I'm not quite sure if all of them fit the bill, technically speaking.
|
|
|
|
▄▄███████▄▄███████ ▄███████████████▄▄▄▄▄ ▄████████████████████▀░ ▄█████████████████████▄░ ▄█████████▀▀████████████▄ ██████████████▀▀█████████ █████████████████████████ ██████████████▄▄█████████ ▀█████████▄▄████████████▀ ▀█████████████████████▀░ ▀████████████████████▄░ ▀███████████████▀▀▀▀▀ ▀▀███████▀▀███████ | ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ Playgram.io ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ | ▄▄▄░░ ▀▄ █ █ █ █ █ █ █ ▄▀ ▀▀▀░░
| │ | ▄▄▄███████▄▄▄ ▄▄███████████████▄▄ ▄███████████████████▄ ▄██████████████▀▀█████▄ ▄██████████▀▀███▄██▐████▄ ██████▀▀████▄▄▀▀█████████ ████▄▄███▄██▀█████▐██████ ██████████▀██████████████ ▀███████▌▐██▄████▐██████▀ ▀███████▄▄███▄████████▀ ▀███████████████████▀ ▀▀███████████████▀▀ ▀▀▀███████▀▀▀ | | │ | ██████▄▄███████▄▄████████ ███▄███████████████▄░░▀█▀ ███████████░█████████░░█ ░█████▀██▄▄░▄▄██▀█████░█ █████▄░▄███▄███▄░▄██████ ████████████████████████ ████████████████████████ ██░▄▄▄░██░▄▄▄░██░▄▄▄░███ ██░░░█░██░░░█░██░░░█░████ ██░░█░░██░░█░░██░░█░░████ ██▄▄▄▄▄██▄▄▄▄▄██▄▄▄▄▄████ ███████████████████████ ███████████████████████ | | │ | ► | |
[/
|
|
|
pooya87
Legendary
Offline
Activity: 3668
Merit: 11107
Crypto Swap Exchange
|
|
January 19, 2023, 04:54:34 AM |
|
Second layer as the name suggests is a "layer" and like any layers it is made on top of a main "bed" which in case of bitcoin is the main-net and its blockchain. That means second layer is a network that completely relies on the main network it is built on and if the main network has any problems (eg. it dies) the second layer will experience problems (eg. it dies too). Example: Lightning Network
A side-chain on the other hand is as the name suggests a "chain", a separate chain that has a "link" to another chain but it doesn't completely relies on it. They are usually "pegged" to the main network. That means any problems in the main network may not completely affect the side-chain. Side-chains can even have their own mining algorithm and a stand-alone blockchain. Example: Rootstock, Blockstream's Liquid,...
This difference is the reason why 1 LN bitcoin is exactly 1 bitcoin but 1 sidechain bitcoin doesn't have to be 1 bitcoin, it could be 1000 wrapped-bitcoin or 0.5.
|
|
|
|
garlonicon
Copper Member
Legendary
Offline
Activity: 938
Merit: 2231
|
|
January 19, 2023, 09:08:35 AM |
|
This difference is the reason why 1 LN bitcoin is exactly 1 bitcoin but 1 sidechain bitcoin doesn't have to be 1 bitcoin, it could be 1000 wrapped-bitcoin or 0.5. The only reason why one sidechain Bitcoin is not one Bitcoin is that you cannot form sidechain transactions as a regular Bitcoin transactions. Because if we would have transaction joining, then it would be possible to join all sidechain transactions into a single mainchain transaction. When it comes to public keys, and regular signatures, it is definitely possible to join them. The bottleneck could be in case of script-based outputs, but since we have Taproot, it is possible to join revealed public keys, and then push on-chain only the latest script. Also, a lot of script operations are perfectly defined in ECDSA, for example if you have OP_ADD, you can just add public keys. That means, some script-based outputs could be rewritten into Schnorr-signatures-based outputs.
|
|
|
|
BlackHatCoiner
Legendary
Offline
Activity: 1736
Merit: 8451
Fiatheist
|
|
January 19, 2023, 10:59:51 AM |
|
Maybe a broad distinction is that a sidechain creates currency, while second layer solely uses already existent currency?
Another distinction is that layer 2 solutions are not trust requiring. In the Lightning Network for example, there is the penalty mechanism which ensures your partners can't cheat you after you've opened up a channel. Sidechains on the other hand are conceptionally trust requiring. You need to trust 11 out of the 15 co-signers of the Liquid federation.
|
|
|
|
HeRetiK
Legendary
Offline
Activity: 3150
Merit: 2184
Playgram - The Telegram Casino
|
|
January 19, 2023, 11:55:49 AM |
|
Maybe a broad distinction is that a sidechain creates currency, while second layer solely uses already existent currency?
Both OMNI and Counterparty run on Bitcoin as layer 2 protocols without a sidechain. Another distinction is that layer 2 solutions are not trust requiring. In the Lightning Network for example, there is the penalty mechanism which ensures your partners can't cheat you after you've opened up a channel. Sidechains on the other hand are conceptionally trust requiring. You need to trust 11 out of the 15 co-signers of the Liquid federation.
Liquid is just one example though. Rootstock on the other hand uses merged mining. That is the say, since sidechains use blockchains of their own they can run on all sorts of consensus algorithms, including PoW-based ones.
|
|
|
|
▄▄███████▄▄███████ ▄███████████████▄▄▄▄▄ ▄████████████████████▀░ ▄█████████████████████▄░ ▄█████████▀▀████████████▄ ██████████████▀▀█████████ █████████████████████████ ██████████████▄▄█████████ ▀█████████▄▄████████████▀ ▀█████████████████████▀░ ▀████████████████████▄░ ▀███████████████▀▀▀▀▀ ▀▀███████▀▀███████ | ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ Playgram.io ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ | ▄▄▄░░ ▀▄ █ █ █ █ █ █ █ ▄▀ ▀▀▀░░
| │ | ▄▄▄███████▄▄▄ ▄▄███████████████▄▄ ▄███████████████████▄ ▄██████████████▀▀█████▄ ▄██████████▀▀███▄██▐████▄ ██████▀▀████▄▄▀▀█████████ ████▄▄███▄██▀█████▐██████ ██████████▀██████████████ ▀███████▌▐██▄████▐██████▀ ▀███████▄▄███▄████████▀ ▀███████████████████▀ ▀▀███████████████▀▀ ▀▀▀███████▀▀▀ | | │ | ██████▄▄███████▄▄████████ ███▄███████████████▄░░▀█▀ ███████████░█████████░░█ ░█████▀██▄▄░▄▄██▀█████░█ █████▄░▄███▄███▄░▄██████ ████████████████████████ ████████████████████████ ██░▄▄▄░██░▄▄▄░██░▄▄▄░███ ██░░░█░██░░░█░██░░░█░████ ██░░█░░██░░█░░██░░█░░████ ██▄▄▄▄▄██▄▄▄▄▄██▄▄▄▄▄████ ███████████████████████ ███████████████████████ | | │ | ► | |
[/
|
|
|
BlackHatCoiner
Legendary
Offline
Activity: 1736
Merit: 8451
Fiatheist
|
|
January 19, 2023, 12:13:37 PM |
|
Both OMNI and Counterparty run on Bitcoin as layer 2 protocols without a sidechain. Don't know about OMNI, but doesn't Counterparty require you to burn bitcoin? Isn't it more like a transitioning to another currency, rather than just creation of currency? Liquid is just one example though. Rootstock on the other hand uses merged mining. That is the say, since sidechains use blockchains of their own they can run on all sorts of consensus algorithms, including PoW-based ones. Correct. Rootstock isn't trust requiring. So, what's the broad distinction between L2 and sidechain?
|
|
|
|
Nefelibato (OP)
Jr. Member
Offline
Activity: 42
Merit: 6
|
|
January 19, 2023, 12:21:29 PM |
|
Based on what I have read I think this is the main difference: A sidechain is an independent, EVM-compatible blockchain that runs parallel and interacts with the mainnet through bridges. As they use a separate consensus mechanism and are not secured by layer 1, they are not technically considered layer 2. And if we also introduce the State channels in the comparison? I deduce that they are pay channels. Are they not the same as an atomic swap?
|
|
|
|
garlonicon
Copper Member
Legendary
Offline
Activity: 938
Merit: 2231
|
|
January 19, 2023, 12:23:32 PM |
|
So, what's the broad distinction between L2 and sidechain? Simple, it is in the name. L2 has no chain. Also, LN is a layer "one and a half", because you cannot send coins directly in LN, without touching the first layer, if someone has no channel. The true second layer would allow locking for example 1 BTC, and splitting it between thousands of channels, without any on-chain transactions. Also, because of that bottleneck, you cannot build another layer on top of LN, because it would still require on-chain interaction. EVM-compatible blockchain It is not required. It could be ECDSA-compatible, and it will be sufficient.
|
|
|
|
HeRetiK
Legendary
Offline
Activity: 3150
Merit: 2184
Playgram - The Telegram Casino
|
Both OMNI and Counterparty run on Bitcoin as layer 2 protocols without a sidechain. Don't know about OMNI, but doesn't Counterparty require you to burn bitcoin? Isn't it more like a transitioning to another currency, rather than just creation of currency? IIRC Counterparty burned bitcoins for the initial distribution of their XCP token, maybe they've burned more coins since then but that's beside the point. When I refer to OMNI and Counterparty creating a currency of their own I don't mean their native tokens (if you can call them that) but I mean the tokens that are created using those native tokens. USDT in the case of OMNI.... and... sigh... Rare Pepes in the case of Counterparty, for example. The denomination, amount, value etc. of these tokens being largely independent of the value of the Bitcoin transactions underneath. Liquid is just one example though. Rootstock on the other hand uses merged mining. That is the say, since sidechains use blockchains of their own they can run on all sorts of consensus algorithms, including PoW-based ones. Correct. Rootstock isn't trust requiring. So, what's the broad distinction between L2 and sidechain? Like I said above: I think the clearest distinction is that sidechains run on separate blockchains while layer 2 solutions in general not necessarily require one. Or another view: Layer 2 can be seen like the layers of the OSI model, eg. HTTP running on top of TCP/IP (I believe that this is even the root of the L2 nomenclature in the first place?) while sidechains connected to a main chain can be compared to LANs connected to the Internet. Fun thing is this analogy even accounts for LANs requiring protocol layers on top of the base layer to function, just as sidechains need more than just basic transactions. The true second layer would allow locking for example 1 BTC, and splitting it between thousands of channels, without any on-chain transactions. Also, because of that bottleneck, you cannot build another layer on top of LN, because it would still require on-chain interaction.
I believe what you are describing is pretty much what is described in the channel factory proposal for a potential layer between LN and the base layer: https://tik-old.ee.ethz.ch/file//a20a865ce40d40c8f942cf206a7cba96/Scalable_Funding_Of_Blockchain_Micropayment_Networks%20(1).pdfApart from that I believe you can still add another layer on top of LN in the form of colored coins via LN? Though the viability of that seems to be controversial. And if we also introduce the State channels in the comparison? I deduce that they are pay channels. Are they not the same as an atomic swap?
No, atomic swaps take place across blockchains.
|
|
|
|
▄▄███████▄▄███████ ▄███████████████▄▄▄▄▄ ▄████████████████████▀░ ▄█████████████████████▄░ ▄█████████▀▀████████████▄ ██████████████▀▀█████████ █████████████████████████ ██████████████▄▄█████████ ▀█████████▄▄████████████▀ ▀█████████████████████▀░ ▀████████████████████▄░ ▀███████████████▀▀▀▀▀ ▀▀███████▀▀███████ | ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ Playgram.io ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ | ▄▄▄░░ ▀▄ █ █ █ █ █ █ █ ▄▀ ▀▀▀░░
| │ | ▄▄▄███████▄▄▄ ▄▄███████████████▄▄ ▄███████████████████▄ ▄██████████████▀▀█████▄ ▄██████████▀▀███▄██▐████▄ ██████▀▀████▄▄▀▀█████████ ████▄▄███▄██▀█████▐██████ ██████████▀██████████████ ▀███████▌▐██▄████▐██████▀ ▀███████▄▄███▄████████▀ ▀███████████████████▀ ▀▀███████████████▀▀ ▀▀▀███████▀▀▀ | | │ | ██████▄▄███████▄▄████████ ███▄███████████████▄░░▀█▀ ███████████░█████████░░█ ░█████▀██▄▄░▄▄██▀█████░█ █████▄░▄███▄███▄░▄██████ ████████████████████████ ████████████████████████ ██░▄▄▄░██░▄▄▄░██░▄▄▄░███ ██░░░█░██░░░█░██░░░█░████ ██░░█░░██░░█░░██░░█░░████ ██▄▄▄▄▄██▄▄▄▄▄██▄▄▄▄▄████ ███████████████████████ ███████████████████████ | | │ | ► | |
[/
|
|
|
Nefelibato (OP)
Jr. Member
Offline
Activity: 42
Merit: 6
|
|
January 19, 2023, 07:12:17 PM |
|
Sidechains are not protected by Layer 1 and they have their own consensus, unlike Layer 2. No, atomic swaps take place across blockchains.
The Technology Behind Atomic Swaps A valid transaction requires a signature. This signature can only be created by the person that has access to the private key. When you send a transaction you usually sign it and broadcast it to the network afterward. HTLCs are based on a technology called state channels. All you need to know is that they allow you to exchange signed transactions securely. Only once the participants decide they are done transacting, the final state is broadcast to the blockchain. The “Hashed” part of HTLC means that a hash serves as a lock for the contract, to protect it from a third party accessing it. The “Timelock” part refers to the contract having an expiration date. Two conditions must be met to perform an Atomic Swap between two crypto assets: Both assets and their underlying blockchain need to support the same hashing algorithm, like SHA-256 in the case of Bitcoin and both blockchains need to support some kind of programmability that allows an HTLC to be deployed.
|
|
|
|
NotATether
Legendary
Offline
Activity: 1820
Merit: 7476
Top Crypto Casino
|
|
January 19, 2023, 08:25:00 PM |
|
A lot of protocols, but time will tell which ones are good for packaging and sending off to normal users.
The truth is, it doesn't take much to cover the average bitcoin user:
- The Layer 1 (obviously) - BIP39 seed phrases - Standardized design specs for hardware wallets - Lightning Network nodes (someone still needs to make a swarm of watchtowers that anyone can connect to, to solve the trust problems completely) - Atomic swaps, between any two coins. Using something inside DeFi will work - A protocol featuring high scalability but low confidentiality to be used as the network for payment cards
|
|
|
|
Nefelibato (OP)
Jr. Member
Offline
Activity: 42
Merit: 6
|
|
January 20, 2023, 05:41:05 PM |
|
My opinion is that Bitcoin requires 4 main characteristics, decentralized, secure, fast and cheap. DeFi and other things are fine in layers 2 and other protocols.
|
|
|
|
n0nce
|
|
January 20, 2023, 09:46:06 PM Merited by NotATether (1) |
|
Honestly, a sidechain can also be considered a second-layer technology. Since it relies on the blockchain (L1) and is linked to it. I think that is also the reason why there is no definition of what the difference between the two is. It's a subset / set element of 'L2'. So, basically something like this.
|
|
|
|
Nefelibato (OP)
Jr. Member
Offline
Activity: 42
Merit: 6
|
|
February 04, 2023, 03:42:23 PM |
|
Your security doesn't depend on layer 1, that's the main difference.
|
|
|
|
n0nce
|
|
February 06, 2023, 03:24:13 AM |
|
Your security doesn't depend on layer 1, that's the main difference.
Difference between what? In which case does the security not depend on layer 1? To the best of my knowledge, all the items in my chart depend on layer 1 for security.
|
|
|
|
ABCbits
Legendary
Offline
Activity: 3094
Merit: 8186
Crypto Swap Exchange
|
|
February 06, 2023, 12:05:50 PM |
|
To the best of my knowledge, all the items in my chart depend on layer 1 for security.
But security of federated or centralized sidechain doesn't heavily rely on layer 1. For example, security of Liquid sidechain heavily involve "Functionaries". These functionaries each serve two roles on the network - as blocksigners they operate the Liquid sidechain, and as watchmen they secure Bitcoins held by the Network.
|
|
|
|
garlonicon
Copper Member
Legendary
Offline
Activity: 938
Merit: 2231
|
|
February 06, 2023, 05:14:45 PM Merited by dkbit98 (1), n0nce (1) |
|
Your security doesn't depend on layer 1, that's the main difference. Imagine a sidechain, where coins are transferred from mainchain to sidechain by signing them, and they are transferred back by moving them on Bitcoin (and that would destroy them automatically on the sidechain). And imagine that such sidechain is Merge Mined with Bitcoin, so it is possible to mine both at the same time, with the same computing power. In this case, your security strictly depends on layer one, because it is constantly observed to know about all peg-ins and peg-outs. So, again, the difference is in the name: "Each sidechain has its own chain".
|
|
|
|
Nefelibato (OP)
Jr. Member
Offline
Activity: 42
Merit: 6
|
|
February 07, 2023, 01:39:06 PM |
|
Well, because it has its own chain with its own consensus, it does not depend on the security of the main chain. If it merges with the main chain it is no longer a sidechain. Polygon is another example of a sidechain.
|
|
|
|
|