Master's Research: Building GreedyLearner and Blockchain Reward Systems
The Research Journey
My Master's degree at Amirkabir University of Technology (2018-2021) was a period of deep exploration into two fascinating areas: gamification in education and blockchain technology. This research led to two significant projects that shaped my understanding of both fields.
Project 1: GreedyLearner - Gamified Algorithm Learning
The Problem
Computer science students often struggle with understanding algorithms. Traditional teaching methods—lectures and textbooks—don't engage students effectively. I wanted to create a solution that would make learning algorithms interactive, engaging, and effective.
The Solution: GreedyLearner
GreedyLearner is an Android application that gamifies the learning of computer science algorithms through a guided discovery approach. Instead of just reading about algorithms, students interact with them, solve puzzles, and earn rewards.
Key Features
- Step-by-step algorithm execution
- Visual representation of data structures
- Interactive controls to step through algorithms
- Points and achievements
- Progress tracking
- Leaderboards
- Unlockable content
- Structured curriculum
- Difficulty progression
- Hints and explanations
- Practice problems
Technical Implementation
// Algorithm visualization engine
public class AlgorithmVisualizer {
private Algorithm algorithm;
private VisualizationView view;
public void executeStep() {
AlgorithmStep step = algorithm.getNextStep();
// Update visualization
view.highlightElement(step.getElement());
view.updateState(step.getState());
// Update progress
updateProgress(step);
// Check for completion
if (algorithm.isComplete()) {
onAlgorithmComplete();
}
}
private void onAlgorithmComplete() {
// Award points
int points = calculatePoints();
userService.addPoints(points);
// Check achievements
achievementService.checkAchievements();
// Unlock next level
levelService.unlockNext();
}
}
Gamification System
// Achievement system
public class AchievementService {
public void checkAchievements(User user) {
List achievements = getAvailableAchievements();
for (Achievement achievement : achievements) {
if (!user.hasAchievement(achievement) &&
achievement.isUnlocked(user)) {
unlockAchievement(user, achievement);
notifyUser(achievement);
}
}
}
private void unlockAchievement(User user, Achievement achievement) {
user.addAchievement(achievement);
user.addPoints(achievement.getPoints());
// Save to database
database.saveUser(user);
// Analytics
analytics.track("achievement_unlocked", {
"achievement_id": achievement.getId(),
"user_id": user.getId()
});
}
}
Results
Project 2: Blockchain-Based Virtual Coin System
The Challenge
As a member of the university's Blockchain Committee, I was tasked with developing a proof-of-concept virtual coin and reward system. The goal was to create a system where users could earn blockchain-based tokens from real-world transactions.
Technology Choice: Hyperledger Sawtooth
I chose Hyperledger Sawtooth because:
System Architecture
┌─────────────────────────────────────────┐
│ Client Applications │
│ - Web dashboard │
│ - Mobile app │
└──────────────┬──────────────────────────┘
│ REST API
▼
┌─────────────────────────────────────────┐
│ Node.js Backend │
│ - Business logic │
│ - Transaction creation │
│ - Query processing │
└──────────────┬──────────────────────────┘
│ REST API
▼
┌─────────────────────────────────────────┐
│ Hyperledger Sawtooth │
│ - Transaction processor │
│ - State management │
│ - Consensus (PoET) │
└─────────────────────────────────────────┘
Implementation
Transaction Family (Coin Transfer):
# Sawtooth transaction processor
class CoinTransferHandler(TransactionHandler):
@property
def family_name(self):
return 'coin-transfer'
@property
def family_versions(self):
return ['1.0']
@property
def namespaces(self):
return [self._namespace]
def apply(self, transaction, context):
# Parse transaction
header = transaction.header
payload = CoinTransferPayload.from_bytes(transaction.payload)
# Get current balances
sender_address = self._make_address(payload.sender)
recipient_address = self._make_address(payload.recipient)
sender_balance = self._get_balance(context, sender_address)
recipient_balance = self._get_balance(context, recipient_address)
# Validate transaction
if sender_balance < payload.amount:
raise InvalidTransaction('Insufficient balance')
# Update balances
new_sender_balance = sender_balance - payload.amount
new_recipient_balance = recipient_balance + payload.amount
# Save to state
self._set_balance(context, sender_address, new_sender_balance)
self._set_balance(context, recipient_address, new_recipient_balance)
return None
Node.js Integration:
// Backend service for coin operations
class CoinService {
async transferCoins(
fromUserId: string,
toUserId: string,
amount: number
): Promise {
// 1. Validate transaction
const fromBalance = await this.getBalance(fromUserId);
if (fromBalance < amount) {
throw new Error('Insufficient balance');
}
// 2. Create transaction payload
const payload = {
sender: fromUserId,
recipient: toUserId,
amount: amount,
timestamp: Date.now()
};
// 3. Submit to Sawtooth
const transaction = await this.sawtoothClient.submitTransaction(
'coin-transfer',
payload
);
// 4. Wait for confirmation
await this.waitForConfirmation(transaction.id);
// 5. Update local database
await this.updateLocalBalances(fromUserId, toUserId, amount);
return transaction.id;
}
async getBalance(userId: string): Promise {
// Query Sawtooth state
const address = this.makeAddress(userId);
const state = await this.sawtoothClient.getState(address);
if (state) {
return this.parseBalance(state);
}
return 0;
}
}
Use Cases
- Students earn coins for completing assignments
- Coins can be redeemed for course materials
- Transparent reward distribution
- Researchers reward participants with coins
- Coins tracked on blockchain for transparency
- Immutable record of contributions
- Students can transfer coins to peers
- Recognition for helpful contributions
- Social reward mechanism
Results
Research Impact
Publications
Skills Developed
Lessons Learned
Conclusion
My Master's research at Amirkabir University was a formative experience. It allowed me to explore two fascinating areas—gamification and blockchain—and create real, working systems. GreedyLearner demonstrated that interactive, gamified learning can significantly improve educational outcomes, while the blockchain reward system showed how distributed ledger technology can provide transparency and trust in institutional systems.
The research skills I developed—from experimental design to technical implementation—continue to inform my approach to building systems today.
---
Interested in gamification, blockchain, or educational technology? Let's discuss!