Author

Topic: Creating ERC20 Token for fun / knowledge growth - Changing POW Algo Question (Read 134 times)

newbie
Activity: 9
Merit: 0
I'm following this guide: https://www.ethereum.org/token

about POW here
Code:
   

 bytes32 public currentChallenge;                         // The coin starts with a challenge
    uint public timeOfLastProof;                             // Variable to keep track of when rewards were given
    uint public difficulty = 10**32;                         // Difficulty starts reasonably low

    function proofOfWork(uint nonce){
        bytes8 n = bytes8(sha3(nonce, currentChallenge));    // Generate a random hash based on input
        require(n >= bytes8(difficulty));                   // Check if it's under the difficulty

        uint timeSinceLastProof = (now - timeOfLastProof);  // Calculate time since last reward was given
        require(timeSinceLastProof >=  5 seconds);         // Rewards cannot be given too quickly
        balanceOf[msg.sender] += timeSinceLastProof / 60 seconds;  // The reward to the winner grows by the minute

        difficulty = difficulty * 10 minutes / timeSinceLastProof + 1;  // Adjusts the difficulty

        timeOfLastProof = now;                              // Reset the counter
        currentChallenge = sha3(nonce, currentChallenge, block.blockhash(block.number - 1));  // Save a hash that will be used as the next proof
    }
member
Activity: 126
Merit: 10
Renewable Energy Cryptocurrency
I also want to learn how to create a new coin and I am searching about it here. Yes I found many sources but I will follow this thread as well. Maybe some people will share their experience here.
newbie
Activity: 9
Merit: 0
I'm creating an ERC20 token for fun and to get a better understanding of the basics.

I'd love to explore different POW algorithms as I believe in the true decentralization that GPU mining offers.

Can anyone help me with the code to implement something like equihash to an ERC20 token?

Jump to: