A decentralized marketplace for digital design assets on the Stacks blockchain, enabling creators to tokenize and sell their creative work while maintaining ownership rights and earning royalties.
TrendCraft is a specialized marketplace built on the Stacks blockchain that allows designers and creators to:
- List and sell digital assets (design templates, UI kits, 3D models)
- Set custom pricing and royalty arrangements
- Track market trends and popular design movements
- Build reputation through a review system
- Securely transfer asset ownership using STX tokens
Key features:
- Customizable pricing and royalty structures
- Trend tracking and analytics
- Reputation and review system
- Secure ownership transfer
- Secondary market support
The marketplace is built around a single core smart contract that handles all marketplace operations:
graph TD
A[Creator] -->|Create Listing| B[Marketplace Contract]
C[Buyer] -->|Purchase Asset| B
B -->|Record Sale| D[Ownership History]
B -->|Update Trends| E[Category Trends]
C -->|Submit Review| F[Review System]
B -->|Calculate Fees| G[Payment Distribution]
G -->|Platform Fee| H[Contract Owner]
G -->|Payment| A
B -->|Secondary Sale| I[Royalty Distribution]
- Listing Management: Creation, updating, and removal of asset listings
- Purchase System: Secure buying process with automatic fee distribution
- Ownership Tracking: Historical record of asset ownership
- Review System: Buyer feedback and rating mechanism
- Trend Analysis: Purchase tracking by category and time period
The main contract (trendcraft-marketplace.clar) manages all marketplace operations.
-
Listing Management
- Create, update, and remove listings
- Set prices and royalty percentages
- Store asset metadata and URLs
-
Purchase Processing
- Handle secure transactions
- Distribute platform fees
- Record ownership changes
- Update trend data
-
Review System
- Submit and store reviews
- Track review status
- Limit one review per purchase
- Only listing creators can modify their listings
- Only buyers can submit reviews for purchased assets
- Platform fees are sent to the contract owner
- Maximum royalty percentage is capped at 15%
- Clarinet
- Stacks wallet
- STX tokens for transactions
- Creating a Listing
(contract-call? .trendcraft-marketplace create-listing
"My Design Template"
"A professional design template"
u1000000 ;; Price in µSTX
"templates"
"preview-url"
"full-asset-url"
u10 ;; 10% royalty
)- Purchasing an Asset
(contract-call? .trendcraft-marketplace purchase-asset u1)- Submitting a Review
(contract-call? .trendcraft-marketplace submit-review
u1 ;; listing-id
u5 ;; score
"Great asset!"
)(create-listing (title (string-ascii 100))
(description (string-utf8 500))
(price uint)
(category (string-ascii 50))
(preview-url (string-utf8 200))
(full-asset-url (string-utf8 200))
(royalty-percent uint))
(update-listing (listing-id uint) ...)
(remove-listing (listing-id uint))(purchase-asset (listing-id uint))
(resell-asset (listing-id uint) (new-price uint))(submit-review (listing-id uint) (score uint) (comment (string-utf8 300)))(get-listing (listing-id uint))
(has-purchased (listing-id uint) (user principal))
(get-review (listing-id uint) (reviewer principal))
(get-category-trend (category (string-ascii 50)) (month-year (string-ascii 7)))
(get-ownership-history (listing-id uint) (index uint))- Install Clarinet
- Clone the repository
- Run tests:
clarinet test- Start Clarinet console:
clarinet console- Deploy contract:
(contract-call? .trendcraft-marketplace ...)- Asset URLs are stored on-chain as strings
- Trend analysis is based on block height for time approximation
- Review scores are limited to 0-5 range
- Verify asset ownership before reselling
- Check listing status before purchasing
- Keep sufficient STX for platform fees
- Review asset details and seller reputation before purchasing
- Ensure listing prices are set in µSTX (multiply by 1,000,000)