<p>Sidechains don't mine new "sidecoins" themselves. they get funded by bitcoins being transferred to the sidechain.
tx fees in the sidechains do exist, however.</p>

CC BY-SA 3.0
2014-04-14T00:52:23.667Z
So.... the side-chain miners are paid only with tx fees? That's strange.
Karel Bílek
CC BY-SA 3.0
2014-04-14T00:53:32.827Z
I am not accepting your answer since it's not a full answer (no offense).
Karel Bílek
CC BY-SA 3.0
2014-04-14T16:57:28.457Z
Why is that strange? Bitcoin miners are also only paid transaction fees (with a special exception for the next 125 years).
trichoplax is on Codidact now
CC BY-SA 3.0
2014-04-25T02:40:49.603Z
That's a pretty long special exception.
Karel Bílek
CC BY-SA 3.0
2017-04-27T22:29:27.353Z
So in essense BTC will just become virtual-BTC on the sidechain?
Patoshi パトシ
CC BY-SA 3.0
2014-04-13T17:35:33.283Z
2014-04-16T02:13:13.640Z
2014-04-16T02:13:13.640Z
mikka sideson
<p>As Mikka explains, sidechains don't need to create their own currency, using bitcoins in the sidechain is precisely the point of two-way peg (there's no reason why an altchain with its own currency, like say litecoin or ethereum, couldn't support 2-way peg and also become a sidechain though).
Also, take into account there's <a href="http://www.reddit.com/r/Bitcoin/comments/22vn4m/why_do_people_think_that_sidechains_are_going_to/cgqy5w6">several possible ways</a> to implement sidechains. I will talk about the most basic one.</p>

<p>First some bitcoins are moved to a "pegging pool" for each sidechain and get locked there on a script until someone provides a scriptsig that satisfies some of them.
The user uses that "proof of suspension" to get the same quantity of btc in the sidechain. To prevent reorg risks, there must be a quieting period of X blocks in btc before the coins are accepted in the sidechain, say 100 bitcoin blocks.
After that, the coins can be send normally (or with the special rules the sidechain may have).
At some point, a new owner wants to move the bitcoins back to the main chain.
To do that he produces a "proof of burn/resumption" transaction (that needs to have a legacy format the bitcoin chain can understand). Then again there's a quieting period of X blocks in the sidechain before the coins can be claimed in the main chain.</p>

<p>To claim the coins back on the main chain, the user needs to provide the all the headers of the sidechain from the last time coins were withdrawn from the pegging pool to the block containing the resumption transaction (since this could easily become too long, even bigger than a whole bitcoin block, a compression mechanism is needed; I won't describe this but I'll just say that relies on "lucky blocks" and once implemented would be generally good for headers-first synchronization), the merkle path to that transaction, plus the additional X quieting blocks on top of it. This way we know how much work this chain has and that the transaction is included in that chain and buried with X blocks.
The bitcoin network doesn't need to know about the validity of the chain provided, only about the work. In that sense 2-way peg has a level of security equivalent to SPV because the chain with more work is trusted without fully validating it.</p>

<p>But as you say, how does the bitcoin network knows there's no other longer chain somewhere else?
It doesn't, so something else must be done to prevent sidechain miners from stealing the coins by just providing an invalid chain with enough work.
So, yes, we need yet another quieting period during which anybody can submit a "proof of reorg" with a chain longer (more work) than yours which doesn't contain your resumption transaction, invalidating your claim and making you start again.
So to steal coins an attacker must to control 51% or more of the sidechain's hashing power for the last quieting two quieting periods, the last of which could be set to days.</p>

<p>On the reward question, again, there's several possibilities. The simplest approach would be for the sidechain to live on transaction fees like bitcoin itself will have to do in the future. Another possibility is to distribute the fees between several future blocks to have a more predictable and constant reward. Another probably less popular approach is to have a demurrage fee on the bitcoins on the sidechain. I'm sure there will be more proposals.</p>

