2

I was exploring sidechains and two-way pegs but didn't clearly understand one point: How does a sidechain know if funds are locked in the main chain?

To my understanding blockchains are "isolated" meaning they can't know what's happening outside without a transaction. It's the reason we need oracles. So when someone locks some ether in the Ethereum mainchain, how does the sidechain know the funds are indeed locked?

So far I've seen Simple Payment Verification SPV proofs and federations. SPV proofs would show you actually made the payment but it can't be made on chain. Meaning, again, the sidechain VM has no access to main chain and without the block headers of the main chain the SPV proof is not complete.

Is how this happens is by syncing two chains separately and observing them when fund lock happens and publishing the transaction accordingly to the other chain. This would be off chain and I guess is the idea behind a federation?

I would be thankful if someone can clarify these points. Thanks

4

A side-chain relies on the security of the nodes participating in the side-chain. So any communication between main-chain and side-chain has to rely on those nodes as well for its security.

There might be several ways of achieving this, SKALE for example uses BLS threshold-signatures. For example to move funds back to the main-chain, first the user sends the request to destroy the funds on the SKALE chain. Once that has been finalized, SKALE nodes sign a transaction to send the funds back to the user on the mainchain. Threshold signatures ensure that a valid transaction signature is only created once sufficient nodes have signed it.

See also https://medium.com/skale/bls-deep-dive-793a4e8a6f4e.

To my understanding blockchains are "isolated" meaning they can't know what's happening outside without a transaction. It's the reason we need oracles. So when someone locks some ether in the Ethereum mainchain, how does the sidechain know the funds are indeed locked?

So to answer this specifically, basically the nodes of a side-chain have to be nodes in the main-chain as well.

2
  • Thanks for the answer. So those nodes will sync both chains, observe them and publish tx or sign the tx on the other chain. Meaning we are relying on the nodes to release our funds. Can any node sign the transaction to release the fund? Do nodes have an incentive to do so? – kuzdogan May 4 '20 at 9:42
  • @kuzdogan Yes they will sync both (or use a service like Infura for the mainchain). And yes we are relying on the nodes to release the funds, but not one single node can release them. Only x nodes together can release funds. x is determined by the protocol, I believe in SKALE you would have randomly assigned subgroups and you would need a majority of nodes in a subgroup. Nodes might have deposits that they loose when behaving maliciously, but obviously side-chains don't have the same security as the main-chain. You will have to trust a smaller number of side-chain nodes. – Markus - soliditydeveloper.com May 4 '20 at 20:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.