10.02.2016 Views

Bitcoin and Cryptocurrency Technologies

1Qqc4BN

1Qqc4BN

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

affront to the cryptocurrency ecosystem. So Eligius pointed its mining resources at CoiledCoin, mining<br />

blocks that reversed days’ worth of CoiledCoin transaction history as well as mining a long chain with<br />

empty blocks, effectively causing a denial‐of service attack which prevented CoiledCoin users from<br />

making any transactions. After a fairly short siege, users ab<strong>and</strong>oned CoiledCoin, <strong>and</strong> it doesn’t exist<br />

any more. In this example <strong>and</strong> in other altcoin infanticide attacks, the attacker is motivated by<br />

something other than direct profit.<br />

Merge mining.​By default — say if an altcoin forks the <strong>Bitcoin</strong> source code but makes no other<br />

changes — mining on the altcoin is exclusive. That is, you can try to solve the mining puzzle solution to<br />

find a valid block for the altcoin or for <strong>Bitcoin</strong>, but you can’t try to solve both puzzles at once. Of<br />

course, you can divide your mining resources to dedicate some to mining on the altcoin <strong>and</strong> some to<br />

mining on <strong>Bitcoin</strong>. You can even divide between multiple different altcoins <strong>and</strong> you can adjust your<br />

allocation over time, but there’s no way to get your mining power to do double duty.<br />

With exclusive mining, network effects can make it difficult for an altcoin to bootstrap. If you wanted<br />

to launch an altcoin <strong>and</strong> convince today’s <strong>Bitcoin</strong> miners to participate in your network, they would<br />

have to stop mining <strong>Bitcoin</strong> (with at least some of their resources) which will mean an immediate loss<br />

of <strong>Bitcoin</strong> mining rewards. This means your altcoin is likely to remain small in terms of hashing power<br />

<strong>and</strong> more vulnerable to infanticide‐style attacks by <strong>Bitcoin</strong> miners.<br />

Can we design an altcoin so that it’s possible to mine blocks both on the altcoin <strong>and</strong> on <strong>Bitcoin</strong> at the<br />

same time? To do that we need to create blocks that include transactions from both <strong>Bitcoin</strong> <strong>and</strong> the<br />

altcoin, making them valid in both block chains. It’s easy to design the altcoin so that it allows <strong>Bitcoin</strong><br />

transactions in its blocks, because we can write the rules of the altcoin however we want. The reverse<br />

is harder. Where can we put altcoin transactions in <strong>Bitcoin</strong> blocks? In Chapter 3 <strong>and</strong> later in Chapter 9<br />

we’ve seen how to put arbitrary data into <strong>Bitcoin</strong> blocks, but the b<strong>and</strong>width of these methods is very<br />

limited.<br />

There’s a trick, though: even if we can’t put the ​contents​of the altcoin’s transactions into <strong>Bitcoin</strong><br />

blocks, we can put a ​summary​of the altcoin transactions into <strong>Bitcoin</strong> blocks in the form of a hash<br />

pointer to the altcoin block. Finding a way to put a single hash pointer into each <strong>Bitcoin</strong> block is easy.<br />

Specifically, recall that each <strong>Bitcoin</strong> block has a special transaction called the coinbase transaction<br />

which is where the miner creates new coins as a block reward. The scriptSig field of this transaction<br />

has no significance <strong>and</strong> can therefore be used to store arbitrary data (there’s no need to sign the<br />

Coinbase transaction since it’s not spending any previous transaction outputs). So in a merge‐mined<br />

altcoin, the mining task is to compute ​<strong>Bitcoin</strong>​blocks whose Coinbase scriptsig contains a hash pointer<br />

to an altcoin block.<br />

This block can now do double‐duty: to <strong>Bitcoin</strong> clients, it looks just like any other <strong>Bitcoin</strong> block, with a<br />

hash in the coinbase transaction that can be ignored. Altcoin clients know how to interpret the block<br />

by ignoring the <strong>Bitcoin</strong> transactions <strong>and</strong> looking at the altcoin transactions committed to by the hash<br />

in the coinbase transaction. Note that while this doesn’t require any changes to <strong>Bitcoin</strong>, it does<br />

require the altcoin to specifically underst<strong>and</strong> <strong>Bitcoin</strong> <strong>and</strong> accept merge‐mined blocks.<br />

276

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!