<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.bitcoin.it/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Makomk</id>
	<title>Bitcoin Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://en.bitcoin.it/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Makomk"/>
	<link rel="alternate" type="text/html" href="https://en.bitcoin.it/wiki/Special:Contributions/Makomk"/>
	<updated>2026-04-15T17:17:19Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Talk:Litecoin&amp;diff=28413</id>
		<title>Talk:Litecoin</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Talk:Litecoin&amp;diff=28413"/>
		<updated>2012-07-04T16:32:31Z</updated>

		<summary type="html">&lt;p&gt;Makomk: /* Objectivity please, missing citation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There is nothing on this discussion page about this article at the moment. Use it. Reasonable informed edits will be allowed through until a consensus is reached and the page unlocked. That is comments that are neither pro or anti litecoin, but are &#039;&#039;neutral&#039;&#039; and objective. [[User:Genjix|Genjix]] 10:01, 28 November 2011 (GMT)&lt;br /&gt;
&lt;br /&gt;
== Objectivity please, missing citation ==&lt;br /&gt;
&lt;br /&gt;
There are two criticisms in the article, that I believe are not objective:&lt;br /&gt;
&lt;br /&gt;
* Mining Monopoly - while I heard claims that Litecoin is volnurable to botnets, I never heard anything about a single monopoloy, or anyone possibly building a &amp;quot;single piece of specialized/custom hardware to overtake all the commodity mining systems combined&amp;quot;. Can we have a citation for this, or remove it if no citation is found?&lt;br /&gt;
* Pyramid Scheme - The article states, as if it is a fact, that &amp;quot;Litecoin effectively functions as a pyramid scheme&amp;quot;. This is hardly objective. Litecoin could possibly become say 1% of the total Bitcoin market, and could indeed function as &amp;quot;silver&amp;quot;. The same arguments in [[FAQ#Is Bitcoin a Ponzi_scheme]] apply here.&lt;br /&gt;
&lt;br /&gt;
Can we fix this?&lt;br /&gt;
&lt;br /&gt;
[[User:Ripper234|Ripper234]] 13:43, 13 January 2012 (GMT)&lt;br /&gt;
&lt;br /&gt;
* Mining Monopoly - This isn&#039;t Wikipedia. Independent research is acceptable. Litecoin&#039;s scrypt is not (and cannot be, by definition) resistant to custom mining hardware. It is, however, resistant to all commodity hardware. This leaves a huge gap in mining capabilities between commodity hardware and custom hardware, which enables even a single person designing custom hardware to easily gain a 51% attack over all other miners. Bitcoin&#039;s double-SHA256 performs well on commodity GPUs, which serve as a &amp;quot;tier&amp;quot; between CPUs and custom hardware.&lt;br /&gt;
* Pyramid Scheme - If you can make this more objective without being wrong, feel free. However, the fact is that Litecoin functions as a pyramid scheme because it has no long-term viability like Bitcoin does. It cannot function as &amp;quot;silver&amp;quot; or any other kind of currency because it cannot survive. Therefore, late comers do NOT benefit from it. Bitcoin is only exempt from the &#039;pyramid scheme&#039; claim because of its long-term function as a currency.&lt;br /&gt;
&lt;br /&gt;
[[User:Luke-jr|Luke-jr]] 17:12, 16 January 2012 (GMT)&lt;br /&gt;
&lt;br /&gt;
: I believe the way to make the &amp;quot;pyramid scheme&amp;quot; section more objective is to remove it altogether. Meaningful criticism does not begin by assuming as a premise that all obstacles are insurmountable and that the currency is an inevitable failure. (Also, for clarification: did you delete my previous comments on this page because they were considered to not be objective?)&lt;br /&gt;
&lt;br /&gt;
[[User:Angus|Angus]] 23:35, 17 January 2012 (GMT)&lt;br /&gt;
&lt;br /&gt;
* Redundancy - Simply stating personal axioms is not helpful.  There are several assumptions that are neither explained, supported by an argument or citation.  The phrase, &amp;quot;...and Bitcoins much greater size...&amp;quot; has no context.  What is meant by Bitcoin&#039;s size?  Does this refer to the its userbase?&lt;br /&gt;
&lt;br /&gt;
* Vulnerability to mining monopoly - &amp;quot;a malicious entity needs only produce a single piece of specialized/custom hardware to overtake all the commodity mining systems combined.&amp;quot;  There needs to be citation to back this up or a solid &amp;quot;homegrown&amp;quot; argument.  What are the economics of this type of attack?&lt;br /&gt;
&lt;br /&gt;
* Pyramid scheme - Without further context, the choice of the words, &amp;quot;Pyramid scheme&amp;quot;, is simply not applicable, as there are no promises being made, investments being soliciated, etc.  Regardless of the the ultimate fate of Litecoin, the term &amp;quot;pyramid scheme&amp;quot; is simply not applicable.  As for the fate of Litecoin, the case of its inevitable demise has simply not been made within the confines of the article.&lt;br /&gt;
&lt;br /&gt;
[[User:Dooley|Dooley]] 09:05, 9 February 2012 (GMT)&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Mining monopoly&amp;quot; section is actually totally and utterly false. scrypt is not in fact designed to be inefficient on commodity hardware; if you read the original scrypt paper it&#039;s actually designed from the ground up for efficient implement on standard CPUs. One of the main design goals of scrypt was actually to limit the benefits an attacker using custom hardware could gain over people using off-the-shelf hardware. The designers of scrypt did this by cleverly making its performance dependant on memory bandwidth rather than processing power. Since the high-speed cache RAM on modern processors already takes up most of the die space, you won&#039;t be able to get much of an improvement over them by creating custom chips. In theory the best attack would be to find off-the-shelf processors whose balance of computational resources and cache fit scrypt-as-used-in-Litecoin perfectly, but that probably still wouldn&#039;t gain you a huge amount, especially as Intel has a big process advantage over the competition. - [[User:Makomk|Makomk]] ([[User talk:Makomk|talk]]) 16:32, 4 July 2012 (GMT)&lt;br /&gt;
&lt;br /&gt;
== redundancy ==&lt;br /&gt;
&lt;br /&gt;
It would be useful if a counter-argument to this criticism were mentioned. It does add something bitcoin doesn&#039;t have - it uses CPUs rather than GPUs to mine.  --[[User:Rebroad|Rebroad]] 17:59, 21 February 2012 (GMT)&lt;/div&gt;</summary>
		<author><name>Makomk</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Merged_mining_specification&amp;diff=19002</id>
		<title>Merged mining specification</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Merged_mining_specification&amp;diff=19002"/>
		<updated>2011-11-07T22:07:33Z</updated>

		<summary type="html">&lt;p&gt;Makomk: /* Aux work merkle tree */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Aux proof-of-work ==&lt;br /&gt;