<p>You can read the original thread on 2-way peg here:</p>

<p><a href="http://sourceforge.net/p/bitcoin/mailman/message/32108143/">http://sourceforge.net/p/bitcoin/mailman/message/32108143/</a></p>

<p>There have also been many discussions on #bitcoin-wizards :</p>

<p><a href="http://download.wpsoftware.net/bitcoin/wizards/">http://download.wpsoftware.net/bitcoin/wizards/</a></p>

CC BY-SA 3.0
2014-05-24T10:03:18.423Z
Hey! First time I am reading something more concrete about sidechains. Thanks
Karel Bílek
CC BY-SA 3.0
2014-05-24T10:05:56.413Z
Also, pardon for the skepticism, I don't think bitcoin will ever got to a phase where there are no transaction fees. I don't believe Bitcoin will be here in, say, 50 years, the same as technology from the 60s is not with us today. But that's not the point of your answer. :)
Karel Bílek
CC BY-SA 3.0
2017-04-27T22:28:18.380Z
When you mention "Pegging Pools". Don't these pegging pools require a 3rd party or service to operate it as the sidechain has to report to these pools in order to release the BTC funds?
Patoshi パトシ
CC BY-SA 3.0
2014-05-23T19:12:47.593Z
2014-05-23T19:12:47.593Z
jtimon
<p>I am struggling to understand the concept of "side-chains" that's discussed a lot lately, but never trully explained.</p>

<p>How I understand "side-chain": it's an altcoin, with a separate blockchain, with a separate PoW rules and mineres and mining rewards and so on, that has value somehow tied to bitcoin, and that can be later exchanged back "into" main bitcoin blockchain.</p>

<p>I struggle to understand two things though. </p>

<ol>
<li><p>How will a bitcoin miner/bitcoin node check, that the side-chain transactions were correct (in the sense of "not double-spent") and that they are on the longer "altcoin" chain? Does the bitcoin node also have to download all the other chains? Isn't that strange?</p></li>
<li><p>How is the mining reward solved? What if this side-chain has some crazy rules (like quark) for mining 90% of the existing supply in a few days? How does the money supply even make sense with value interchangable between BTC and side-chain?</p></li>
</ol>

<p>It's possible I got the basics totally wrong, but I never got past the enthusiasm to some real explanations, so I am asking here.</p>

<blockchain><altcoin><merged-mining><sidechains>
How is a side-chain merging back to Bitcoin chain protected against double-spend? Where are the side-chain mining fees?
Karel Bílek
# How is a side-chain merging back to Bitcoin chain protected against double-spend? Where are the side-chain mining fees?

(Asked by: username_0 on 2014-04-13)

I am struggling to understand the concept of "side-chains" that's discussed a lot lately, but never trully explained.

How I understand "side-chain": it's an altcoin, with a separate blockchain, with a separate PoW rules and mineres and mining rewards and so on, that has value somehow tied to bitcoin, and that can be later exchanged back "into" main bitcoin blockchain.

I struggle to understand two things though.

1. How will a bitcoin miner/bitcoin node check, that the side-chain transactions were correct (in the sense of "not double-spent") and that they are on the longer "altcoin" chain? Does the bitcoin node also have to download all the other chains? Isn't that strange?
2. How is the mining reward solved? What if this side-chain has some crazy rules (like quark) for mining 90% of the existing supply in a few days? How does the money supply even make sense with value interchangable between BTC and side-chain?

It's possible I got the basics totally wrong, but I never got past the enthusiasm to some real explanations, so I am asking here.

**Tags:** blockchain, altcoin, merged-mining, sidechains


---

## 2 answers

### Answer by username_4 on 2014-05-23. Score: 9 | Accepted answer

