Please describe your proposed solution
Solution Overview
We are introducing an on-chain library designed to enhance privacy for transactions on the Cardano blockchain. This solution utilizes a combination of a mixer smart contract and random account generation to anonymize the distribution of ADA by merging and redistributing UTXOs (Unspent Transaction Outputs).
Key Components
-
Mixer Smart Contract: This contract is responsible for receiving ADA transactions, merging UTXOs, and distributing them in a non-traceable manner every defined PrivEpoch.
-
PrivEpoch: A dynamic interval determined by the completion of 50 transaction.
-
Off-chain Transaction Building Script: This script builds transactions that adhere to the requirements of the smart contract, particularly sending ADA in whole number. The script creates a unique instance for each transaction and encrypts output wallet addresses on client-side to ensure anonymity.
-
Fee Calculation Script: Computes the transaction fees upfront, which are then paid by the user in the first transaction to cover all operations in the complete cycle.
-
Random Wallet Generator: Generates additional random wallets for enhanced privacy post-mixing, if the user opts for this feature.
Workflow
Here’s how the user workflow is structured, step by step:
-
Input and Output Wallets:
-
The user starts by providing an input wallet address from which ADA will be sent.
-
The user must specify a minimum of four output wallet addresses. These addresses will receive the mixed ADA at the end of the process.
-
Fee Computation:
-
Before any transaction begins, the fee calculation script computes the total fees for the upcoming set of operations, including mixing and redistribution.
-
The user is prompted to pay this computed fee in the first transaction to ensure smooth processing throughout the PrivEpoch.
-
Transaction Initiation:
-
Using an off-chain transaction building script, the user sends ADA to the mixer smart contract. This script ensures all ADA sent is in whole numbers.
-
The transaction marks the start of a new PrivEpoch if it is the first of the set of 50 transactions.
-
Mixing Process:
-
Once 50 transactions are recorded, or the PrivEpoch ends, the mixer contract activates.
-
The contract merges all the UTXOs received during this epoch and prepares them for distribution.
-
Random Wallet Distribution (Optional):
-
If the user opts for additional random wallets, the random wallet generator creates these wallets.
-
These wallets are used as intermediate steps to further anonymize the distribution before the final amount reaches the user's specified output wallets in that particular instance.
-
Final Distribution:
-
The mixer smart contract distributes ADA to the specified output wallets and any additional random wallets created in the process.
-
This distribution is done in a randomized way into all the output addresses ensuring anonymity.
Example
Let's walk through a simple example:
-
User Setup:
-
Input Wallet: addr1…
-
Output Wallets: addr2…, addr3…, addr4…, addr5…
-
Fee Computation:
-
Suppose the fee calculation script determines that the fee for the transaction and the mixing process is 2 ADA.
-
Sending ADA:
-
The user wants to send 50 ADA (48+2) ADA to the mixer contract.
-
The off-chain script facilitates this by ensuring the transaction is rounded to whole numbers and initiates the transaction.
-
During the PrivEpoch:
-
More users send ADA to the contract, and transactions are recorded until the 50 transaction limit is reached.
-
Mixing and Distribution:
-
The mixer contract activates, merging all UTXOs.
-
The user opts for two additional random wallets, so the random wallet generator creates randAddr1… and randAddr2… .
-
Final Receipt:
-
The mixer distributes the ADA among addr2…, addr3…, addr4…, addr5… after passing the amount randomly between randAddr1 and randAddr2.
-
Each receives an unpredictable portion of the total mixed ADA, ensuring privacy.
Note: This library is well-suited for dApps that have a significant number of inflow and outflow transactions. The smart contract is designed to merge UTXOs once the PrivEpoch conditions are met, ensuring complete privacy.