Text title: "side chains and state channels: different fireworks"
Blue fox notes
In the technical terms of blockchain, many concepts are often used in confusion. One of them is the side chain and the state channel. Both are blockchain extension solutions. But in the use of the community, it is often used interchangeably. So what are the differences, what are the pros and cons, and who is better? This article will help answer your questions. Vasa, translated by "Moqi" of "blue fox notes".
The terms "status channel" and "side chain" are often used interchangeably in the ethereum community, leading to confusion among ordinary users. Today we'll get to the bottom of this. Make a cup of coffee first, because it will take some time.
The main purpose of this article is clear:
What is a state channel?
What is a side chain?
Then we compare:
What problem are they both trying to solve?
Which is the better extension solution?
Here we go.
What is a state channel?
The state channel is a very broad and simple way to think about the problem: think about the transactions that will likely take place on the blockchain and execute them off the chain without significantly increasing the risk to any of the participants.
The most famous example of this strategy is the bitcoin payment channel concept, which allows instant, low-cost payments to be sent directly between the parties.
A state channel is a generic form of a payment channel and applies the same idea to any type of state change that is normally performed on a blockchain. (blue fox note: that is to say, the payment channel is only a special form of the state channel, it is not just payment)
Moving these interactions down the chain without requiring any additional trust can result in significant improvements in cost and speed. The status channel will be a key part of extending the blockchain technology to support higher-level users.
The basic composition of the state channel is very simple:

