A decentralized data marketplace built on Sui blockchain, enabling secure data trading, labeling tasks, and community governance.
Byte Bazaar is a comprehensive platform that combines NFT-based data assets, marketplace functionality, task management, and DAO governance. It provides a complete ecosystem for data creators, labelers, validators, and consumers.
byte_bazaar/
├── sources/
│ ├── entry.move # Main entry point and capability management
│ ├── nft.move # DataNFT implementation with royalties
│ ├── market.move # Marketplace for trading DataNFTs
│ ├── task.move # Data labeling task management
│ ├── dao.move # Decentralized governance system
│ ├── revenue.move # Revenue distribution logic
│ └── lib.move # Shared utilities and types
└── tests/
└── byte_bazaar_tests.move # Comprehensive test suite
- Unique Data Assets: Each dataset is represented as a unique NFT with metadata
- Royalty System: 5% global royalty on secondary sales
- Transfer Policy: Automated royalty collection via Sui's Kiosk system
- Versioning: Support for dataset updates with version tracking
- Walrus Integration: Storage tickets for decentralized data storage
- Kiosk Integration: Built on Sui's standard Kiosk framework
- Automated Royalties: Seamless royalty distribution on trades
- Freeze Protection: Prevents trading of frozen/disputed assets
- Event Tracking: Comprehensive marketplace event logging
- Data Labeling: Crowdsourced data annotation system
- Golden Samples: Quality control through reference data
- Multi-Validator Consensus: Democratic validation process
- Escrow System: Secure payment handling with dispute resolution
- Deadline Management: Time-bound task completion
- Proposal System: Community-driven decision making
- Voting Mechanism: Weighted voting with configurable parameters
- Asset Management: Freeze/unfreeze NFTs through governance
- Upgrade Authority: Controlled smart contract upgrades
- Execution Framework: Automated proposal execution
- Multi-Recipient Royalties: Flexible revenue sharing
- Basis Points System: Precise percentage allocations
- Automatic Distribution: Seamless payment splitting
The system uses capability-based access control:
GovCap: DAO governance operationsUploaderCap: Data upload and NFT mintingLabelerCap: Task claiming and submissionValidatorCap: Task validation and review
- Sui CLI installed
- Sui wallet configured
- Basic understanding of Move programming
- Clone the repository:
git clone https://github.com/memenow/byte-bazaar.git
cd byte-bazaar- Build the project:
sui move build- Run tests:
sui move test- Publish the package:
sui client publish --gas-budget 100000000- Note the package ID and update your configuration accordingly.
// Mint a new DataNFT with royalty information
let (nft, policy) = nft::mint_data_nft(
&uploader_cap,
&publisher,
creator_address,
data_hash,
storage_url,
license_hash,
royalty_recipients,
royalty_basis_points,
ctx
);// Publish a new data labeling task
let task = task::publish_task(
&uploader_cap,
dataset_id,
reward_coin,
deadline,
gold_hash, // Optional golden sample
&clock,
ctx
);// Create a governance proposal
let action = dao::new_freeze_nft_action(nft_id, true);
let proposal = dao::create_proposal(
&gov_cap,
action,
duration,
&clock,
ctx
);mint_data_nft()- Create new data NFTupdate_data_nft()- Update NFT metadatapay_royalty_and_confirm()- Handle royalty payments
list_nft()- List NFT for salebuy_nft()- Purchase listed NFT
publish_task()- Create labeling taskclaim_task()- Claim task for completionsubmit_task_result()- Submit completed worksubmit_review()- Validate submitted workfinalize_task()- Complete task and distribute rewards
create_proposal()- Submit governance proposalvote_on_proposal()- Cast vote on proposaltally_proposal()- Count votes after deadlineexecute_*_proposal()- Execute approved proposals
The system emits comprehensive events for off-chain monitoring:
- DataNFT Events:
DataNFTMintedEvent,DataNFTUpdatedEvent,StorageTicketEvent - Marketplace Events:
NFTListedEvent,NFTPurchasedEvent - Task Events:
TaskPublishedEvent,TaskClaimedEvent,TaskCompletedEvent - DAO Events:
ProposalCreatedEvent,ProposalExecutedEvent
- Capability-based Access: All sensitive operations require appropriate capabilities
- Consensus Mechanisms: Multi-validator approval for task completion
- Escrow Protection: Funds held securely until task completion
- Upgrade Controls: DAO-governed smart contract upgrades
- Royalty Enforcement: Automatic royalty collection prevents circumvention
The project includes comprehensive tests covering:
- NFT minting and trading workflows
- Task lifecycle management
- DAO governance processes
- Error conditions and edge cases
- Royalty calculation accuracy
Run tests with:
sui move testThis project is licensed under the Apache 2.0 License - see the LICENSE file for details.