This documentation details the public entry and view functions in Move smart contracts for a decentralized data marketplace platform.
Module where buyers can create campaigns to purchase specific types of data.
Creates a new data collection campaign and locks the reward pool in escrow.
Parameters:
account: &signer
- Signer of the campaign creator's accounttitle: String
- Campaign titledescription: String
- Campaign descriptionprompt: String
- Data collection promptunit_price: u64
- Reward amount per data pointminimum_contribution: u64
- Minimum contribution amountreward_pool: u64
- Total reward pool
Returns details of a specific campaign.
Parameters:
campaign_id: u64
- Campaign ID
Return Value:
Campaign {
id: u64,
creator: address,
title: String,
description: String,
prompt: String,
reward_pool: u64,
remaining_reward: u64,
unit_price: u64,
minimum_contribution: u64,
active: bool
}
Lists all campaigns in the marketplace.
Return Value:
vector<Campaign>
- List of all campaigns
Manages data contributions from sellers to active campaigns.
Submits data contribution to a campaign and transfers the reward to the contributor.
Parameters:
account: &signer
- Signer of the contributor's accountcampaign_id: u64
- Campaign IDdata_count: u64
- Number of data points submittedstore_cid: String
- IPFS CID of the datascore: u64
- Quality score of the contributionsignature: vector<u8>
- ED25519 signature from trusted validator
Lists all contributions for a specific campaign.
Parameters:
campaign_id: u64
- Campaign ID
Return Value:
vector<Contribution> {
campaign_id: u64,
contributor: address,
data_count: u64,
store_cid: String,
score: u64,
signature: vector<u8>
}
Manages verification of data contributions using trusted validator signatures.
Adds a new trusted validator's public key to the system.
Parameters:
account: &signer
- Signer of the marketplace creator accountpublic_key: vector<u8>
- ED25519 public key of the trusted validator
- All currency amounts are in AptosCoin.
- Data verification is performed by trusted validators using ED25519 signatures.
- The contribution signature is generated over:
- campaign_id
- data_count
- store_cid (IPFS Content ID)
- score (quality score)
- Data quality scores are determined by trusted validators.
- Only the marketplace creator can manage trusted validator keys.
- Data is stored in decentralized storage solutions (IPFS).