Summary
NFTrig: Using Blockchain Technologies for Math Education
Highlights
NFTrig is a web-based application developed to teach trigonometry and blockchain technology. Users can buy digital artwork of trigonometric functions as NFTs and combine them using mathematical operations like multiplication and division. The result is a new NFT, while the original cards are 'burned'. NFTs have rarity levels (common, uncommon, rare, legendary), and users can also answer trivia questions to earn experience points, which can unlock new NFT sets or upgrade existing ones. The application connects to MetaMask for digital asset storage and OpenSea for marketplace access, with its backend hosted on Moralis.
The application's motivation stems from its potential as an educational tool, allowing students to interact with trigonometric functions in a hands-on manner, moving beyond traditional graphing. This aligns with the increasing integration of technology in education and aims to bridge the gap between academic curricula and cutting-edge industry technologies like blockchain. NFTrig also contributes to research in blockchain and education, serving as a potential boilerplate for other NFT-based educational tools. It was developed by computer science students as a senior project. Blockchain technology's decentralized nature provides benefits across various fields, including education, healthcare, and gaming. Prior research highlights blockchain's use in managing educational records like transcripts and supporting lifelong learning and collaborative environments. NFTs, built on secure Ethereum blockchain, offer further advantages in verifying academic credentials and incentivizing student learning outcomes, making certifications easily attainable and shareable.
The application incorporates gamification to enhance mathematical learning, particularly for trigonometry. Games have traditionally been effective tools for teaching math, and gamification, combined with incentivization, can increase student engagement and interest, especially for subjects with clear, numerical answers like trigonometry. NFTrig's design, involving collecting and combining NFTs, mirrors elements found in online games. While gamification can improve interest, it has limitations, such as difficulty in assessing how a student arrived at a solution; future plans for NFTrig include fostering communication among players and providing learning resources to address these. The project is likely the first to leverage NFTs and blockchain for teaching trigonometric equations.
The NFTrig project utilizes several software development tools. Smart contracts are created and tested on Remix, an online compiler IDE, and debugged using Visual Studio Code with Solidity and Blockchain development plugins. Moralis SDK serves as the primary backend platform, connecting the web application to smart contracts and facilitating user authentication and MetaMask integration. MetaMask is crucial for users, storing cryptocurrencies and NFTs, and allowing interaction with the NFTrig application. Frontend design is primarily done in Visual Studio using HTML and CSS, with Bootstrap5 extensively used for simplified design and layout. Initial hosting was on a local server, with future plans for a decentralized web application.
The software architecture follows a model-server design, with client requests interacting with proxy and logic smart contracts on the blockchain, ensuring upgradeability. Solidity is chosen for smart contract development, utilizing OpenZeppelin libraries, with Hardhat and Node.js for testing and deployment on the Polygon blockchain. JavaScript is used for dynamic frontend elements, button functionality, and connecting the frontend to backend smart contracts. HTML and CSS (with Bootstrap5) are used for the user interface, prioritizing clean design and responsiveness. Security considerations include mechanisms to prevent unauthorized viewing of user tokens, ensure card ownership before combination, and validate new NFT minting against predefined probabilities.
The smart contract system is divided into two primary contracts: the NFTrig logic contract (handling card purchases and combination logic) and the marketplace contract (managing sales and trading). Both are upgradeable. NFT images are stored locally with a specific naming convention that encodes information about the trigonometric function, rarity, and text variant (e.g., 1023.jpg). This allows the frontend to easily determine image details based on token features. The client interface uses HTML and CSS, with Bootstrap5 for responsive design. The navigational bar provides access to various pages like Home, MyCards, CombineCards, Marketplace, and Game. The Combination page allows users to select and combine cards, displaying potential results, and utilizes Bootstrap5 for responsive layouts. Marketplace and MyCards pages display NFTs owned by the user or available for purchase, with rarity indicated by color and text options. Quality attributes for the client-side include component reusability, consistent style, commenting, consistent feedback systems, avoidance of page-level styling, and basic accessibility testing. Thorough user case testing has been conducted, with future plans for rigorous JavaScript and external API testing. A future 'Game' feature includes trivia questions allowing users to earn experience points for purchasing or combining NFTs.
The project's initial methods involved hosting the frontend on a local Augustana College server and the backend smart contract on the Polygon test net for testing and validation. The final version is intended for a decentralized web application online, requiring a redesign to NextJS from Bootstrap5 for displaying and interacting with cards via JavaScript. The project successfully explored applying NFT and blockchain technology to math education, delivering a working beta demo that showcases application functionality and correct smart contract execution. The smart contract is deployed on the Polygon testnet, and web pages are functional for displaying user-owned NFTs and marketplace listings. The web page is not strictly required to interact with NFTrig smart contracts directly.
Future development for NFTrig includes implementing a game option with trigonometry trivia and math problems. Successfully answering these questions will grant users experience points, which can then be used to purchase individual or packs of NFTrig cards, or to combine existing cards, reducing the reliance on cryptocurrency for these actions.