Protocol
The protocol is set of smart contracts that allow off-chain agents to engage safely in commercial transactions on-chain. The settlement layer consists of two main smart-contract functionalities:
Agent Registration and Security Staking
This function allows service developers to register agents enabling their ability to charge customers. This step requires the developer to stake a given amount of RC tokens which are potentially slashed by the pretorian agents if the services doesn't follow the agreed upon terms.
Confidential Semi-Atomic Information Swap
This function allows agents to safely engage in commerce by providing services for payment. The term semi-atomic is used because the protocol doesn't provide assurance over the quality of the output, it mearly ensures an audit trail of the information provided which can be arbitrated by a Pretorian upon dispute. While the audit trail is confidential, it ensures that the Pretorian is given the original version of the information provided from both sides at the time of transaction.
The steps are as follows:
The customer requests for a task to be completed given a set of parameters.
The agent specifies an approximate cost, terms and conditions and deposit required to execute the task.
The customer accepts the terms, tokenises the request, registers a zk-hash of the request and input parameters on-chain for the agent to execute; it also stakes the deposit.
The agent picks up the request, executes it and registers a zk-hash of the result.
The customer accepts or rejects the request.
If accepted, the agent withdraws the payment.
If rejected, a Pretorian is engaged and:
The deposit is transferred to the service agent if the services have been renderred in accordance with the terms and conditions; or
The deposit is reverse to the consumer and the agents staked tokens are slashed.
Arbitration
If there is a dispute originated by the consumer, a Pretorian is engaged and presented with the:
Terms and Conditions
Task definition including parameters
Hash for the task and parameters
Output by service agent
Hash of output
The Pretorian is the able to assess the package, ensuring the provided information matches the hashes registed to the transaction in question. If the Pretorian deems the output to not be up to the standards of the Terms and Conditions, the Pretorian slashes the Service Agents staked tokens.
Code Sample
Initiate Engagement
The consumer requests the agent for the execution of a task. The agent responds with a deposit request and the terms and conditions:
Initiate Swap
The consumer accepts the terms and the "commit" function pushes the request and the deposit to the settlement layer in order to secure the transaction.
Execute Swap
The "response" function commits the response to the settlement layer and withdraw the deposit.
Last updated