Back to Portfolio
Banana NFT: Blockchain Backend with Merkle Verification
Blockchain & NFT

Banana NFT: Blockchain Backend with Merkle Verification

Production-grade NFT backend with Node.js, Solidity smart contracts, and Merkle tree verification processing $50K+ volume.

Project Overview

The Challenge

Traditional NFT platforms reveal metadata immediately after minting, creating opportunities for bots to snipe rare NFTs by analyzing metadata before legitimate users can claim them.

Most NFT backends store complete token arrays and metadata indefinitely, leading to exponential storage growth and degraded performance as the collection scales.

Existing platforms use global minting queues where all users compete for the same pool, creating unfair advantages for users with faster connections or automated scripts.

Standard NFT minting operations consume excessive gas due to inefficient storage patterns and lack of batch optimization, making minting prohibitively expensive for users.

Without cryptographic verification, NFT metadata can be tampered with or manipulated, compromising the integrity of the entire collection and user trust.

Architected and developed a production-grade NFT backend service implementing Merkle tree-based verification for secure minting and revealing. The platform features user-centric processing with independent minting cycles, automatic cleanup mechanisms, and gas-optimized operations that have processed over $50,000 in transaction volume.

Designed and deployed ERC721 smart contracts with OpenZeppelin libraries, implementing Merkle proof verification for metadata integrity and time-based reveal windows. Achieved 40% gas cost reduction through batch operations and optimized storage patterns using token ID ranges instead of arrays.

Built comprehensive RESTful API with Express featuring user management via heartbeat system, automatic NFT minting on user login, and periodic cleanup of expired batches. Implemented extensive test suite with Mocha and Chai achieving 95%+ code coverage across API endpoints, Merkle verification, and user minting cycles.

Technical Architecture

Click diagram to zoom

Express API Layer: RESTful endpoints for NFT operations, user management, and system health monitoring with Morgan logging and error handling middleware

User Management Service: Heartbeat-based activity tracking, automatic user registration, per-user minting cycles, and inactivity-based cleanup with configurable thresholds

NFT Service: Minting engine with Ethereum integration, reveal engine with Merkle verification, batch expiration management, and token ID range optimization

Merkle Tree System: Cryptographic proof generation using keccak256 hashing, on-chain verification via MerkleProof.sol, URI integrity validation, and efficient proof storage

Smart Contract Layer: ERC721 implementation with Ownable access control, Merkle root storage and verification, time-based reveal windows, and gas-optimized batch operations

Key Challenges & Solutions

1

Merkle Tree Proof Generation & Verification

Implemented merkletreejs library with keccak256 hashing, created efficient proof generation pipeline, added on-chain verification using OpenZeppelin's MerkleProof.sol, and optimized proof storage with indexed Merkle roots array.

2

User-Centric Minting Cycles

Designed per-user minting timers with configurable intervals, implemented heartbeat system for activity tracking, created automatic mint triggering on user login, and added user-specific cleanup to prevent data accumulation.

3

Storage Optimization with Token ID Ranges

Replaced token arrays with efficient startTokenId/endTokenId ranges, implemented automatic cleanup of expired batches, added periodic URI pruning for unrevealed tokens, and reduced storage footprint by 70% compared to array-based approach.

4

Gas Optimization for Batch Operations

Implemented batch minting in single transaction, optimized storage patterns using mappings instead of arrays, reduced contract deployment size through efficient Solidity patterns, and achieved 40% gas cost reduction per NFT minted.

5

Automated Cleanup & Maintenance

Built automatic batch expiration based on configurable thresholds, created user-specific cleanup endpoints, implemented global cleanup scheduler, and added comprehensive cleanup reporting and monitoring.

Impact & Results

$50K+ transaction volume processed with 100% uptime and zero security incidents across minting and trading operations

70% storage reduction through token ID range optimization compared to traditional array-based storage, enabling efficient scaling

40% gas cost savings per NFT through batch minting and optimized storage patterns, saving users thousands in transaction fees

100% proof verification success rate with Merkle tree implementation across 10,000+ minting operations with zero false positives

95%+ test coverage with comprehensive test suite including API tests, Merkle verification tests, and user minting cycle tests

Key Features

  • Merkle tree-based verification for secure NFT minting
  • User-centric minting with independent cycles per user
  • Gas-optimized smart contracts reducing costs by 40%
  • Automatic cleanup of expired batches and URIs
  • Comprehensive RESTful API with Express
  • 95%+ test coverage with Mocha and Chai

Technologies Used

Node.jsExpressSolidityEthers.jsHardhatmerkletreejsMochaChai

Project Gallery

Banana NFT Character
Banana NFT Character

Project Details

Client

Freelance Project

Timeline

2023

Role

Blockchain Developer & Backend Engineer

© 2026 Firas Jday. All rights reserved.

0%