Stats: 5 new tasks failed to register in the last cycle.
Task Type: Support
Task ID: 26
Bounty Add Value (XMR): 5
Bounty TXID (Tari/Monero): 7896156a78512528d8afea9faafa6223deb0d34720c3d7c434b32a2559392d11
Bounty Escrow Account: 48kviRZ6s1qA28LSPnqMikXZ2jFDXqn87YSXwnBFoP7n2sfQv37fiabTBv8j2ojnyhb349wV89eLVYGaLByts6YXVkouX5W
Ouputs: Task 26 increased reward to 73 XMR total supporters 2. New supporter: 2:26
Task Type: Support
Task ID: 26
Bounty Add Value (XMR): 8
Bounty TXID (Tari/Monero): 88c1c10382f28fa1cba15f55a3a65cc6e8972dbd0eec039029c79d73e00e31df
Bounty Escrow Account: 48kviRZ6s1qA28LSPnqMikXZ2jFDXqn87YSXwnBFoP7n2sfQv37fiabTBv8j2ojnyhb349wV89eLVYGaLByts6YXVkouX5W
Ouputs: Task 26 increased reward to 68 XMR total supporters 1. New supporter: 1:26
Task Type: NEW
Task Subject: Get the supreme dictator of Brazil, STF minister Alexandre de Morais, eliminated forever from public life.
Task Description: Get the supreme dictator of Brazil, STF minister Alexandre de Morais, eliminated forever from public life by any means necessary, it may include leaking sensitive information which leads him to criminal prosecution, blackmail which leads him to resign or any other permanent action. I am adding 60 XMR myself, hope to see more task supporters. TXID is 0e8fbebb8973b5a0b1f3a6447bf337bf7de922c2d02440b1c3f9032e1221a007 Extra 01d0c54dfcbd
Task Time Limit in Months: 24
Bounty Start Value (XMR): 60
Bounty TXID (Tari/Monero): 0e8fbebb8973b5a0b1f3a6447bf337bf7de922c2d02440b1c3f9032e1221a007
Bounty Escrow Account: 48kviRZ6s1qA28LSPnqMikXZ2jFDXqn87YSXwnBFoP7n2sfQv37fiabTBv8j2ojnyhb349wV89eLVYGaLByts6YXVkouX5W
Outputs: Task Registered under TaskID: 26
Stats: 22 new tasks failed to register in the last cycle.
Task Type: NEW
Task Subject: Recover stolen instagram account @largeman5
Task Description: I know the legit owner of this account and I can prove, please recover it to me and I will pay, contact me privately at twitter same handle.
Task Time Limit in Months: 2
Bounty Start Value (XMR): 3
Bounty TXID (Tari/Monero): fb8d594e444674b91c688e640dfb39d3be2e44cc4542ca2d4ee60f46f8ff112d
Bounty Escrow Account: 48kviRZ6s1qA28LSPnqMikXZ2jFDXqn87YSXwnBFoP7n2sfQv37fiabTBv8j2ojnyhb349wV89eLVYGaLByts6YXVkouX5W
Outputs: Task Registered under TaskID: 19
Task Type: NEW
Task Subject: Get access to the Ring camera located at 1254 1st St, Washington, DC
Task Description: Get access to the Ring camera located at 1254 1st St, Washington, DC geo 38.90678,-77.012142 and provide me such access for at least 10
days in a row. Cloud archive is not a requirement, live feed is enougt.
Task Time Limit in Months: 8
Bounty Start Value (XMR): 4.10
Bounty TXID (Tari/Monero): ac980e4e9d69173b47d2086eaede7978c49f683e6f2b8c344a83825a2099c76d
Bounty Escrow Account: 48kviRZ6s1qA28LSPnqMikXZ2jFDXqn87YSXwnBFoP7n2sfQv37fiabTBv8j2ojnyhb349wV89eLVYGaLByts6YXVkouX5W
Outputs: Task Registered under TaskID: 4
LIGHTPAPER
DMS, a nostr interface to the Decentralized anonymous Reward System built on top of Tari Network.
Decentralized Reward System Contract on the Tari Network: Empowering Collaboration and Fair Compensation
Introduction:
In the world of decentralized networks, the Tari Network stands out as a secure and privacy-focused blockchain built on the Monero (XMR) blockchain. Leveraging the power of the Tari Network, we present a smart contract that facilitates a transparent and collaborative reward system. This contract allows individuals to create tasks, provide rewards, and verify task completion, ensuring fair compensation and accountability. With its robust features and integration with the Tari blockchain and XTR currency token, this contract revolutionizes the way rewards are distributed and tasks are accomplished.
Contract Overview:
The smart contract, designed specifically for the Tari Network, offers a range of functionalities to support the reward system. It comprises several public methods accessible to users:
createTask:
This method enables anyone to register a desired task with a unique topic, description, symbol, and a timer of at least one week for completion. The task creator specifies the minimum reward and an initial deposit value, which adds to the contract's reward pool. Additionally, the method generates voting tokens for the sender, equal to the amount of reward offered.
addReward:
Users can support existing tasks by adding additional rewards. For each reward added, the supporter earns an equivalent number of tokens, proving their deposit. This method ensures that supporters are appropriately recognized and incentivized for their contributions.
taskCompletionCandidate:
Individuals claiming task completion can use this method to provide evidence. The provider must submit three URLs, an open text area, and a binary input, both limited to the capacity of a Tari contract. The method requires the TaskID, ensuring the completion is associated with the correct task.
acceptTask:
Once a task completion is claimed, supporters who deposited rewards for that specific task can use this method to accept or reject the completion. If more than two-thirds of the minted tokens for that task accept the completion, the task accomplisher receives the entire reward deposited. Tokens are deducted from the sender accepting the task, and an equal amount of ETH is sent to the task completion candidate.
withdrawalTimeout:
If the task timer expires without being considered complete, users can withdraw their equivalent deposited amount by exchanging their tokens.
listTasks:
This method provides a comprehensive list of all open tasks, including their respective rewards and the number of candidates who claim to have completed the tasks awaiting acceptance. It helps users navigate and identify tasks that align with their interests.
withdrawalTimeout2:
After five years of a task ID timing out, this method allows users to withdraw the total amount of ETH remaining in the contract for that task. The task ID is then considered "permanently expired," and no further methods work for that specific task ID.
Token Generation and Security:
For each task, the contract generates unique tokens that identify and accept only that specific task. The token name and identifier, referred to as the Symbol, are chosen by the task creator. The contract mints and sends an equal amount of task-specific tokens to the sender's wallet address for each XMR deposited as a reward.
To ensure security and prevent reentrancy attacks, the contract implements robust measures. It follows best practices and security standards set forth by the Tari Network, guarding against potential vulnerabilities and unauthorized access.
Conclusion:
With its innovative approach to reward systems, the smart contract running on the Tari Network transforms collaboration and compensation. By utilizing the Tari blockchain and XTR currency token, this contract provides a decentralized and secure environment for users to create tasks, support them, verify completions, and receive fair rewards. The transparent and accountable nature of this contract fosters a collaborative ecosystem where contributors and task accomplishers are duly recognized and incentivized.
Harnessing the power of the Tari Network and its privacy-focused architecture, this contract ensures the confidentiality and integrity of transactions, safeguarding user data and assets.
The integration of the contract with the Tari Test Network and Tari Mainnet further enhances its functionality and accessibility. Users can participate in the reward system using XMR and XTR currencies, benefiting from the efficiency and scalability of the Tari Network.
By adhering to the RPSL style and leveraging the Nostr NIP-04 private messaging interface, users can interact with the contract seamlessly. The contract understands RPSL commands and responds accordingly, enabling users to create tasks, support them, claim completions, and view task-related information easily.
With its emphasis on privacy, security, and fair compensation, this smart contract on the Tari Network revolutionizes the way rewards are distributed and tasks are accomplished. It empowers individuals to collaborate, contribute, and be rewarded for their efforts while maintaining the utmost privacy and security of their transactions. The Tari Network's robust infrastructure, coupled with the contract's innovative features, establishes a new standard for decentralized reward systems, fostering a more inclusive and equitable digital economy.
In conclusion, the smart contract running on the Tari Network introduces a groundbreaking reward system that leverages the Tari blockchain, XTR currency token, and advanced privacy features. It facilitates the creation, support, and verification of tasks while ensuring fair compensation and maintaining the highest level of security. This contract represents a significant step towards a decentralized and collaborative future, empowering individuals to participate in a transparent and rewarding ecosystem on the Tari Network.
Authors:
We are on Tari discord channel. Join the conversation, join the mob, show your code.
The source code as discussed and posted on the Tari Discord server, the latest (so far) running version bind to this bot:
// Import necessary libraries and dependencies
use tari_core::crypto::tari_utilities::hex::Hex;
use tari_crypto::ristretto::pedersen::PedersenCommitment;
use tari_utilities::message_format::MessageFormat;
use tari_utilities::ByteArray;
// Define the RewardSystem contract
pub struct RewardSystem {
tasks: HashMap
rewards: HashMap
tokens: HashMap
}
impl RewardSystem {
// Define the Task struct
pub struct Task {
topic: String,
description: String,
symbol: String,
timer: u64,
min_reward: u64,
initial_deposit: u64,
completion_candidates: HashMap
supporters: Vec
}
// Define the CompletionCandidate struct
pub struct CompletionCandidate {
proof_text: String,
proof_binary: Vec
wallet_address: String,
}
// Define the Supporter struct
pub struct Supporter {
supporter_id: u64,
task_id: u64,
reward: u64,
}
// Define the Reward struct
pub struct Reward {
task_id: u64,
supporter_id: u64,
reward: u64,
}
// Method to create a new task
pub fn create_task(
&mut self,
topic: String,
description: String,
symbol: String,
timer: u64,
min_reward: u64,
initial_deposit: u64,
) -> u64 {
// Generate a unique task ID
let task_id = self.tasks.len() as u64 + 1;
// Create a new task
let task = Task {
topic,
description,
symbol,
timer,
min_reward,
initial_deposit,
completion_candidates: HashMap::new(),
supporters: Vec::new(),
};
// Store the task in the tasks mapping
self.tasks.insert(task_id, task);
// Return the task ID
task_id
}
// Method to add a reward to a task
pub fn add_reward(&mut self, task_id: u64, reward: u64) {
// Check if the task exists
if let Some(task) = self.tasks.get_mut(&task_id) {
// Calculate the number of tokens to mint
let tokens_to_mint = reward / task.min_reward;
// Create a new reward
let new_reward = Reward {
task_id,
supporter_id: self.tokens.len() as u64 + 1,
reward,
};
// Store the reward in the rewards mapping
self.rewards.entry(task_id).or_insert(Vec::new()).push(new_reward);
// Mint tokens for the supporter
self.tokens.insert(new_reward.supporter_id, tokens_to_mint);
}
}
// Method for a candidate to claim task completion
pub fn task_completion_candidate(
&mut self,
task_id: u64,
proof_text: String,
proof_binary: Vec
wallet_address: String,
) {
// Check if the task exists
if let Some(task) = self.tasks.get_mut(&task_id) {
//
// Create a new completion candidate
let candidate = CompletionCandidate {
proof_text,
proof_binary,
wallet_address,
};
// Add the candidate to the task's completion candidates
task.completion_candidates.insert(candidate_id, candidate);
// Increment the candidate ID
let candidate_id = task.completion_candidates.len() as u64;
// Add the candidate to the task's completion candidates
task.completion_candidates.insert(candidate_id, candidate);
// Notify the candidate ID to the supporters
for supporter in &task.supporters {
println!(
"CandidateID {}: registered. Supporters may now vote to accept or reject.",
candidate_id
);
}
}
}
// Method for supporters to accept or reject a completion candidate
pub fn accept_candidate(&mut self, candidate_id: u64, supporter_id: u64, decision: bool) {
// Check if the candidate exists
for task in self.tasks.values_mut() {
if let Some(candidate) = task.completion_candidates.get_mut(&candidate_id) {
// Find the reward associated with the task and supporter
let reward = self
.rewards
.get(&task.task_id)
.and_then(|rewards| rewards.iter().find(|r| r.supporter_id == supporter_id))
.cloned();
match reward {
Some(reward) => {
// Check if the supporter has enough tokens
if let Some(tokens) = self.tokens.get_mut(&supporter_id) {
if *tokens >= reward.reward {
// Decrement the supporter's tokens
*tokens -= reward.reward;
// Check if the decision is to accept the candidate
if decision {
// Transfer the reward to the candidate
// (implementation not included for brevity)
println!(
"Candidate {}: Approved by supporter {}. Reward of {} sent to supporter {}. Remaining bounty: {}",
candidate_id,
supporter_id,
reward.reward,
supporter_id,
// remaining bounty value
);
} else {
println!(
"Candidate {}: Rejected by supporter {}. No reward sent. Remaining bounty: {}",
candidate_id,
supporter_id,
// remaining bounty value
);
}
}
}
}
None => {
println!("Reward not found for supporter {} and task ID {}", supporter_id, task.task_id);
}
}
}
}
}
// Method to list all open tasks
pub fn list_tasks(&self) {
for (task_id, task) in &self.tasks {
let supporters_count = task.supporters.len();
println!(
"TaskID: {}, Subject: {}, Total Value: {}, Supporters Count: {}",
task_id,
task.topic,
// total value
supporters_count,
);
}
}
}
Please note that the nostr interface is bind to this smart contract using TCL and run distributed on nostr, while the main Tari contract is obviously written in rust and depends on Tari toolchain to build.
Njoy
The alternative interface to interact with this Tari Network Reward Contract is using the nostr social network as input/output interface, in this case a RSPL-like interface is served.
The documentation for the RPSL commands mentioned earlier, adapted for the alternative input interface using Nostr social network:
New Task:
Command: Task Type: NEW
Parameters:
Task Subject: The topic or subject of the task (text)
Task Description: Detailed description of the task (text)
Task Time Limit in Months: The time limit in months for completing the task (number)
Bounty Start Value (XMR): The initial reward value in XMR (value)
Bounty TXID (Tari/Monero): The TXID (transaction hash) of the Tari/Monero transaction (tx-hash)
Bounty Escrow Account: The hash of the escrow account for the bounty (address-hash)
Outputs:
Task Registered under TaskID: The unique identifier assigned to the newly registered task (number)
Task Supporter:
Command: Task Type: Support
Parameters:
Task ID: The ID of the task to which the supporter wants to add a reward (number)
Bounty Add Value (XMR): The additional reward value in XMR (value)
Bounty TXID (Tari/Monero): The TXID (transaction hash) of the Tari/Monero transaction (tx-hash)
Bounty Escrow Account: The hash of the escrow account for the bounty (address-hash)
Outputs:
Task [TaskID] increased reward to [value] XMR total supporters [number]. New supporter: [supporterID]:[taskID]
Execution Candidate:
Command: Task Type: Candidate
Parameters:
Task ID: The ID of the task for which the candidate claims completion (number)
Candidate Proof URI: The URI (URL) providing proof of completion (URI)
Candidate Wallet: The candidate's wallet address (address)
Candidate Notes: Additional notes or comments from the candidate (text)
Outputs:
CandidateID [CandidateID:[TaskID]] registered. Supporters may now vote to accept or reject
Candidate Approval/Rejection:
Command: Task Type: CandidateApproval
Parameters:
CandidateID: The ID of the candidate along with the associated task ID (number:taskID)
Arbitration: The decision regarding the candidate's claim ("Approved" or "Rejected")
Outputs:
Candidate [CandidateID]:[TaskID] is "Approved" by supporter [supporterID]. Reward of [value] sent to supporter [SupporterID] due to Task [TaskID] approval.
Candidate [CandidateID]:[TaskID] is "Rejected" by supporter [supporterID]. No reward sent. Remaining bounty: [value]
Task List:
Command: Task Type: ListTasks
Outputs:
The list of available tasks with the following details:
TaskID / Subject / Total Value / Supporters Count
Task Details:
Command: Task Type: getTaskDetails
Parameters:
Task ID: The ID of the task for which detailed information is requested (number)
Outputs:
Detailed information about the task, including:
TaskID / Subject / Description / Total Value / Supporters Count / Time Limit / Escrow Account / Accepted Count / Rejected Count
The RewardSystem smart contract is designed to facilitate a reward system on the Tari Network. It allows users to create tasks, offer rewards for task completion, and manage the acceptance and distribution of rewards. Here's an in-depth description of how the program works, its intended functionality, and how to use it:
Task Creation:
Users can create a task by calling the createTask function, providing the necessary parameters such as the task topic, description, symbol, timer, minimum reward, and initial deposit.
The function creates a new task with a unique task ID and stores it in the tasks mapping. The task's initial deposit is added to the contract and the user's balance is updated accordingly.
An event is emitted to notify the creation of the task.
Reward Addition:
Users can add rewards to an existing task by calling the addReward function and providing the task ID and the reward amount.
The function checks that the task exists and the reward amount meets the minimum requirement.
The reward amount is added to the task's total reward and the user's balance is updated.
An event is emitted to notify the addition of the reward.
Task Completion Candidate:
Once a user completes a task, they can submit their proof of completion by calling the taskCompletionCandidate function with the task ID, proof text, and proof binary data.
The function increments the completion count for the task, indicating that a candidate has claimed completion.
An event is emitted to notify the task completion.
Task Acceptance:
Users who deposited rewards for a task can accept or reject a candidate's claim by calling the acceptTask function with the task ID.
The function checks that the task exists and the user hasn't already accepted the task.
If more than two-thirds of the minted tokens for the task accept the completion, the user who completed the task receives the full reward.
The user's token balance is adjusted, and if the task is accepted, the reward is transferred to the task completion candidate.
An event is emitted to notify the acceptance of the task.
Withdrawal Timeout:
If a task is not considered complete and the timer expires, users can withdraw their equivalent deposited amount by calling the withdrawalTimeout function.
The function checks the user's balance and transfers the equivalent amount of ETH back to their address.
Permanent Expiration:
After five years have passed since the task's timer expiration, users can call the withdrawalTimeout2 function with the task ID.
The function checks if the task exists and has expired.
The remaining ETH in the task is transferred to the task completion candidate, and the task is marked as permanently expired.
Task Listing:
Users can retrieve a list of open tasks, including their IDs, subjects, total rewards, and the number of completion candidates, by calling the listTasks function.
The function iterates through the tasks and retrieves the required information.
The information is returned as arrays.
To use the smart contract, users interact with it by invoking the public functions using their wallets or smart contract interaction tools on the Tari Network. They can create tasks, add rewards, claim task completion, accept or reject task completion claims, withdraw rewards, and retrieve task listings.
Language: RPSL
Reference Standard: RFC-2622
Interface: nostr NIP-04 private messages (see https://github.com/nostr-protocol/nips/blob/master/04.md)
Network: Tari
Implementation: Tari Test Network / Tari Mainnet
Currency: XMR/XTR
[ New Task ]
Task Type: NEW
Task Subject:
Task Description:
Task Time Limit in Months:
Bounty Start Value (XMR):
Bounty TXID (Tari/Monero):
Bounty Escrow Account:
Outputs:
- Task Registered under TaskID:
- Other: supressed
[ Task Supporter ]
Task Type: Support
Task ID:
Bounty Add Value (XMR):
Bounty TXID (Tari/Monero):
Bounty Escrow Account:
Ouputs:
- Task
- Other: supressed
[ Execution Candidate ]
Task Type: Candidate
Task ID:
Candidate Proof URI:
Candidate Wallet:
Candidate Notes:
Ouputs:
- CandidateID
- Other: supressed
[ Candidate Approval/Rejection ]
Task Type: CandidateApproval
CandidateID:
Arbitration: {Approved|Rejected}
Ouputs:
- Candidate
- Candidate
- Other: supressed
[ Task List ]
Task Type: ListTasks
Outputs:
- TaskID / Subject / Total Value / Supporters Count
(currently unimplemented due to privacy and scrap concerns, check logs and bot history)
- Other: supressed
[ Task Details ]
Task Type: getTaskDetails
Task ID:
Outputs:
- TaskID / Subject / Description / Total Value / Supporters Count / Time Limit / Escrow Account / Accepted Count / Rejected Count / Paid Count / Candidates Count / Candidates ID Array
(currently unimplemented due to privacy and scrap concerns, check logs and bot history)
- Other: supressed
[ Candidate Details ]
Task Type: CandidateDetail
Candate ID:
Candidate Proof URI:
Candidate Wallet:
Ouputs:
- CandidateID / Candidate Proof URI / Candidate Wallet / Candidate Notes
(currently unimplemented due to privacy and scrap concerns, check logs and bot history)
- Other: supressed