Mining and Staking


This is module 8 of 10 for the Blockchain and Cryptocurrency course.

Module 7 << | >> Module 9

Readings

Consensus

Mining

Hash(ing)

Block Header

Staking

+

Self-Directed Learning

  • Develop a mini business plan for mining. How would you set it up? What would be your costs and earnings?
  • Stake some of your tokens. Staking is a way for you to put your tokens to work for you.

+

Online Discussion of Module Topic

Write down what you are learning and questions that you may already have about mining and staking. Here are some prompts to get you thinking:

  • Explain how mining works in your own words.
  • Explain how staking works in your own words.
  • What is the role of hashing in mining?
  • Compare and contrast proof-of-work and proof-of-stake.
  • What are the environmental issues around mining. Is there a way forward?
  • What is the status of Ethereum’s transition to proof-of-stake?
  • What is your experience of staking some of your own tokens?
  • Compare and contrast lending and staking (benefits, risks, etc.)
  • What kind of returns can you earn in staking?

+

Technical Exercise

The technical exercise for Module 8 continues the use of Truffle Suite (https://www.trufflesuite.com) for building Ethereum apps. You are encouraged to explore and use Truffle for your group project work. For this module, you will finish the Truffle tutorial called “Pet Shop” on your local machine. An added layer of complexity in this module is to interact with a frontend UI (user interface).  At the end of this tutorial, you will have a fully operational, end-to-end dapp with a React Frontend and Ethereum Smart Contract Backend.

Step 1. Open the Truffle “Pet Shop” tutorial (https://www.trufflesuite.com/tutorial).

Step 2. Complete the “Creating a user interface to interact with the smart contract” section in the tutorial. This section includes “Instantiating web3”, “Instantiating the contract”, “Getting The adopted pets and updating the UI” and “Handling the adopt() function”. In this part of the tutorial, the connection between the frontend and backend happens with the web3 Javascript library, which will interact with the Ethereum blockchain to retrieve user accounts, send transactions, and interact with smart contracts. 

Step 3. Complete the “Interacting with a dapp in a browser” section in the tutorial. This section includes “Installing and configuring Metamask”, “Installing and configuring lite-server”, and “Using the dapp”. Your prior experience using Metamask will be helpful for this part of the module. MetaMask is used again to store test ETH tokens via a Custom RPC.

Step 4. Document successful completion of the tutorial. To complete the Module 8 technical exercise, take two screenshots: one of the running dapp frontend and one of the Contract Interaction transaction in your MetaMask wallet. Submit these both to the Module 8 Assignments folder under your personal Github fork.

+

Team Project Work

Your team should continue working on the business proposition and technical implementation of your decentralized application.

–Business Contributors

Each team should make one post to the online discussion under “Other Topics” for Module 8. That post should include the following:

Step 1. Provide more detail about the business model of your decentralized app. How will it make money? How will that money be collected? What are the expected development costs?

Step 2. Create a recorded presentation. In your post, include a link to the recorded presentation (6 minutes or less) that explains your decentralized application (~2 min), highlights how the business model will make money (~2 min), and demonstrates a basic functioning of the dapp based on the work of the technical contributors (~2 min). You can create the video file using any approach you like, but one option is to use Panopto. The DePaul website “Panopto Help for Students” has instructions for how to do this. You should follow the “Video Is for the Class to See” section. This explains how to create a video, how to upload a Panopto video to the discussion, and how to upload a non-Panopto video to the discussion.

–Technical Contributors

Step 1. Develop one or more smart contracts for your dapp. Submit the smart contract code to your team GitHub branch.

Step 2. Document successful testing of your smart contract. Develop and run 5 or more tests of your smart contract. Submit the test code to your team GitHub branch.