Coin Mining Contest

The goal of this contest is for students to mine and claim as many CPEN442 coins as they can.


  1. Choose a private miner ID, which we refer to as private_id. Then, compute your public miner ID:
     public_id = SHA256(private_id) 

    Keep in mind that your private_id should not be publicly known,  and you should keep it secret until the contest is over. Its knowledge by other CPEN 442 students will allow them to claim the coins mined by the corresponding public_id.

  2. Start mining CPEN442 coins. To mine a coin, you have to find a coin_blob such that the hash
    SHA256(“CPEN 442 Coin” + “2020” + hash_of_preceding_coin + coin_blob + id_of_miner)

    starts with a specified number of “0” characters in the hexadecimal notation. The number of required leading “0”s, which we refer to as difficulty_level, changes overtime based on how quickly coins are being mined. At each point in time, the current difficulty_level can be retrieved using the difficulty API (accessible here).
    In the hash above, id_of_miner should be your public_id  and hash_of_preceding_coin should be retrieved using the last_coin API (accessible here). Keep in mind that this is a competition and if someone claims a coin before you, hash_of_preceding_coin and difficulty_level will change and you have to start the mining process over.

  3. After you successfully mine a coin, be quick to claim it using the claim_coin API (available here) and start mining a new coin using the new hash_of_preceding_coin value.
  4. Once the contest ends, you need to claim rewards for your coins by submitting your private_ids to the teaching staff through Canvas. We will then compute all of your public_ids and calculate your reward based on the number of coins that has been claimed by your public_ids.

Rules of the contest:

  1. The contest will start on November 16th 11:00 AM and will run until December 7th 9:00 PM.
  2. Attacking the coin website (e.g., DDoS, DoS, web attacks) is not allowed and will result in disqualification. The server also limits the number of requests you can make in a minute.
  3. CPEN 442 students are allowed to share miner IDs (i.e., a group of CPEN 442 students can use a single miner_id for mining coins). This may allow them to aggregate hardware resources and mine more coins.
  4. Each student can claim rewards for any number of miner_ids during the reward claiming period. The coins will be evenly divided among all the students who submit the corresponding private_ids.
  5. The reward claiming period is December 8th, 9:00 AMDecember 11th, 9:00 PM.
  6. Any coins that you claim (or might have claimed already) before the start of the contest or after the end of the contest will not count towards your reward.
  7. You are allowed to discuss the details of the coin-mining implementation with others.
  8. To claim a coin, it has to be accepted by the claim coin API (available here). The teaching staff will not be able to give you feedback for why your coin is not accepted by the API.


  1. The contest participants will collectively get the total award (total_award) of bonus 5% to the final marks in the course.
  2. Each miner_id will receive an award proportional to the number of coins they mined. To claim an award, the student needs to demonstrate that the corresponding miner_ids belong(s) to them, by providing the corresponding private_id. Each miner_id will receive a share of the total prize proportionate to the number of coins that claimed by that miner_id. To compute the prize for each miner_id, we will use the following formula:
    C_i = total number of coins mined by miner i (0 ≤ Y_i ≤ X)
    C = the grand total of number of coins mined and claimed for award.
    A_i = award of miner i
    A_i = (C_i / C) * total_award
  3. If n students claim award for the same miner_id i, the award for i will be equally divided among all the claiming students, i.e., A_i/n.
  4. You can visit to check the total number of coins mined so far,top 5 miners, and the number of coins mined by a particular miner.