Skip to content

Latest commit

 

History

History
205 lines (144 loc) · 10.2 KB

CIP-0002.md

File metadata and controls

205 lines (144 loc) · 10.2 KB
eip title author status type category created
2
Merge Mining
Draft
Standards Track
Core
2024-11-22

Abstract

This CIP-0002 decribe the technical behind merge mining, what is it and how it work.

What is Merge-Mining?

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.

Traditional Merge-Mining: An Overview

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 Merge-Mining: Unlocking Cross-Chain Synergy

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.

Key Features of Canxium’s Approach:

  • 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.

Key Differences: Traditional vs. Canxium Merge-Mining

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

Mining Integration

Purpose

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.

Technical Details

  • 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.

Key Considerations:

  • Litecoin’s block validation process remains unaffected.
  • Miners need software capable of including an Canxium address in the coinbase transaction for merge-mining purposes.

Type 0xC4 Transaction Creation on Canxium

Purpose

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.

Transaction Structure

A type 0xC4 transaction includes:

  1. Litecoin Block Header:

    • Contains metadata such as the block hash, timestamp, and difficulty level.
    • Used by Canxium validators to verify the PoW solution.
  2. Canxium Address:

    • Extracted from the vout of the coinbase transaction in the Litecoin block.
    • Acts as the recipient of the CAU rewards.
  3. Block Difficulty:

    • Indicates the computational effort required to mine the Litecoin block.
    • Directly influences the reward calculation on Canxium.
  4. Proof-of-Work Solution:

    • Includes the nonce and resulting hash from the Litecoin PoW process.
    • Enables validators to independently verify the solution.

Key Considerations:

  • 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.

3. Canxium Validator Responsibilities

Purpose

Validators ensure the integrity of the merge-mining process by verifying the PoW workload, embedded data, and reward eligibility.

Validation Steps

  1. Extract Litecoin Block Header:

    • Parse the block header from the type 0xC4 transaction.
  2. Verify Litecoin PoW:

    • Check if the hash meets Litecoin’s difficulty target.
    • Validate the nonce and hash provided in the block header.
  3. Check Canxium Address:

    • Confirm the Canxium address is correctly formatted and valid.
  4. Confirm Block Difficulty:

    • Retrieve the difficulty level of the Litecoin block.
    • Ensure it matches the difficulty provided in the transaction.
  5. Prevent Double-Spending:

    • Maintain a record of processed Litecoin block headers to prevent miners from submitting the same proof multiple times.

Key Considerations:

  • 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.

4. Reward Calculation

Purpose

The reward system incentivizes miners by distributing CAU tokens based on their contribution to the PoW workload.

Formula

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.

Reward Distribution

  1. CAU tokens are minted by Canxium and sent to the Canxium address embedded in the Litecoin block’s coinbase transaction.
  2. Transactions are publicly recorded on the Canxium blockchain for transparency.

Key Considerations:

  • The reward system should adjust dynamically to market conditions to remain attractive to miners.
  • Validators must ensure rewards are distributed fairly and accurately.

5. Handling Edge Cases

Invalid Litecoin Block Header

  • Cause: The block header does not meet Litecoin’s PoW requirements.
  • Action: The type 0xC4 transaction is rejected by Canxium validators.

Malformed Canxium Address

  • 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.

Duplicate Submissions

  • Cause: A miner attempts to submit the same Litecoin block header multiple times.
  • Action: Validators reject duplicate type 0xC4 transactions based on their records.

Low Reward Concern

  • 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.

6. Security Measures

Sybil Resistance

  • Proof-of-Work ensures that only miners who perform valid computational work can submit type 0xC4 transactions.

Validation Transparency

  • All validation steps are recorded on the Canxium blockchain, allowing anyone to audit the process.

Scalability

  • Validators are optimized to handle high volumes of type 0xC4 transactions as miner participation increases.

7. Miner Workflow

Step-by-Step Process

  1. 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.
  2. Prepare a Type 0xC4 Transaction:

    • Extract the Litecoin block header, difficulty, and embedded Canxium address.
    • Construct a type 0xC4 transaction with the required fields.
  3. Submit the Transaction to Canxium:

    • Broadcast the type 0xC4 transaction to the Canxium network.
  4. Wait for Validation:

    • Validators confirm the validity of the submitted proof.
  5. Receive Rewards:

    • Once validated, CAU tokens are transferred to the embedded Canxium address.

8. Benefits of Canxium Merge-Mining

  • 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.

Implementation

TODO