This is used to prove work on the aux chain. In vinced&#039;s original implementation it&#039;s generated by calling the getworkaux RPC method on the parent bitcoind and then the work is then submitted by passing it to the aux-chain namecoind as the second parameter to getauxblock.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| ? || txns || [[Protocol specification#tx|txn]] || Coinbase transaction linking the aux to its parent block&lt;br /&gt;
|-&lt;br /&gt;
| ? || merkle_link || [[#Merkle link|mrkllink]] || The merkle path linking the coinbase (above) to its block&lt;br /&gt;
|-&lt;br /&gt;
| ? || aux_branch_count || var_int || Number of merkle branches linking this aux chains to the aux root&lt;br /&gt;
|-&lt;br /&gt;
| 32* || aux_branch[] || char[32] || Linking aux merkle branches&lt;br /&gt;
|-&lt;br /&gt;
| 4 || index || int32_t || Index of &amp;quot;this&amp;quot; block chain in the aux chain list&lt;br /&gt;
|-&lt;br /&gt;
| 80 || parent_block || [[Protocol specification#block|block header]] || Parent block header&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Merkle link ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 32 || block_hash || char[32] || Hash of the block header&lt;br /&gt;
|-&lt;br /&gt;
| ? || branch_count || var_int || The number of links to bring the transaction to the block&#039;s merkle root&lt;br /&gt;
|-&lt;br /&gt;
| 32* || branch[] || char[32] || Linking merkle branches&lt;br /&gt;
|-&lt;br /&gt;
| 4 || index || int32_t || Index of this transaction in the merkle tree&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Merged mining coinbase ==&lt;br /&gt;
Insert exactly one of these headers into the scriptSig of the coinbase on the parent chain. vinced&#039;s code always inserts an OP_2, 0xfa, 0xbe, &#039;m&#039;, &#039;m&#039; in front of it, but you don&#039;t have to.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 32 || block_hash || char[32] || Hash of the aux work merkle tree&lt;br /&gt;
|-&lt;br /&gt;
| 4 || merkle_size || int32_t || Number of entries in aux work merkle tree. &#039;&#039;&#039;Must be a power of 2.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 4 || merkle_nonce || int32_t || Nonce used to calculate indexes into aux work merkle tree; you may as well leave this at zero&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Aux work merkle tree==&lt;br /&gt;
If you&#039;re just mining a single auxiliary chain and using getauxblock, you don&#039;t have to worry about this - just set the merkle tree hash in the coinbase to the aux chain block&#039;s hash as given by getauxblock, the merkle size to 1, and the merkle nonce to 0. If you&#039;re mining more than one, this is a bit broken. It uses the following algorithm to convert the chain ID to a slot at the base of the merkle tree in which that chain&#039;s block hash must slot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;unsigned int rand = merkle_nonce;&lt;br /&gt;
rand = rand * 1103515245 + 12345;&lt;br /&gt;
rand += chain_id;&lt;br /&gt;
rand = rand * 1103515245 + 12345;&lt;br /&gt;
slot_num = rand % merkle_size&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The idea is that you can increment merkle_nonce until the chains you&#039;re mining don&#039;t clash for the same slot. The trouble is that this doesn&#039;t work; because it just adds a number derived from the merkle_nonce to the chain_id, if two chains clash for one nonce they&#039;ll still clash for all possible nonces.&amp;lt;ref&amp;gt;https://bitcointalk.org/index.php?topic=51069.0&amp;lt;/ref&amp;gt; New implementers: please pick your chain_id so that not clashing with existing chains requires as small a value of merkle_size as possible, or use a better algorithm to calculate the slot id for your chain.&lt;br /&gt;
&lt;br /&gt;
Once you know where in the merkle tree the different chains go, &#039;&#039;reverse the bytes of each chain&#039;s block hash as given you by getauxblock&#039;&#039; (so the byte at the start moves to the end, etc) and insert into the appropriate slot, filling the unused ones with arbitrary data. Now build up the merkle tree as usual by taking each pair of values in the initial row and double SHA-256 hashing them to give a new row of hashes, repeating this until you only have a single hash. This last hash is the merkle root. You need to &#039;&#039;reverse the bytes of this again&#039;&#039; before inserting it into the coinbase. If you&#039;re not using getauxblock to get the block hash, you can skip the first reversal but still need to reverse the final merkle root when adding it to the coinbase.&lt;br /&gt;
&lt;br /&gt;
The aux proof-of-work also needs a merkle branch, which is built as follows: find the location of the block&#039;s hash in the merkle tree, and add the other value that you hashed it with in building the merkle tree. Now add the value you hashed that result with. Keep doing this until you reach the root. The merkle root itself is &#039;&#039;never&#039;&#039; included in the merkle branch. If you just have a single aux chain, this can be left entirely empty. (It also appears you &#039;&#039;don&#039;t&#039;&#039; need to reverse these hashes.)&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Makomk</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Merged_mining_specification&amp;diff=19001</id>
		<title>Merged mining specification</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Merged_mining_specification&amp;diff=19001"/>
		<updated>2011-11-07T22:06:52Z</updated>

		<summary type="html">&lt;p&gt;Makomk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Aux proof-of-work ==&lt;br /&gt;
This is used to prove work on the aux chain. In vinced&#039;s original implementation it&#039;s generated by calling the getworkaux RPC method on the parent bitcoind and then the work is then submitted by passing it to the aux-chain namecoind as the second parameter to getauxblock.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| ? || txns || [[Protocol specification#tx|txn]] || Coinbase transaction linking the aux to its parent block&lt;br /&gt;
|-&lt;br /&gt;
| ? || merkle_link || [[#Merkle link|mrkllink]] || The merkle path linking the coinbase (above) to its block&lt;br /&gt;
|-&lt;br /&gt;
| ? || aux_branch_count || var_int || Number of merkle branches linking this aux chains to the aux root&lt;br /&gt;
|-&lt;br /&gt;
| 32* || aux_branch[] || char[32] || Linking aux merkle branches&lt;br /&gt;
|-&lt;br /&gt;
| 4 || index || int32_t || Index of &amp;quot;this&amp;quot; block chain in the aux chain list&lt;br /&gt;
|-&lt;br /&gt;
| 80 || parent_block || [[Protocol specification#block|block header]] || Parent block header&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Merkle link ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 32 || block_hash || char[32] || Hash of the block header&lt;br /&gt;
|-&lt;br /&gt;
| ? || branch_count || var_int || The number of links to bring the transaction to the block&#039;s merkle root&lt;br /&gt;
|-&lt;br /&gt;
| 32* || branch[] || char[32] || Linking merkle branches&lt;br /&gt;
|-&lt;br /&gt;
| 4 || index || int32_t || Index of this transaction in the merkle tree&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Merged mining coinbase ==&lt;br /&gt;
Insert exactly one of these headers into the scriptSig of the coinbase on the parent chain. vinced&#039;s code always inserts an OP_2, 0xfa, 0xbe, &#039;m&#039;, &#039;m&#039; in front of it, but you don&#039;t have to.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 32 || block_hash || char[32] || Hash of the aux work merkle tree&lt;br /&gt;
|-&lt;br /&gt;
| 4 || merkle_size || int32_t || Number of entries in aux work merkle tree. &#039;&#039;&#039;Must be a power of 2.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 4 || merkle_nonce || int32_t || Nonce used to calculate indexes into aux work merkle tree; you may as well leave this at zero&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Aux work merkle tree==&lt;br /&gt;
If you&#039;re just mining a single auxiliary chain and using getauxblock, you don&#039;t have to worry about this - just set the merkle tree hash in the coinbase to the aux chain block&#039;s hash as given by getauxblock, the merkle size to 1, and the merkle nonce to 0. If you&#039;re mining more than one, this is a bit broken. It uses the following algorithm to convert the chain ID to a slot at the base of the merkle tree in which that chain&#039;s block hash must slot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;unsigned int rand = merkle_nonce;&lt;br /&gt;
rand = rand * 1103515245 + 12345;&lt;br /&gt;
rand += chain_id;&lt;br /&gt;
rand = rand * 1103515245 + 12345;&lt;br /&gt;
slot_num = rand % merkle_size&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The idea is that you can increment merkle_nonce until the chains you&#039;re mining don&#039;t clash for the same slot. The trouble is that this doesn&#039;t work; because it just adds a number derived from the merkle_nonce to the chain_id, if two chains clash for one nonce they&#039;ll still clash for all possible nonces.&amp;lt;ref&amp;gt;https://bitcointalk.org/index.php?topic=51069.0&amp;lt;/ref&amp;gt; New implementers: please pick your chain_id so that not clashing with existing chains requires as small a value of merkle_size as possible, or use a better algorithm to calculate the slot id for your chain.&lt;br /&gt;
&lt;br /&gt;
Once you know where in the merkle tree the different chains go, &#039;&#039;reverse the bytes of each chain&#039;s block hash as given you by getauxblock&#039;&#039; (so the byte at the start moves to the end, etc) and insert into the appropriate slot, filling the unused ones with arbitrary data. Now build up the merkle tree as usual by taking each pair of hashes in the initial row and double SHA-256 hashing them to give a new row of hashes, repeating this until you only have a single hash. This last hash is the merkle root. You need to &#039;&#039;reverse the bytes of this again&#039;&#039; before inserting it into the coinbase. If you&#039;re not using getauxblock to get the block hash, you can skip the first reversal but still need to reverse the final merkle root when adding it to the coinbase.&lt;br /&gt;
&lt;br /&gt;
The aux proof-of-work also needs a merkle branch, which is built as follows: find the location of the block&#039;s hash in the merkle tree, and add the other value that you hashed it with in building the merkle tree. Now add the value you hashed that result with. Keep doing this until you reach the root. The merkle root itself is &#039;&#039;never&#039;&#039; included in the merkle branch. If you just have a single aux chain, this can be left entirely empty. (It also appears you &#039;&#039;don&#039;t&#039;&#039; need to reverse these hashes.)&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Makomk</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Merged_mining_specification&amp;diff=19000</id>
		<title>Merged mining specification</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Merged_mining_specification&amp;diff=19000"/>
		<updated>2011-11-07T22:06:10Z</updated>

		<summary type="html">&lt;p&gt;Makomk: More on multiple aux chains&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Aux proof-of-work ==&lt;br /&gt;
This is used to prove work on the aux chain. In vinced&#039;s original implementation it&#039;s generated by calling the getworkaux RPC method on the parent bitcoind and then the work is then submitted by passing it to the aux-chain namecoind as the second parameter to getauxblock.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| ? || txns || [[Protocol specification#tx|txn]] || Coinbase transaction linking the aux to its parent block&lt;br /&gt;
|-&lt;br /&gt;
| ? || merkle_link || [[#Merkle link|mrkllink]] || The merkle path linking the coinbase (above) to its block&lt;br /&gt;
|-&lt;br /&gt;
| ? || aux_branch_count || var_int || Number of merkle branches linking this aux chains to the aux root&lt;br /&gt;
|-&lt;br /&gt;
| 32* || aux_branch[] || char[32] || Linking aux merkle branches&lt;br /&gt;
|-&lt;br /&gt;
| 4 || index || int32_t || Index of &amp;quot;this&amp;quot; block chain in the aux chain list&lt;br /&gt;
|-&lt;br /&gt;
| 80 || parent_block || [[Protocol specification#block|block header]] || Parent block header&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Merkle link ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 32 || block_hash || char[32] || Hash of the block header&lt;br /&gt;
|-&lt;br /&gt;
| ? || branch_count || var_int || The number of links to bring the transaction to the block&#039;s merkle root&lt;br /&gt;
|-&lt;br /&gt;
| 32* || branch[] || char[32] || Linking merkle branches&lt;br /&gt;
|-&lt;br /&gt;
| 4 || index || int32_t || Index of this transaction in the merkle tree&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Merged mining coinbase ==&lt;br /&gt;
Insert exactly one of these headers into the scriptSig of the coinbase on the parent chain. vinced&#039;s code always inserts an OP_2, 0xfa, 0xbe, &#039;m&#039;, &#039;m&#039; in front of it, but you don&#039;t have to.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 32 || block_hash || char[32] || Hash of the aux work merkle tree&lt;br /&gt;
|-&lt;br /&gt;
| 4 || merkle_size || int32_t || Number of entries in aux work merkle tree. &#039;&#039;&#039;Must be a power of 2.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 4 || merkle_nonce || int32_t || Nonce used to calculate indexes into aux work merkle tree; you may as well leave this at zero&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Aux work merkle tree==&lt;br /&gt;
If you&#039;re just mining a single auxiliary chain and using getauxblock, you don&#039;t have to worry about this - just set the merkle tree hash in the coinbase to the aux chain block&#039;s hash as given by getauxblock, the merkle size to 1, and the merkle nonce to 0. If you&#039;re mining more than one, this is a bit broken. It uses the following algorithm to convert the chain ID to a slot at the base of the merkle tree in which that chain&#039;s block hash must slot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;unsigned int rand = merkle_nonce;&lt;br /&gt;
rand = rand * 1103515245 + 12345;&lt;br /&gt;
rand += chain_id;&lt;br /&gt;
rand = rand * 1103515245 + 12345;&lt;br /&gt;
slot_num = rand % merkle_size&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The idea is that you can increment merkle_nonce until the chains you&#039;re mining don&#039;t clash for the same slot. The trouble is that this doesn&#039;t work; because it just adds a number derived from the merkle_nonce to the chain_id, if two chains clash for one nonce they&#039;ll still clash for all possible nonces.&amp;lt;ref&amp;gt;https://bitcointalk.org/index.php?topic=51069.0&amp;lt;/ref&amp;gt; New implementers: please pick your chain_id so that not clashing with existing chains requires as small a value of merkle_size as possible, or use a better algorithm to calculate the slot id for your chain.&lt;br /&gt;
&lt;br /&gt;
Once you know where in the merkle tree the different chains go, &#039;&#039;reverse the bytes of each chain&#039;s block hash as given you by getauxblock&#039;&#039; (so the byte at the start moves to the end, etc) and insert into the appropriate slot. Now build up the merkle tree as usual by taking each pair of hashes in the initial row and double SHA-256 hashing them to give a new row of hashes, repeating this until you only have a single hash. This last hash is the merkle root. You need to &#039;&#039;reverse the bytes of this again&#039;&#039; before inserting it into the coinbase. If you&#039;re not using getauxblock to get the block hash, you can skip the first reversal but still need to reverse the final merkle root when adding it to the coinbase.&lt;br /&gt;
&lt;br /&gt;
The aux proof-of-work also needs a merkle branch, which is built as follows: find the location of the block&#039;s hash in the merkle tree, and add the other value that you hashed it with in building the merkle tree. Now add the value you hashed that result with. Keep doing this until you reach the root. The merkle root itself is &#039;&#039;never&#039;&#039; included in the merkle branch. If you just have a single aux chain, this can be left entirely empty. (It also appears you &#039;&#039;don&#039;t&#039;&#039; need to reverse these hashes.)&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Makomk</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Merged_mining_specification&amp;diff=18998</id>
		<title>Merged mining specification</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Merged_mining_specification&amp;diff=18998"/>
		<updated>2011-11-07T21:47:02Z</updated>

		<summary type="html">&lt;p&gt;Makomk: Formatting fix&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Aux proof-of-work ==&lt;br /&gt;
This is used to prove work on the aux chain. In vinced&#039;s original implementation it&#039;s generated by calling the getworkaux RPC method on the parent bitcoind and then the work is then submitted by passing it to the aux-chain namecoind as the second parameter to getauxblock.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| ? || txns || [[Protocol specification#tx|txn]] || Coinbase transaction linking the aux to its parent block&lt;br /&gt;
|-&lt;br /&gt;
| ? || merkle_link || [[#Merkle link|mrkllink]] || The merkle path linking the coinbase (above) to its block&lt;br /&gt;
|-&lt;br /&gt;
| ? || aux_branch_count || var_int || Number of merkle branches linking this aux chains to the aux root&lt;br /&gt;
|-&lt;br /&gt;
| 32* || aux_branch[] || char[32] || Linking aux merkle branches&lt;br /&gt;
|-&lt;br /&gt;
| 4 || index || int32_t || Index of &amp;quot;this&amp;quot; block chain in the aux chain list&lt;br /&gt;
|-&lt;br /&gt;
| 80 || parent_block || [[Protocol specification#block|block header]] || Parent block header&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Merkle link ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 32 || block_hash || char[32] || Hash of the block header&lt;br /&gt;
|-&lt;br /&gt;
| ? || branch_count || var_int || The number of links to bring the transaction to the block&#039;s merkle root&lt;br /&gt;
|-&lt;br /&gt;
| 32* || branch[] || char[32] || Linking merkle branches&lt;br /&gt;
|-&lt;br /&gt;
| 4 || index || int32_t || Index of this transaction in the merkle tree&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Merged mining coinbase ==&lt;br /&gt;
Insert exactly one of these headers into the scriptSig of the coinbase on the parent chain. vinced&#039;s code always inserts an OP_2, 0xfa, 0xbe, &#039;m&#039;, &#039;m&#039; in front of it, but you don&#039;t have to.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 32 || block_hash || char[32] || Hash of the aux work merkle tree&lt;br /&gt;
|-&lt;br /&gt;
| 4 || merkle_size || int32_t || Number of entries in aux work merkle tree. &#039;&#039;&#039;Must be a power of 2.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 4 || merkle_nonce || int32_t || Nonce used to calculate indexes into aux work merkle tree; you may as well leave this at zero&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Aux work merkle tree==&lt;br /&gt;
If you&#039;re just mining a single auxiliary chain, you don&#039;t have to worry about this - just set the merkle tree hash in the coinbase to the aux chain block&#039;s hash, the merkle size to 1, and the merkle nonce to 0. If you&#039;re not, well have fun because this is a bit broken. It uses the following algorithm to convert the chain ID to a slot at the base of the merkle tree in which that chain&#039;s block hash must slot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;unsigned int rand = merkle_nonce;&lt;br /&gt;
rand = rand * 1103515245 + 12345;&lt;br /&gt;
rand += chain_id;&lt;br /&gt;
rand = rand * 1103515245 + 12345;&lt;br /&gt;
slot_num = rand % merkle_size&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The idea is that you can increment merkle_nonce until the chains you&#039;re mining don&#039;t clash for the same slot. The trouble is that this doesn&#039;t work; because it just adds a number derived from the merkle_nonce to the chain_id, if two chains clash for one nonce they&#039;ll still clash for all possible nonces.&amp;lt;ref&amp;gt;https://bitcointalk.org/index.php?topic=51069.0&amp;lt;/ref&amp;gt; New implementers: please pick your chain_id so that not clashing with existing chains requires as small a value of merkle_size as possible, or use a better algorithm for your chain.&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Makomk</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Merged_mining_specification&amp;diff=18997</id>
		<title>Merged mining specification</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Merged_mining_specification&amp;diff=18997"/>
		<updated>2011-11-07T21:46:04Z</updated>

		<summary type="html">&lt;p&gt;Makomk: Mining multiple chains: a caveat&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Aux proof-of-work ==&lt;br /&gt;
This is used to prove work on the aux chain. In vinced&#039;s original implementation it&#039;s generated by calling the getworkaux RPC method on the parent bitcoind and then the work is then submitted by passing it to the aux-chain namecoind as the second parameter to getauxblock.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| ? || txns || [[Protocol specification#tx|txn]] || Coinbase transaction linking the aux to its parent block&lt;br /&gt;
|-&lt;br /&gt;
| ? || merkle_link || [[#Merkle link|mrkllink]] || The merkle path linking the coinbase (above) to its block&lt;br /&gt;
|-&lt;br /&gt;
| ? || aux_branch_count || var_int || Number of merkle branches linking this aux chains to the aux root&lt;br /&gt;
|-&lt;br /&gt;
| 32* || aux_branch[] || char[32] || Linking aux merkle branches&lt;br /&gt;
|-&lt;br /&gt;
| 4 || index || int32_t || Index of &amp;quot;this&amp;quot; block chain in the aux chain list&lt;br /&gt;
|-&lt;br /&gt;
| 80 || parent_block || [[Protocol specification#block|block header]] || Parent block header&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Merkle link ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 32 || block_hash || char[32] || Hash of the block header&lt;br /&gt;
|-&lt;br /&gt;
| ? || branch_count || var_int || The number of links to bring the transaction to the block&#039;s merkle root&lt;br /&gt;
|-&lt;br /&gt;
| 32* || branch[] || char[32] || Linking merkle branches&lt;br /&gt;
|-&lt;br /&gt;
| 4 || index || int32_t || Index of this transaction in the merkle tree&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Merged mining coinbase ==&lt;br /&gt;
Insert exactly one of these headers into the scriptSig of the coinbase on the parent chain. vinced&#039;s code always inserts an OP_2, 0xfa, 0xbe, &#039;m&#039;, &#039;m&#039; in front of it, but you don&#039;t have to.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 32 || block_hash || char[32] || Hash of the aux work merkle tree&lt;br /&gt;
|-&lt;br /&gt;
| 4 || merkle_size || int32_t || Number of entries in aux work merkle tree. [b]Must be a power of 2.[/b]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || merkle_nonce || int32_t || Nonce used to calculate indexes into aux work merkle tree; you may as well leave this at zero&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Aux work merkle tree==&lt;br /&gt;
If you&#039;re just mining a single auxiliary chain, you don&#039;t have to worry about this - just set the merkle tree hash in the coinbase to the aux chain block&#039;s hash, the merkle size to 1, and the merkle nonce to 0. If you&#039;re not, well have fun because this is a bit broken. It uses the following algorithm to convert the chain ID to a slot at the base of the merkle tree in which that chain&#039;s block hash must slot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;unsigned int rand = merkle_nonce;&lt;br /&gt;
rand = rand * 1103515245 + 12345;&lt;br /&gt;
rand += chain_id;&lt;br /&gt;
rand = rand * 1103515245 + 12345;&lt;br /&gt;
slot_num = rand % merkle_size&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The idea is that you can increment merkle_nonce until the chains you&#039;re mining don&#039;t clash for the same slot. The trouble is that this doesn&#039;t work; because it just adds a number derived from the merkle_nonce to the chain_id, if two chains clash for one nonce they&#039;ll still clash for all possible nonces.&amp;lt;ref&amp;gt;https://bitcointalk.org/index.php?topic=51069.0&amp;lt;/ref&amp;gt; New implementers: please pick your chain_id so that not clashing with existing chains requires as small a value of merkle_size as possible, or use a better algorithm for your chain.&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Makomk</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Merged_mining_specification&amp;diff=17969</id>
		<title>Merged mining specification</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Merged_mining_specification&amp;diff=17969"/>
		<updated>2011-10-11T19:51:34Z</updated>

		<summary type="html">&lt;p&gt;Makomk: More notes.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Aux proof-of-work ==&lt;br /&gt;
This is used to prove work on the aux chain. In vinced&#039;s original implementation it&#039;s generated by calling the getworkaux RPC method on the parent bitcoind and then the work is then submitted by passing it to the aux-chain namecoind as the second parameter to getauxblock.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| ? || txns || [[Protocol specification#tx|txn]] || Coinbase transaction linking the aux to its parent block&lt;br /&gt;
|-&lt;br /&gt;
| ? || merkle_link || [[#Merkle link|mrkllink]] || The merkle path linking the coinbase (above) to its block&lt;br /&gt;
|-&lt;br /&gt;
| ? || aux_branch_count || var_int || Number of merkle branches linking this aux chains to the aux root&lt;br /&gt;
|-&lt;br /&gt;
| 32* || aux_branch[] || char[32] || Linking aux merkle branches&lt;br /&gt;
|-&lt;br /&gt;
| 4 || index || int32_t || Index of &amp;quot;this&amp;quot; block chain in the aux chain list&lt;br /&gt;
|-&lt;br /&gt;
| 80 || parent_block || [[Protocol specification#block|block header]] || Parent block header&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Merkle link ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 32 || block_hash || char[32] || Hash of the block header&lt;br /&gt;
|-&lt;br /&gt;
| ? || branch_count || var_int || The number of links to bring the transaction to the block&#039;s merkle root&lt;br /&gt;
|-&lt;br /&gt;
| 32* || branch[] || char[32] || Linking merkle branches&lt;br /&gt;
|-&lt;br /&gt;
| 4 || index || int32_t || Index of this transaction in the merkle tree&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Merged mining coinbase ==&lt;br /&gt;
Insert exactly one of these headers into the scriptSig of the coinbase on the parent chain. vinced&#039;s code always inserts an OP_2 in front of it, but you don&#039;t have to.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || mm_header || char[4] || Magic bytes: 0xfa, 0xbe, &#039;m&#039;, &#039;m&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 32 || block_hash || char[32] || Hash of the aux work merkle tree&lt;br /&gt;
|-&lt;br /&gt;
| 4 || merkle_size || int32_t || Number of entries in aux work merkle tree&lt;br /&gt;
|-&lt;br /&gt;
| 4 || merkle_nonce || int32_t || Nonce used to calculate indexes into aux work merkle tree&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Aux work merkle tree==&lt;br /&gt;
If you&#039;re just mining a single auxiliary chain, you don&#039;t have to worry about this - just set the merkle tree hash in the coinbase to the aux chain block&#039;s hash, the merkle size to 1, and the merkle nonce to 0. TODO: full documentation.&lt;/div&gt;</summary>
		<author><name>Makomk</name></author>
	</entry>
</feed>