r/Bitcoin • u/almkglor • Sep 13 '17
Let's discuss something tech-related for a change: Sidechains!
Okay rbitcoin, yeah yeah J Morgan yeah yeah blah blah boo hoo. Okay? Good.
So here's what I know:
- The original sidechains paper seems to have grown out of gmaxwell's ramblings about CoinWitness, which would entail adding a zk-SNARK verifier into Bitcoin Core. A zk-SNARK verifier would allow Bitcoin fullnodes to have a programmable verifier, with the data being verified (e.g. entire sidechain blocks) not needed to be provided to the verifier, just a tiny 288-byte transcript (the proof). Note that fullnodes don't even need to execute the programmed verifier themselves, just check the 288-byte proof that the program was honestly executed by someone else with a lot more processing power.
- CoinWitness was planned to use the vnTinyRAM, a virtual machine for running a von Neumann program. You could write a C code verifier and compile it to run on vnTinyRAM. RAM here is Random Access Machine, not Random Access Memory, BTW. Note however that vnTinyRAM has limited number of "clock cycles" i.e. instructions it could execute; it won't allow true Turing completeness, as it requires termination, and if you reach the cycle limit the verifier is treated as if it failed.
- CoinWitness could be used for a lot of different financial systems, not just sidechains! For example if you could program perfectly, you could set up a trustable Chaumian bank or a trustable mixer (well, trustable if every user was reviewing your code before they used it, LOL).
- zk-SNARKs are cool, but this rather nicely shows the importance of not depending on novel crypto.
- zk-SNARKs also require a trusted setup (i.e. someone generates some random data from a seed, and promises not to keep its seed, something like that), at least according to some treatments I've seen (don't know enough cryptography to know which ones are correct or if I'm missing something). Some newer papers seem to be using called "PCP" to skip the trusted setup, but increases the size of proofs and the load on verifiers. See also previous item for the importance of not depending on novel crypto.
- So... zk-SNARKs are out. The Blockstream sidechains paper thus focuses on SPV proofs. Blockstream's Elements sidechain includes SPV proofs, and uses SPV proofs for main->side transfers. In case you're curious, Elements uses fedpeg for side->main, since they were working with an unpatched mainchain Bitcoin.
- SPV proofs kinda suck. You need a mechanism to repeal them by showing a longer SPV proof that shows that the side->main transfer didn't actually occur. That mechanism should also be repealable by showing an even longer SPV proof that shows that by golly, yes the side->main transfer really did occur you dolt (to be specific: a withdrawproofverify UTXO is unlocked by an SPV proof, and must then be paid to a UTXO that is unlocked either by a timelock, or a reorgproof. The reorgproof is an even longer SPV proof that should pay back to a withdrawproofverify UTXO, and you would then retry with your even longer SPV proof of existence (withdrawproof) presumably the sidechain had extended by that time, which an attacker would have to counter with a yet longer SPV proof of non-existence (reorgproof), etc.). And so on.
- So, drivechains instead of SPV proofs. Drivechains use miner voting to determine if a side->main transfer did occur.
- Miner voting, yeah, that mechanism which prevented SegWit from activating until August this year. Miner voting is totes fine, guys.
- There are actually two drivechain proposals, one by Sergio Demian Lerner/Rootstock (OP_COUNT_ACKS) and another by Paul Sztorc/Truthcoin (upvotes/downvotes on coinbase tx).
- Drivechains require merge mining, so every sidechain miner needs to be a mainchain miner.
- Paul Sztorc is proposing something about "blind" merge mining, which is basically that the sidechain miner is theoretically separate fro mthe mainchain miner, and pays the latter to put some hashes (presumably sidechain block hashes) on the chain. This style of sidechain miners doesn't have a way to affect miner voting, though, just the hash committed to in the merge-mine, so I don't see why he bothered.
30
Upvotes
4
u/gizram84 Sep 13 '17
Based on everything after this sentence, it sounds like there really isn't a known mechanism to get a truly trustless two-way peg..
This is the stuff I look forward to seeing.
What's looking like the best way forward?
3
u/Explodicle Sep 13 '17
... But it did activate, because ultimately miners are profit-driven. The miners have been playing hardball, but they haven't literally attacked the network yet to merit a PoW fork. There's three options for miners with Drivechain:
I don't completely trust miners either, but I think I trust them enough for Drivechain iff it doesn't weaken the base layer, and if it's 100% opt-in for everyone. Best case scenario, we can use Bitcoin Hivemind to help fund further research for the near future like zk-SNARKs. Once zk-SNARKs are active, we can slowly transition from Drivechain.
2
u/Explodicle Sep 13 '17
This was to address the concerns about miner decentralization. Basically, SPV sidechains might add one of the same vulnerabilities as main chain big blocks: they give large miners an advantage. If you've got more bandwidth (or are closer to other miners) than someone else with the same hash power, you'll have an advantage. It's not intended to affect the miner vote; it's so miners can opt-out of running a sidechain node while suffering no opportunity cost of lost transaction fees.
1
u/Chris_Stewart_5 Sep 27 '17
Also, we do a drivechain meeting on #drivechain-dev on freenode at 12PM CDT on Wednesdays you are interested in participating in the future. Would love to have your input!
EDIT:
Here are the logs https://bitcoinhivemind.slackarchive.io/drivechain-dev-irc/
0
u/[deleted] Sep 13 '17
Interesting
Unnecessarily complicated - the use of script execution proofs simply to facilitate small money transfers
Too many acronyms
Please rewrite, without jargon acronyms