Crafting System
Convert gameplay materials into permanent on-chain NFTs via blending recipes and upgrades.
Purpose
The crafting system transforms ephemeral gameplay resources into permanent, tradeable on-chain assets. It exists because:
- Gameplay generates materials that have no value if they remain off-chain
- Crafting creates a meaningful THC sink (economic demand)
- Permanent items create ownership stakes that improve retention
- Blending recipes allow game designers to control item scarcity
- Upgrades create a progressive investment loop
Design Philosophy
OFF-CHAIN ON-CHAIN
(gameplay creates) (crafting finalizes)
⚔️ Win matches
→ earn materials
→ accumulate resources
🔨 Craft recipe submitted
→ materials + THC consumed
→ NFT minted
→ asset tradeable
Only the output goes on-chain. The per-match material accumulation, inventory management, and resource tracking are all off-chain. The crafting action — which consumes resources and creates a permanent item — is the economic event that justifies an on-chain transaction.
Components
┌──────────────────────────────────────────────────────────┐
│ CRAFTING SYSTEM │
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌───────────────┐ │
│ │ Recipes │ │ Blending │ │ Upgrades │ │
│ │ │ │ │ │ │ │
│ │ • input list │ │ • multi-NFT │ │ • level up │ │
│ │ • THC cost │ │ combine │ │ • stat boost │ │
│ │ • output NFT │ │ • rarity │ │ • evolution │ │
│ │ • success % │ │ upgrade │ │ • THC cost │ │
│ └──────────────┘ └──────────────┘ └───────────────┘ │
│ │
└──────────────────────────────────────────────────────────┘
Recipes
A recipe defines:
| Field | Type | Description |
|---|---|---|
recipe_id | uint256 | Unique recipe identifier |
inputs | Material[] | Required materials and quantities |
thc_cost | uint256 | THC consumed on craft |
output | NFT definition | What is minted on success |
success_rate | uint8 (0-100) | Probability of success (100 = guaranteed) |
cooldown | uint256 | Minimum time between crafts (optional) |
active | bool | Whether this recipe is currently usable |
Example Recipes
[
{
recipe_id: 1,
name: "Smoke Blade",
inputs: [
{ material: "shadow_ore", quantity: 5 },
{ material: "fire_essence", quantity: 3 }
],
thc_cost: 500,
output: {
collection: "weapons",
template: "smoke_blade",
rarity: "rare"
},
success_rate: 100,
cooldown: 0
},
{
recipe_id: 2,
name: "Legendary Smoke Blade",
inputs: [
{ material: "smoke_blade_nft", quantity: 1 }, // NFT input
{ material: "dragon_scale", quantity: 10 },
{ material: "ancient_crystal", quantity: 1 }
],
thc_cost: 5000,
output: {
collection: "weapons",
template: "legendary_smoke_blade",
rarity: "legendary"
},
success_rate: 50, // 50% chance
cooldown: 86400 // 24 hour cooldown on retry
}
]
Blending
Blending combines multiple existing NFTs into a new, higher-tier NFT.
Flow
Player holds NFT A + NFT B + NFT C
│
▼
Player submits blend request
│
▼
Server verifies:
• player owns all input NFTs
• recipe exists and is active
• player has enough THC
│
▼
Input NFTs burned (or locked)
THC deducted
│
▼
If success_rate check passes:
→ Output NFT minted to player
│
If success_rate check fails:
→ Inputs consumed (no output)
→ Optional: partial refund or consolation item
Blend Types
| Type | Inputs | Output |
|---|---|---|
| Same-type fusion | 3x Common Card | 1x Uncommon Card |
| Cross-type fusion | Weapon + Armor | Enhanced Set Piece |
| Material + NFT | NFT + Materials | Upgraded NFT |
| Sacrifice blend | 5x Any NFT | Random higher-rarity NFT |
Upgrades
Upgrades improve an existing NFT's attributes without changing its identity.
Flow
Player owns NFT (Level 1)
│
▼
Player submits upgrade request:
- target NFT
- upgrade type (e.g., "attack_boost")
- materials + THC payment
│
▼
Contract verifies ownership and requirements
│
▼
Materials consumed, THC deducted
│
▼
NFT metadata updated:
- level: 1 → 2
- attack: 85 → 95
- upgrade_count: 0 → 1
Upgrade Limits
| Parameter | Purpose | Example |
|---|---|---|
max_level | Cap on total upgrades | 10 |
cost_scaling | How THC cost increases per level | 1.5x per level |
material_scaling | How material requirements increase | +2 per level |
cooldown_per_level | Wait time between upgrades at higher levels | 1 hour × level |
Cost Scaling Example
| Level | THC Cost | Materials Required |
|---|---|---|
| 1→2 | 100 | 2 shadow_ore |
| 2→3 | 150 | 4 shadow_ore |
| 3→4 | 225 | 6 shadow_ore + 1 fire_ess |
| 4→5 | 337 | 8 shadow_ore + 2 fire_ess |
| ... | 1.5x | +2 per level |
On-Chain vs Off-Chain Split
| Component | Location | Reason |
|---|---|---|
| Material accumulation | Off-chain | High frequency, no economic finality |
| Inventory management | Off-chain | Game state, updated per match |
| Recipe definitions | Off-chain | Game design data, frequently tuned |
| Craft/blend execution | On-chain | THC consumed, NFT minted — economic event |
| Upgrade execution | On-chain | THC consumed, metadata changed — economic event |
| Failed crafts | On-chain | THC still consumed, must be recorded |
Contract Interface
interface ICrafting {
// Craft an item from materials + THC
function craft(
uint256 recipeId,
uint256[] calldata inputTokenIds, // NFT inputs (if any)
uint256 nonce,
bytes calldata serverSignature // server attests material balance
) external returns (uint256 outputTokenId);
// Upgrade an existing NFT
function upgrade(
uint256 tokenId,
uint256 upgradeTypeId,
uint256 nonce,
bytes calldata serverSignature
) external returns (bool success);
// Blend multiple NFTs
function blend(
uint256 recipeId,
uint256[] calldata inputTokenIds,
uint256 nonce,
bytes calldata serverSignature
) external returns (uint256 outputTokenId);
// View
function getRecipe(uint256 recipeId) external view returns (Recipe memory);
function getUpgradeHistory(uint256 tokenId) external view returns (Upgrade[] memory);
}
Why server signatures? The server tracks off-chain materials. The contract cannot verify material balances directly. The server's signature attests that the player holds sufficient materials, and the contract trusts the authorized server key.
THC Sink Analysis
Crafting is a primary THC sink in the Monsuta Core economy:
| Action | THC Consumed | Frequency | Aggregate Impact |
|---|---|---|---|
| Basic crafting | 100–500 | Several/day | Medium |
| Legendary crafting | 1000–5000 | Weekly | High |
| Upgrades (low) | 50–200 | Daily | Medium |
| Upgrades (high) | 500–2000 | Weekly | High |
| Failed crafts | Full cost | Per attempt | Acts as extra sink |
The game designer controls inflation by tuning:
- Recipe THC costs
- Success rates (lower rate = more THC consumed per output)
- Upgrade cost scaling
Integration Guide for Other Games
Step 1: Define Your Crafting Economy
- What materials does your game produce?
- What items can players craft?
- What is the currency cost per craft?
- Do you want probabilistic crafting (success rates)?
Step 2: Design Recipes
- Map inputs (materials, NFTs, currency) to outputs (new NFTs)
- Set THC costs that balance your mint/consumption rate
- Define rarity tiers and upgrade paths
Step 3: Deploy Crafting Contract
- Register recipes on-chain
- Set the authorized server key
- Connect to your ERC-20 token contract for THC deduction
- Connect to your ERC-721/1155 contract for NFT minting
Step 4: Integrate with Game Server
- Track material accumulation off-chain
- Generate server signatures when crafting criteria are met
- Either: player submits craft tx (player pays gas) or server submits (server pays gas)
Step 5: Balance and Iterate
- Monitor THC consumption rates from crafting
- Adjust recipe costs and success rates
- Introduce new recipes each season to maintain sink demand