Two-way state channel
1. Part of the block chain state is locked through multiple signatures or some kind of smart contract, so that the specific set of participants must fully agree with each other to update their state.2. Participants build and sign transactions that can be submitted to the blockchain to update the status between them, which was only temporarily kept inside. Each new status update is "higher" than the previous one.3. Finally, the participants submit the status back to the blockchain, which closes the status channel and unlocks the status again.That's all. If the updated "status" between participants is the balance of the cryptocurrency, then we have a payment channel. Steps 1 and 3 to open and close the channel involve blockchain operations.But step 2 allows you to quickly perform unlimited updates without involving the blockchain. This is where the state channel comes into play. Because, only steps 1 and 3 need to be published to the network, as well as paid or pending confirmation.In fact, with careful planning and design, state channels can remain open almost indefinitely and can be used as part of a large hub system to power an entire economy or ecosystem.Although the description here seems simple, the status/payment channel is often considered to be very complex. There are many reasons for this: one is that there are important subtleties hidden in the expression of these three steps. Let's take a closer look at the implications of these simple phrases:You can submit to the blockchainIn order for the status channel to work properly, you must ensure that participants can publish the status of their current channel to the blockchain at any time. This has led to some significant limitations, such as the fact that someone must remain online to protect the interests of each party until the channel is closed.Imagine that when we open a payment channel, I start with 100BTC and you start with 10BTC. If we first sign the 10 BTC to my update and then sign the 50 BTC back to you, the second update is obviously better for you than the last one. If you accidentally go offline and I can pretend that the second update never happened, then I can publish the first update to the blockchain, effectively stealing 50 BTC from where you are.What you need is someone to stay online, have a copy of the latest transactions so they can be "higher" than earlier ones, and make sure your bitcoin is protected. You don't have to stay online by yourself. You can send a copy to a number of random servers that agree to distribute it only when needed through smart contracts (to save money). However, no matter what you do, you need to make sure that the status update for the latest signature is higher than for all other updates. Which brings us to the next subtle phrase:Each new update is "higher" than the previous oneIn order for this part of the state channel to work properly, locking and unlocking mechanisms must be properly designed so that the old states submitted to the block chain have a chance to be corrected by the new state that replaces them. The easiest way to do this is to let any unlocking attempt start the timer, during which time any new update can replace the old one (also restart the timer). When the timer ends, the channel is closed, and the status is adjusted to reflect the last update received.The length of the timer can be selected for each state channel to balance the inconvenience of longer channel shutdowns with increased security against Internet connection or blockchain issues. (blue fox note: to weigh the pros and cons, the timer is too long, which will cause the channel to be closed for too long, which will cause inconvenience, while the timer is too short, which may cause security problems.)Alternatively, you can build the channel by penalizing it, so that anyone who issues an incorrect update to the blockchain loses more than they gain by pretending it didn't happen.But the mechanism won't matter much in the end, because the game theory of the situation makes things change. As long as the mechanism is reasonable in theory, it may never have to be used.There may actually be additional costs, delays, or other inconveniences associated with passing the timer/penalty process; Given that forcing someone into the mechanism does you no good, participants in a status channel may simply close the channel by mutual agreement on the final channel state.This final shutdown operation is fundamentally different from a normal "mediation" update (since it bypasses the mechanism mentioned above for the latest transaction to be "higher" than the previous one), so the participants sign only one shutdown transaction for each part of the state locked within a particular channel.The details of these "subtleties" are not particularly important. It boils down to the participants opening the channel by setting up smart contracts for judges, signing each other's promises that judges can enforce and rule if necessary, and then negotiating to close the channel so that judges' decisions are not needed.As long as the "judge" mechanism is deemed to be reliable, these promises can be counted as immediate transfers, which can occur only in exceptional circumstances, such as when participants disappear. Of course, these details are only part of the reason people think the status/payment channel is complicated. The bigger reason is that bitcoin's payment channels are complex. Building a "judge" mechanism with reasonably useful attributes on bitcoin is complex.However, once you have a clear overall concept of the state channel, you can see that this is simply due to trying to implement the concept in a restricted environment. Basic smart contract features, such as a timer mechanism and allowing two different paths based on the signature information submitted, are hard to do in bitcoin.Some of these features are gradually being added or built. The payment channel is only a special subcase of the broader concept of a "state channel," which we can recognize as a broader technique, and the state channel can be applied to any smart contract that handles frequent updates in a defined set of participants. You can expect to see this approach in many, if not most, distributed applications.We now have a clearer understanding of what a "state channel" is. So let's look at the side chains.What is a side chain?A side chain is a separate block chain associated with its parent chain (main chain) using a two-way anchor. In other words, you can move the asset to the side chain and back to the parent chain. (blue fox note: move the main chain assets back and forth between the main chain and the side chain)
Side chain
Bidirectional anchoring enables asset swaps between parent and child chains at predetermined exchange rates. The original blockchain is usually called the "main chain", and all other additional blockchains are called "side chains". Blockchain platform Ardor calls its side chains "sub-chains."Users on the parent chain must first send their tokens to an output address, and the tokens are locked so that they cannot be consumed elsewhere. After the transaction is completed, confirmation is made across the chain, and then a period of time is waited to improve security.After the waiting period, an equal amount of tokens will be released on the side chain, allowing the user to acquire and spend here. When an asset is moved from the side chain back to the main chain, the process is reversed.unionAn alliance is a group that ACTS as an intermediate point between the main chain and one of its side chains. This group determines when to lock and release tokens used by the user. The creator of the side chain can choose the members of the alliance. The problem with the federation structure is that it adds another layer between the main chain and the side chain.The side chain is responsible for its own safety. If there is not enough force to secure the side chain, it may be breached. Because each side chain is independent, if it is attacked or invaded, damage will occur in the chain without affecting the main chain. Conversely, if the main chain is attacked, the side chain can still run, but its anchor assets will lose most of their value.The side chains need their own miners. These miners can be motivated by "combined mining", so that two separate tokens, based on the same algorithm, can be mined simultaneously.Now, we also have a good understanding of the side chains. So, let's put them together.What problem are they trying to solve?In general, side chains and state channels are used to improve the scalability of blockchain. They follow a similar model.Lock status/assetTrade outside the blockchain/main chainUnlock status/asset from status channel/side chainBut despite the analogy, there's a lot of difference between the two, because we don't use a separate blockchain in the state channel, and we use a separate blockchain in the side chain. Let's see where this leads.Which of the two is the better extensibility solution?To find out, let's look at the pros and cons.The advantages of state channelsThe status channel has a strong privacy attribute: this is because everything happens "inside" of the channel between participants, rather than being publicly broadcast and recorded on the chain. Only open and closed transactions must be public.On the side chain, every transaction is published on the side chain, and the transaction is received by every participant on the side chain, whether or not you interact with all participants on the side chain.State channels have instant finality. This means that as long as both parties sign a status update, it can be considered final. Both parties have high guarantees that they can "enforce" the status on the chain if necessary. But as mentioned above, depending on the security level of the transaction, the shutdown of the state channel may take different times.In the side chain, there is a block chain on the other side, so the finality depends on the mining calculation force of the side chain.Disadvantages of state channelsThe status channel requires 100% online (availability) for all participants: as we discussed above, if any participant is not online, then this may be costly for him. If the participant is not online, the participant can use someone else to represent the participant. But the possibility of being attacked or bribed makes it a state channel problem. On the side chain you don't always have to be online.State channels are best suited for applications with a defined set of participants: this is because the "judge" contract (the contract used to lock the state) must know the participants/principals (that is, the address) of the particular portion of the channel. We can add and remove people, but it requires changes to the contract every time. In the side chain, there is no such limitation on the change of participants.The status channel is particularly useful in this case: participants will exchange many status updates over a long period of time: this is because of the initial cost of creating the channel deployment "judge" contract. However, once deployed, the cost of each status update within the status channel is very low.Advantages of side chainsThe side chain is permanent. If there are side chains, you don't have to create a dedicated side chain for a specific purpose. Once the side chain is created, it is built and maintained. Instead of closing the side chain, we lock the asset in the side chain to move it back to the main chain. This is a very useful way for anyone doing a specific task outside the blockchain/main chain to come to the same side chain.Therefore, you don't have to create a separate chain for each new participant. In the state channel, you usually have to create a new state channel to add new participants. But projects like lightning networks, lightning networks, have come up with excellent solutions. They create a network of participants so you don't have to create a new channel for each new participant you interact with.You can interact indirectly with the participants by creating a channel between you and the receiver through other participants that you share: you and the receiver.Side chains allow cryptocurrencies to interact with each other: they add flexibility and allow developers to experiment with side chains before shanzhai COINS are launched in Beta or software updates. Functions like traditional banking (such as issuing and tracking share ownership) can be tested on the side chain and then moved to the main chain.Disadvantages of side chainsThe side chain requires a lot of initial investment to get started: to create the side chain, we need enough miners to protect the network from attackers. In addition, we must ensure that they are up and running. However, there is no blockchain in the status channel, so there are no such requirements.Side chains require federation: this adds an additional layer between the main chain and the side chain. This may be another weakness that attackers can attack: they can bribe or attack alliances. In the state channel, however, we only need a smart contract to do this for us.The competition between the two is great. The dust settled, but the two still stood. Because the research is still ongoing and actual use has not yet spread, we can't be sure who will win. Perhaps they will merge to form a hybrid solution to the scalability problem. Until then, we'll have to wait and see when that happens.Source:mp.weixin.qq.comSilver block rhythm BlockBeats reminded, according to the circ and other five departments issued in August 2018 on the guard against in the name of the "virtual currency" "block chain" illegal fund-raising risk warning "file, please the public rationality block chain, don't blindly believe in reduction commitment, set up correct concept of money and investment philosophy, effectively raise the risk consciousness; To the illegal crime clue that discovers, can report to concerned branch actively reflect.
Welcome to join the official BlockBeats community:
Telegram Subscription Group: https://t.me/theblockbeats
Telegram Discussion Group: https://t.me/BlockBeats_App
Official Twitter Account: https://twitter.com/BlockBeatsAsia