eip | title | author | status | type | category | created |
---|---|---|---|---|---|---|
2 |
Merge Mining |
Canximan ([email protected]) |
Draft |
Standards Track |
Core |
2024-11-22 |
This CIP-0002 decribe the technical behind merge mining, what is it and how it work.
Merge-mining is a process that allows miners to use the computational work from one blockchain’s proof-of-work (PoW) algorithm to simultaneously contribute to another blockchain. This enables miners to efficiently mine two (or more) blockchains without incurring additional computational costs.
Traditionally, merge-mining is used to secure smaller or newer blockchains by leveraging the hashing power of an already established and secure blockchain. However, Canxium introduces a novel twist: instead of focusing on blockchain security, Canxium’s merge-mining centers around creating new tokens as evidence of completed PoW workloads.
In traditional merge-mining setups:
- Single PoW Problem: Miners solve a PoW problem that satisfies the difficulty requirements of both blockchains.
- Shared Headers: Miners include the block headers of both blockchains in their computational work, ensuring compatibility.
- Dual Validation: Blocks are submitted to and validated by both blockchains independently, with miners receiving rewards from each network.
This method is primarily designed to enhance the security of smaller blockchains while maximizing miners' efficiency.
Canxium redefines merge-mining by focusing on token creation rather than blockchain security. Its innovative approach leverages the computational power of other PoW blockchain miners, particularly those in the Litecoin network, to generate CAU coins as proof of completed workloads.
- Token-Centric: Each CAU coin represents a tangible PoW workload, enhancing the intrinsic value of the Canxium ecosystem.
- Cross-Chain Collaboration: Canxium creates a symbiotic relationship between its ecosystem and other PoW miners, fostering collaboration and growth across blockchains.
- Offline Mining Mechanism: Unlike traditional setups, Canxium integrates a transaction-based validation process (type 0x4 transactions) linked to external PoW results, such as Litecoin blocks.
This reimagined merge-mining model transforms the process from a security-focused mechanism to a decentralized token-generation system.
Aspect | Traditional Merge-Mining | Canxium Merge-Mining |
---|---|---|
Primary Purpose | Enhance blockchain security | Generate CAU coins as proof of completed PoW workloads |
Mechanics | Solve a single PoW problem for both blockchains | Integrate external PoW results into Canxium’s PoW validation via type 0x4 transactions |
Rewards | Native tokens from both blockchains | CAU coins based on external PoW difficulty |
To integrate Canxium’s ecosystem with Litecoin, Litecoin miners act as participants by embedding their Canxium addresses into Litecoin block’s coinbase transactions. This ensures compatibility and establishes a link between the two blockchains.
-
Coinbase Transaction:
- In Litecoin mining, the coinbase transaction is the first transaction in a block and is used to reward the miner.
- Miners modify this transaction to include an Canxium address in the
vout
(output) field. - This Canxium address serves as the recipient of CAU rewards on Canxium.
-
Scrypt PoW:
- Litecoin uses the Scrypt PoW algorithm, requiring miners to find a hash below a certain target.
- Miners continue their regular Litecoin mining process, solving the PoW with no modifications to the mining hardware or algorithm.
- Litecoin’s block validation process remains unaffected.
- Miners need software capable of including an Canxium address in the coinbase transaction for merge-mining purposes.
A type 0xC4 transaction is the mechanism through which Litecoin miners submit proof of their PoW workload to the Canxium blockchain for validation and reward.
A type 0xC4 transaction includes:
-
Litecoin Block Header:
- Contains metadata such as the block hash, timestamp, and difficulty level.
- Used by Canxium validators to verify the PoW solution.
-
Canxium Address:
- Extracted from the
vout
of the coinbase transaction in the Litecoin block. - Acts as the recipient of the CAU rewards.
- Extracted from the
-
Block Difficulty:
- Indicates the computational effort required to mine the Litecoin block.
- Directly influences the reward calculation on Canxium.
-
Proof-of-Work Solution:
- Includes the nonce and resulting hash from the Litecoin PoW process.
- Enables validators to independently verify the solution.
- Miners must ensure all required fields are properly formatted.
- Software tools or scripts are needed to automate the creation and submission of type 0xC4 transactions.
Validators ensure the integrity of the merge-mining process by verifying the PoW workload, embedded data, and reward eligibility.
-
Extract Litecoin Block Header:
- Parse the block header from the type 0xC4 transaction.
-
Verify Litecoin PoW:
- Check if the hash meets Litecoin’s difficulty target.
- Validate the nonce and hash provided in the block header.
-
Check Canxium Address:
- Confirm the Canxium address is correctly formatted and valid.
-
Confirm Block Difficulty:
- Retrieve the difficulty level of the Litecoin block.
- Ensure it matches the difficulty provided in the transaction.
-
Prevent Double-Spending:
- Maintain a record of processed Litecoin block headers to prevent miners from submitting the same proof multiple times.
- Validators must process type 0xC4 transactions efficiently to handle high volumes as adoption grows.
- The validation process must be transparent to build trust within the ecosystem.
The reward system incentivizes miners by distributing CAU tokens based on their contribution to the PoW workload.
Reward = Base Reward * Litecoin Block Difficulty
-
Base Reward:
- A fixed value defined by Canxium’s monetary policy.
- Represents the minimum reward for a unit difficulty of PoW.
-
Litecoin Block Difficulty:
- Reflects the computational effort required to mine the block.
- Scaled to align with Canxium’s reward system.
- CAU tokens are minted by Canxium and sent to the Canxium address embedded in the Litecoin block’s coinbase transaction.
- Transactions are publicly recorded on the Canxium blockchain for transparency.
- The reward system should adjust dynamically to market conditions to remain attractive to miners.
- Validators must ensure rewards are distributed fairly and accurately.
- Cause: The block header does not meet Litecoin’s PoW requirements.
- Action: The type 0xC4 transaction is rejected by Canxium validators.
- Cause: The Canxium address in the coinbase transaction is invalid or improperly formatted.
- Action: The type 0xC4 transaction is marked as invalid, and no rewards are issued.
- Cause: A miner attempts to submit the same Litecoin block header multiple times.
- Action: Validators reject duplicate type 0xC4 transactions based on their records.
- Cause: Initial CAU market value may result in rewards being perceived as insignificant.
- Solution: Educate miners about the zero-cost nature of merge-mining and potential CAU appreciation.
- Proof-of-Work ensures that only miners who perform valid computational work can submit type 0xC4 transactions.
- All validation steps are recorded on the Canxium blockchain, allowing anyone to audit the process.
- Validators are optimized to handle high volumes of type 0xC4 transactions as miner participation increases.
-
Mine a Litecoin Block:
- Solve the Scrypt PoW algorithm to create a valid Litecoin block.
- Include an Canxium address in the
vout
field of the coinbase transaction.
-
Prepare a Type 0xC4 Transaction:
- Extract the Litecoin block header, difficulty, and embedded Canxium address.
- Construct a type 0xC4 transaction with the required fields.
-
Submit the Transaction to Canxium:
- Broadcast the type 0xC4 transaction to the Canxium network.
-
Wait for Validation:
- Validators confirm the validity of the submitted proof.
-
Receive Rewards:
- Once validated, CAU tokens are transferred to the embedded Canxium address.
- Zero Additional Cost: Miners leverage existing operations to earn CAU tokens.
- Decentralized Token Creation: Each CAU represents evidence of completed PoW workloads.
- Interoperability: Builds bridges between Litecoin and Canxium, fostering ecosystem growth.
- Incentive for Early Adoption: The low barrier to entry encourages Litecoin miners to participate.
TODO