English Version | 中文版本
NFT Billboards - Redefining the Future of Blockchain Advertising
NFT Billboards is an innovative blockchain advertising platform that transforms virtual world advertising spaces into tradable NFT assets. We leverage Sui blockchain's object model, combined with the Walrus decentralized storage network, to achieve dynamic updates and secure storage of advertising content. This billboard system is adaptable to various virtual world scenarios including blockchain games, metaverse, and Web3 applications.
- NFT-ization of Ad Spaces: Transform advertising resources into unique assets on the blockchain
- Dynamic Content Updates: Update advertising content without redeployment
- Transparent Leasing Mechanism: Automated leasing and renewal processes based on smart contracts
- Decentralized Storage: Secure storage of advertising content using the Walrus network
The project adopts a three-layer architecture design:
- Smart Contract Layer: Move smart contracts based on Sui blockchain, handling core business logic
- Frontend Application Layer: User interface built with React + TypeScript, providing intuitive interaction experience
- Storage Layer: Walrus decentralized storage network, ensuring secure and reliable storage of advertising content
nft-billboard/
├── README.md # Project documentation
├── nft_billboard/ # Move smart contract directory
│ ├── sources/ # Contract source code
│ │ ├── ad_space.move # Ad space related functionality
│ │ ├── nft_billboard.move # Main contract module
│ │ ├── factory.move # Factory contract
│ │ └── nft.move # NFT related functionality
│ ├── tests/ # Contract tests
│ └── build/ # Compilation output
└── nft_billboard_web/ # Frontend project directory
├── src/ # Frontend source code
│ ├── components/ # Components
│ ├── pages/ # Pages
│ ├── hooks/ # Custom hooks
│ ├── utils/ # Utility functions
│ └── assets/ # Static resources
└── public/ # Public resources
- Platform administrators can register game developers
- Game developers can create and manage ad spaces
- Ad spaces include attributes such as location, size, price, etc.
- Users can purchase ad spaces to obtain NFT ownership
- Support for flexible lease terms from 1 to 365 days
- Smart pricing algorithm ensures better value for long-term leasing
- NFT holders can dynamically update advertising content
- Content is stored on the Walrus decentralized network
- All updates are traceable on the blockchain
- Multi-level permission control ensures system security
- Access control based on address verification
- Comprehensive error handling mechanism
- Blockchain: Sui
- Smart Contract: Move
- Frontend Framework: React 18 + TypeScript
- UI Components: Ant Design
- Wallet Integration: @mysten/dapp-kit
- Storage Solution: Walrus
# Enter contract directory
cd nft_billboard
# Compile contract
sui move build
# Run tests
sui move test
# Publish contract
sui client publish --gas-budget 100000000# Install dependencies
cd nft_billboard_web
npm install
# Start development server
npm start
# Build production version
npm run buildpublic struct Factory has key {
id: UID,
admin: address,
ad_spaces: vector<AdSpaceEntry>, // Changed to vector<AdSpaceEntry>, easier to display in JSON
game_devs: vector<address>, // List of game developer addresses
platform_ratio: u8 // Platform commission ratio, percentage
}public struct AdSpace has key, store {
id: UID,
game_id: String, // Game ID
location: String, // Location information
size: String, // Ad size
is_available: bool, // Whether it's available for purchase
creator: address, // Creator address
created_at: u64, // Creation time
fixed_price: u64, // Base fixed price (in SUI, representing the daily rental price)
}public struct AdBoardNFT has key, store {
id: UID,
ad_space_id: ID, // Corresponding ad space ID
owner: address, // Current owner
brand_name: String, // Brand name
content_url: String, // Content URL or pointer
project_url: String, // Project URL
lease_start: u64, // Lease start time
lease_end: u64, // Lease end time
is_active: bool, // Whether it's active
blob_id: Option<String>, // Blob ID in Walrus
storage_source: String, // Storage source ("walrus" or "external")
}The system uses an exponential decay model to calculate rental prices, ensuring better value for long-term leasing:
// Core logic of price calculation
let daily_price = ad_space.fixed_price;
let ratio = 977000; // Decay factor (0.977)
let base = 1000000; // Base
let min_daily_factor = 500000; // Minimum daily factor (0.5)
// Calculate total price
let total_price = daily_price; // First day at full price
let mut factor = base;
let mut i = 1;
while (i < lease_days) {
factor = factor * ratio / base;
if (factor < min_daily_factor) {
total_price = total_price + daily_price * min_daily_factor * (lease_days - i) / base;
break
};
total_price = total_price + daily_price * factor / base;
i = i + 1;
}- Home: System introduction and feature navigation
- Ad Space List: Browse and filter available ad spaces
- Ad Space Details: View detailed information and purchase ad spaces
- My NFTs: Manage purchased billboard NFTs
- Management Page: Features exclusive to developers and administrators
- Multi-level permission verification based on addresses
- Lease validity verification
- Payment amount verification and refund of excess funds
- Content hash verification to ensure content integrity
- Ensure Sui CLI is installed and wallet is configured
- Compile and publish the contract to testnet or mainnet
- Record the contract package ID and factory object ID
- Set contract-related parameters in the environment configuration file (.env.production)
- Build the frontend application:
npm run build - Deploy to static website hosting service
- Ad effectiveness analysis functionality
- Support for more ad types
- Multi-chain deployment support
- Mobile optimization
- Community governance mechanism