As Mikka explains, sidechains don't need to create their own currency, using bitcoins in the sidechain is precisely the point of two-way peg (there's no reason why an altchain with its own currency, like say litecoin or ethereum, couldn't support 2-way peg and also become a sidechain though).
Also, take into account there's [several possible ways](http://www.reddit.com/r/Bitcoin/comments/22vn4m/why_do_people_think_that_sidechains_are_going_to/cgqy5w6) to implement sidechains. I will talk about the most basic one.

First some bitcoins are moved to a "pegging pool" for each sidechain and get locked there on a script until someone provides a scriptsig that satisfies some of them.
The user uses that "proof of suspension" to get the same quantity of btc in the sidechain. To prevent reorg risks, there must be a quieting period of X blocks in btc before the coins are accepted in the sidechain, say 100 bitcoin blocks.
After that, the coins can be send normally (or with the special rules the sidechain may have).
At some point, a new owner wants to move the bitcoins back to the main chain.
To do that he produces a "proof of burn/resumption" transaction (that needs to have a legacy format the bitcoin chain can understand). Then again there's a quieting period of X blocks in the sidechain before the coins can be claimed in the main chain.

To claim the coins back on the main chain, the user needs to provide the all the headers of the sidechain from the last time coins were withdrawn from the pegging pool to the block containing the resumption transaction (since this could easily become too long, even bigger than a whole bitcoin block, a compression mechanism is needed; I won't describe this but I'll just say that relies on "lucky blocks" and once implemented would be generally good for headers-first synchronization), the merkle path to that transaction, plus the additional X quieting blocks on top of it. This way we know how much work this chain has and that the transaction is included in that chain and buried with X blocks.
The bitcoin network doesn't need to know about the validity of the chain provided, only about the work. In that sense 2-way peg has a level of security equivalent to SPV because the chain with more work is trusted without fully validating it.

But as you say, how does the bitcoin network knows there's no other longer chain somewhere else?
It doesn't, so something else must be done to prevent sidechain miners from stealing the coins by just providing an invalid chain with enough work.
So, yes, we need yet another quieting period during which anybody can submit a "proof of reorg" with a chain longer (more work) than yours which doesn't contain your resumption transaction, invalidating your claim and making you start again.
So to steal coins an attacker must to control 51% or more of the sidechain's hashing power for the last quieting two quieting periods, the last of which could be set to days.

On the reward question, again, there's several possibilities. The simplest approach would be for the sidechain to live on transaction fees like bitcoin itself will have to do in the future. Another possibility is to distribute the fees between several future blocks to have a more predictable and constant reward. Another probably less popular approach is to have a demurrage fee on the bitcoins on the sidechain. I'm sure there will be more proposals.

You can read the original thread on 2-way peg here:

<http://sourceforge.net/p/bitcoin/mailman/message/32108143/>

There have also been many discussions on #bitcoin-wizards :

<http://download.wpsoftware.net/bitcoin/wizards/>

> **Comments:**
> **username_0**: Hey! First time I am reading something more concrete about sidechains. Thanks  
> **username_0**: Also, pardon for the skepticism, I don't think bitcoin will ever got to a phase where there are no transaction fees. I don't believe Bitcoin will be here in, say, 50 years, the same as technology from the 60s is not with us today. But that's not the point of your answer. :)  
> **username_3**: When you mention "Pegging Pools". Don't these pegging pools require a 3rd party or service to operate it as the sidechain has to report to these pools in order to release the BTC funds?  

---

### Answer by username_1 on 2014-04-13. Score: 1

Sidechains don't mine new "sidecoins" themselves. they get funded by bitcoins being transferred to the sidechain.
tx fees in the sidechains do exist, however.

> **Comments:**
> **username_0**: So.... the side-chain miners are paid only with tx fees? That's strange.  
> **username_0**: I am not accepting your answer since it's not a full answer (no offense).  
> **username_2**: Why is that strange? Bitcoin miners are also only paid transaction fees (with a special exception for the next 125 years).  
> **username_0**: That's a pretty long special exception.  
> **username_3**: So in essense BTC will just become virtual-BTC on the sidechain?  

---

