Coin Mining Contest

 


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

Instructions:

  1. Chose a private miner ID (referred to as private_id) for yourself. This can be any random string. Then, compute your public miner ID (a.k.a., public_id) in the following way:
     public_id = SHA256(private_id) 

    Keep in mind that your private_id should not be publicly known. 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” + “2022” + hash_of_preceding_coin + coin_blob + id_of_miner)
    

    starts with a certain 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 of the coin website (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. Once 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. They will compute all of your public_ids (by hashing your private_ids) and calculate your reward based on the number of coins that has been claimed by your public_ids.
  5. Lastly, as a learning opportunity for all students, if any student (or group of students sharing the same miner id) claim more than 30% of all coins, they are required to give a 5-minute in-class presentation in class on how they did so. The presentation should explain (1) how their miner worked (e.g., what programming language was used, how the code was optimized) and (2) what resources were used to mine coins (i.e., what was the hardware specifications of the computer(s) that ran the miner).

Rules of the contest:

  1. 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.
  2. 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.
  3. 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.
  4. 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. We will reset the coin database before the start of the contest.
  5. You are allowed to discuss the details of the coin-mining implementation with others.
  6. 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.

Award:

  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 http://cpen442coin.ece.ubc.ca/ to check the total number of coins mined so far, top 5 miners, and the number of coins mined by a particular miner.