Bitcoin Forum
November 12, 2024, 02:29:01 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Merged mining - Questions  (Read 1444 times)
DumbFruit (OP)
Sr. Member
****
Offline Offline

Activity: 433
Merit: 267


View Profile
November 06, 2014, 03:31:52 PM
 #1

Sorry if this has been brought up before. I couldn't find a recent topic to post the question in.

Normally PoW hashes a block that contains the previous block header, in this way creating a chain of work that can be independently verified.

In merged mining, the miner is still doing the same thing, but is also checking to see if the hash happens to match what is required for the merged coin.

In the wiki it happens to shows these difficulties;
000000000000b269000000000000000000000000000000000000000000000000 -- Namecoin difficulty target
00000000000009ee5d0000000000000000000000000000000000000000000000 -- Bitcoin difficulty target

https://en.bitcoin.it/wiki/Merged_mining_specification

So my questions are;
1.) Is it true that merge mining is just a random shot in the dark to see if a hash matches what is needed for another cryptocurrency?
2.) Is it true that the other coin is several orders of magnitude lower difficulty than the main BlockChain for this reason?
3.) If those are true, isn't it also true that a merge-mining coin can never be anywhere near as high a difficulty as the main blockchain and therefore is much more vulnerable to a 51% attack, if miners target that coin specifically?

By their (dumb) fruits shall ye know them indeed...
TierNolan
Legendary
*
Offline Offline

Activity: 1232
Merit: 1104


View Profile
November 06, 2014, 05:03:34 PM
 #2

1.) Is it true that merge mining is just a random shot in the dark to see if a hash matches what is needed for another cryptocurrency?

Both are random shots in the dark.  You hash the header and there is a probability that it will be accepted for each coin.

Quote
2.) Is it true that the other coin is several orders of magnitude lower difficulty than the main BlockChain for this reason?

If 1% of Bitcoin miners also mined Namecoin, then Namecoin's difficulty would be 1% of Bitcoin's.  In theory, Namecoin could have higher difficulty, if enough miners mined Namecoin and didn't bother with Bitcoin.

Quote
3.) If those are true, isn't it also true that a merge-mining coin can never be anywhere near as high a difficulty as the main blockchain and therefore is much more vulnerable to a 51% attack, if miners target that coin specifically?

Yes, it is a risk.  If a major pool decided to merge mine Namecoin secretly, then they could 51% the coin.

Eligius (I think) did something similar to an alt coin.  Miners at their pool were not affected.

1LxbG5cKXzTwZg9mjL3gaRE835uNQEteWF
DumbFruit (OP)
Sr. Member
****
Offline Offline

Activity: 433
Merit: 267


View Profile
November 06, 2014, 06:15:40 PM
 #3

If 1% of Bitcoin miners also mined Namecoin, then Namecoin's difficulty would be 1% of Bitcoin's.  In theory, Namecoin could have higher difficulty, if enough miners mined Namecoin and didn't bother with Bitcoin.
I don't understand how this part could be true. If the hashing being done is salted by the current block and a hash of the preceding block, how could that work possibly be equally valid for another coin whose current block and previous hash are totally different?

Quote
For a block to be valid it must hash to a value less than the current target; this means that each block indicates that work has been done generating it. Each block contains the hash of the preceding block, thus each block has a chain of blocks that together contain a large amount of work.
https://en.bitcoin.it/wiki/Proof_of_work

By their (dumb) fruits shall ye know them indeed...
securedolphin
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
November 06, 2014, 06:23:06 PM
 #4

3.) If those are true, isn't it also true that a merge-mining coin can never be anywhere near as high a difficulty as the main blockchain and therefore is much more vulnerable to a 51% attack, if miners target that coin specifically?
Yes, that is true. However, that does not create any additional risks compared to completely separate mining (if that is what you are getting at). Miners could simply switch and mine NameCoin if they liked. So, no downside. In fact there are upsides:

a. If significant number of bitcoin miners also merge mines namecoin that makes it difficult for an outsider or newcomer to assembly a critical mass for 51% attack.

b. Miners incentives - merged mining allows extra reward from all merge mined currencies included in the block. From miners perspective it would be the best if all compatible chains were merge mined.


Considering that the hash rate is the ultimate determinant of coin robustness and that the hash rate is a function of mining reward, the security of given coin is directly proportionate to it's cost. Cheaper coins are more vulnerable. So, in a long run NameCoin has no choice but to deflate in order to stay secure and prevent 51% attacks.
TierNolan
Legendary
*
Offline Offline

Activity: 1232
Merit: 1104


View Profile
November 06, 2014, 07:07:17 PM
 #5

I don't understand how this part could be true. If the hashing being done is salted by the current block and a hash of the preceding block, how could that work possibly be equally valid for another coin whose current block and previous hash are totally different?

Merge mining requires that at least one of the coins supports it.

Namecoin allows you to mine a bitcoin header and then include the hash of the namecoin header in the coinbase transaction.  If you meet the Namecoin difficulty, you have to send the bitcoin header, the merkle path to the coinbase transaction and the coinbase transaction to the Namecoin network as your "header".

1LxbG5cKXzTwZg9mjL3gaRE835uNQEteWF
DumbFruit (OP)
Sr. Member
****
Offline Offline

