Sidechain headers on mainchain (unification of drivechains and spv proofs) [combined summary]



Individual post summaries: Click here to read the original discussion on the bitcoin-dev mailing list

Published on: 2017-09-08T20:14:30+00:00


Summary:

The article examines the use of side-to-side pegs in blockchain technology, specifically focusing on the OP_WITHDRAWPROOFVERIFY for sidechain-headers-on-mainchain approach. This method allows for the transfer of value from the mainchain to a sidechain, with the sidechain committing to a sidechain address. It eliminates the need for reorg proofs by allowing the mainchain to track the extension of the sidechain in real-time, enabling sidechainers to detect fraud and prevent invalid forks. The creation of new sidecoins for free is also discussed, with an emphasis on the need to ensure that lockboxes containing sidecoins are not valid WT. The sidechain allows for the arbitrary creation of sidecoins in lockboxes, but precautions must be taken to prevent a single WT from unlocking multiple lockboxes.The article explores how a main-to-side peg works, where a lockbox is created on Esschain and then spent with a scriptSig that pays out to a selected Bitcoin P2SH address. Challenges faced by side-to-side pegs are highlighted, particularly in the event of the economic majority deciding to kill Esschain due to security issues or other factors. Thieves can exploit this situation by packing an invalid Esschain block full of invalid WT to other chains, which is made possible through enabled side-to-side pegs. While side-to-side pegs offer better liquidity and quick arbitrage between sidechains without relying on the mainchain, they also increase the potential for attacks on sidechains.The email addresses the issue of sidechain forks and how the mainchain determines the validity of the longest chain. Sidechain headers are embedded in the mainchain block's coinbase, allowing mainchain fullnodes to validate the rule of "longest work chain." However, if the merkle tree hash provided contains an invalid transaction, the mainchain nodes may mistakenly consider the longest work chain as valid and eliminate any consensus valid chain that sidechain miners are constructing. To prevent this, the email suggests extending the coinbase maturity period on the sidechain beyond 288 blocks to incentivize sidechain miners to collaborate and extend the chain together.The proposed solution for sidechains involves integrating drivechains, blind merged mining, and SPV proofs. The author recommends using miner voting instead of large SPV proofs to control the unlocking of mainchain funds in a sidechain. Merged mining is proposed to maintain mainchain security in sidechain mining. The concept of "sidechain headers in mainchain" is introduced, where the sidechain header chain is embedded directly in the mainchain. This eliminates the need for presenting new data to the mainchain through SPV proofs, with reorg proofs suggested as a means to invalidate previous SPV proofs.Concerns about centralization risks if sidechain miners are required to check the sidechain in full are raised. A possible solution is to validate SPV proofs on the mainchain without trusting anyone or running sidechain software. The proposal aims to address issues with drivechains failing due to the potential for a group with over 51% of mainchain miners to steal sidechain lockboxes. The process of creating a sidechain involves the creation of a data structure containing various information, including sidechain block height, side-to-main peg pointer, links to other forks of the same sidechain ID, and the top block header hash of the sidechain. Mainchain nodes create and update this data structure based on the extension of the sidechain. Multiple forks of a sidechain are tracked, and mainchain fullnodes validate side-to-main transfers without the need for running sidechain software.Mainchain miners can act as protectors for sidechains by being paid in sidechain funds and using OP_BRIBEVERIFY. The number 288, mentioned throughout the article, is a parameter that can be subject to debate.


Updated on: 2023-08-01T21:44:05.360002+00:00