How to Deposit funds
Here's how the deposit workflow works under the hood:
Step 1: Initiate the Deposit
The user calls the Deposit Manager contract to instantiate a deposit request.
What happens:
- Specify the asset (e.g., USDC, ETH, WBTC) and amount you want to deposit
- Specify the stealth address which is derived from your viewing key that will own the deposited funds
- Transfer the specified asset and amount to the Deposit Manager contract
Step 2: Deposit Screening (Risk Evaluation)
While your deposit sits in the Deposit Manager, a permissioned actor called the deposit screener evaluates the request.
- If acceptable: The screener signs the deposit request
- If high-risk: The deposit is rejected (you can withdraw immediately, see Edge Case)
Time window: This process occurs during the mandatory 4-hour settlement queue. The delay ensures the screener has access to the most recent onchain state.
Step 3: Complete the Deposit
Once the screener approves your deposit, they submit their signature to the Deposit Manager.
What happens:
- The Deposit Manager verifies the screener's signature
- Funds are transferred from the Deposit Manager to the Master Account and a corresponding note is created
- The note commitment is added to the Commitment Tree
What is a note?
A note is the fundamental unit of value in Platus. It represents:
- Asset type (e.g., USDC)
- Amount (e.g., 1000 USDC)
- Owner (the stealth address you specified)
- Nonce (ensures uniqueness)
Notes are encrypted and stored onchain. Only someone with the corresponding viewing key can decrypt and identify notes belonging to them.
Once the note is inserted into the commitment tree, you can use it in private/public transactions.
Edge Case: Withdrawal Before Completion
What if the screener rejects my deposit or the 4-hour window expires?
You can immediately withdraw your funds from the Deposit Manager at any time even before the deposit is completed.
How:
Call the forceExit function on the Deposit Manager contract and the funds will be returned to your original deposit address.
Platus never has custody of your funds. If the screener never approves your deposit, your funds remain under your control.