Activity: 433
Merit: 267


View Profile
November 06, 2014, 08:12:40 PM
Last edit: November 06, 2014, 08:57:55 PM by DumbFruit
 #6

I don't understand how this part could be true. If the hashing being done is salted by the current block and a hash of the preceding block, how could that work possibly be equally valid for another coin whose current block and previous hash are totally different?

Merge mining requires that at least one of the coins supports it.

Namecoin allows you to mine a bitcoin header and then include the hash of the namecoin header in the coinbase transaction.  If you meet the Namecoin difficulty, you have to send the bitcoin header, the merkle path to the coinbase transaction and the coinbase transaction to the Namecoin network as your "header".

How does that help with consensus? If a node gets a bitcoin header, the merkle path to the coinbase transaction, and the coinbase transaction, why couldn't the Namecoin node just modify all the transactions, or even drop them entirely, since the bitcoin header doesn't depend on the contents of the Namecoin nodeblock?

Ohhhhh... There's some information put into the Bitcoin blockchain. Ok. This makes more sense now. I assume that this "small amount of data" is the hash of the Namecoin block?


Merged mining works like this, you have two totally separate block chains, they are not related in any way nor does either contain any data from the other. When you mine you generate hashes that may be the solution to the current block, this is very very improbable per hash, its like a lottery where everyone generates tickets until someone finds the winning one. Normally you make tickets and check them against the Bitcoin block chain to see if they are the solution. With merged mining you create a ticket and check it against both the Bitcoin block chain and the Namecoin block chain, Bitcoin and Namecoin know nothing about each other, they are two totally different lotteries with different winning numbers, you just sent a copy of your ticket to both. Since you are sending the same ticket to two lotteries you increase your chances of winning one or the other. No Bitcoin data goes into Namecoin no Namecoin data into Bitcoin they remain totally separate, you simply run both the Namecoin and Bitcoin clients on the same machine and submit hashes to both networks, if your hash is the solution to the Namecoin block you get Namecoins if you hash is the solution to the Bitcoin block you get Bitcoins, its exactly like if you where mining on just one network, except you submit the same work twice.


Not quite tl;dr but i think its gets the point across.  

Thankyou ttk2 for this. I've been reading lots of text about this concept, and wasn't quite getting some bits of it. Now it makes more sense.

Why don't you have a donation address in your signature?



Didn't think anyone would care to donate.

12YXLzbi4hfLaUxyPswRbKW92C6h5KsVnX


Thanks! I am glad i could help.

Could you please correct this (on the web site also)

It is false (see highlighted sections that are wrong)

Namecoin data (unrelated to bitcoin) is added to the bitcoin block chain, thus making the bitcoin block chain unnecessarily larger.

Though, for those who do want to do this - look at it this way Smiley
Namecoin blocks are almost free.
The cost is those extra bytes added to the bitcoin block chain (i.e. disk space for everyone in bitcoin)
If you mine exclusively namecoin you are paying with your hashes and electricity (as well as the namecoin block chain disk space)
If you mine merged you are only paying with your namecoin and bitcoin block chain disk space.
What value does that put on a namecoin coin?

Update: It's the hash of the Namecoin block header.

https://en.bitcoin.it/wiki/Merged_mining_specification

By their (dumb) fruits shall ye know them indeed...
TierNolan
Legendary
*
Offline Offline

Activity: 1232
Merit: 1104


View Profile
November 06, 2014, 08:44:23 PM
Last edit: November 06, 2014, 10:05:03 PM by TierNolan
 #7

How does that help with consensus?

You still have to pick one Bitcoin block and one Namecoin block to build on.  This is what forces consensus (the "nothing is at stake" issue for POS systems).

Maybe Namecoin didn't get that right, looks like they allow multiple altcoins to be mined at the same time.  This might allow mining of 2 forks at the same time.

Quote
There's some information put into the Bitcoin blockchain. Ok. This makes more sense now. I assume that this "small amount of data" is the hash of the Namecoin block?

Yes, it is the hash of the Namecoin header.  That hash can be anything, it doesn't affect POW.  

Unlike bitcoin block hashes, Namecoin hashes don't have lots of leading zeros.


Merged mining works like this, you have two totally separate block chains, they are not related in any way nor does either contain any data from the other.

That is either a misunderstanding or simply unclear.  The hash of the Namecoin header is placed in the coinbase transactions in a field called the "ExtraNonce".  

It is literally intended to be another nonce.  You could set it to anything you want and the coinbase is still valid.

There was a BIP which added the requirement that the first bytes of the extraNonce are set to the height of the block, so you don't have full flexibility.  Other than that rule, you can set it to any byte array of 100 bytes or less.

The point is that you are just embedding the hash in the blockchain, but it doesn't actually have any effect on the Bitcoin system.

1LxbG5cKXzTwZg9mjL3gaRE835uNQEteWF
DumbFruit (OP)
Sr. Member
****
Offline Offline

Activity: 433
Merit: 267


View Profile
November 06, 2014, 08:50:50 PM
 #8

Ok, I think I understand what's going on with merge mining now. I appreciate you taking the time to help me.

By their (dumb) fruits shall ye know them indeed...
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!