DEV Community

DC
DC

Posted on

Introducing Privana: A Deep Dive into Features

Private decentralized finance (DeFi) is a direction that various protocols and projects are exploring. Oasis, with its focus on smart privacy, is building its own DeFi application, Privana, on its on-chain and off-chain tech stack for confidentiality and security.

In the earlier parts of this series, we covered the core concepts of Privana and the underlying technology that powers it. Here, we look at the features this technology makes possible.

Private Swaps

For a long time, a section of web3 has promised privacy and delivered little more than some semblance of anonymity. The scope of private swaps is broader, which makes it an integral feature in next-gen DeFi. At launch, Privana will have multi-chain support for private swaps on Ethereum, Base, and HyperEVM.

Private swaps go through up to three execution stages, each optimized for a different balance of privacy, speed, and cost. Upon receiving the user intent, the application authenticates the request and routes it to the swap microservice running inside a ROFL TEE container. The microservice then tries each stage in sequence until the order is filled.

For example, let's say a user executes a swap of 15 ETH for USDC. The order goes through the stages below, one by one, until a stage can fill it.

  1. Internal matching - In the first stage, user intents are internally matched. This means if another user has submitted a swap intent for the opposite trade, then balances are updated in the accounting layer, and the trade is settled immediately. This is the quickest and most cost-efficient path, and it also stays within Privana's own trust model.

  2. Vault inventory - If no internal match is available, the next stage is to execute and finalize the swap by settling the trade with Privana-provisioned liquidity held inside the vault. The pricing is decided with the LiFi aggregator providing the prevailing DeFi market rates on request. This being another form of internal settlement, Privana's own privacy measures powered by the Oasis tech stack keep the swap confidential.

  3. External DEX routing - If neither of these two stages can complete the trade order, then Privana looks for external liquidity. Once again, the LiFi aggregator plays a role. It routes the order through other decentralized exchanges, like Uniswap, Curve, etc. As the swap happens with the trade executed on public chain mempools, on-chain visibility is unavoidable. However, the privacy of the user is maintained as the order originates from the pooled vault address, and their personal wallet details are not revealed.

The privacy of any swap on Privana varies based on the path it takes.

The first two stages happen within Privana. So, with no external transaction involved, the swap, from request submission to settlement, happens entirely inside the TEE. The swap is also designed to be untraceable on the explorer.

When public DEX infrastructure gets involved, the trade becomes publicly visible, although the Privana vault architecture ensures the user and the trade cannot be specifically connected.

Privana also reserves the third way as the last resort for any swap, preferring the first two stages for most trade settlements. The third way is triggered only when

  • the requested pair does not have enough internal liquidity
  • the vault inventory is being rebalanced
  • extreme market conditions result in exceeding the rebalancing engine's capacity

Pricing

We saw the second way using the LiFi aggregator for determining the price. Here, Privana acts as a counterparty to the trade, which means the application settles against its own inventory. With the LiFi aggregator sourcing the price, users are assured of getting fair market rates. The system is also designed with safeguards, such as price staleness checks and maximum-spread thresholds, to prevent mispricing.

TWAP execution

Privana supports Time-Weighted Average Price (TWAP) execution for larger orders. Instead of executing the entire order in a single transaction that might impact the market through short-term price volatility or slippage, this mechanism splits the order into several smaller transactions completed over a time window.

The security is maintained by each of the transactions being signed inside the enclave before they are broadcast publicly from the pooled vault address. Privana's TEE architecture keeps the splitting logic, timing, and sizes private within the enclave.

Replay protection

This is a technical feature of Privana's private swap that is beneficial for the users without them being aware of it. Every transaction the enclave signs uses the account's current nonce. Moreover, each internal operation carries its own signed nonce. This means that a nonce, once spent, cannot be used again, so there is no chance of replaying a captured signature.

Idle Yield

Privana's idle yield is triggered when the assets are not being swapped. In this state, the application can route idle stablecoin balances to vetted yield protocols, automatically and privately. Check out the sneak peek of Privana Earn.

The yield module is optional, and users will need to activate it to enjoy the benefit. When opted in, the Privana yield microservice routes idle balances to whitelisted yield protocols. At launch, Privana will work with Aave, with Midas also listed as a second yield strategy in its integrations, and there will be more to follow.

With this feature, users can define which assets participate, the deposit threshold, and the maximum amount. Once set, it will start working automatically without needing user involvement. Privana, being built on Oasis Sapphire, keeps the user's yield accounting (amounts, protocol, position history) confidential on-chain. The deposit into the protocol itself executes on the external chain from the pooled vault address, as with any other settlement.

This mechanism, however, will not work simultaneously with the swap process. If the user starts a swap, the system will first unwind any active yield position for that asset.

The yield on Privana Earn is available through its SDK. This means that an application can offer its users yield on in-app balances without the need to build DeFi integration. Automation Rules, which we will explore shortly, can route realized trading profits into yield automatically.

Safety model

Keeping user fund security in mind, Privana is designed to route only to protocols that have passed internal vetting. If a protocol has been vetted and included but later gets delisted for any reason, say due to a vulnerability disclosure, the mechanism will immediately stop new deposits. At the same time, it will start the process of automatic unwinding of the existing positions.

Automation Rules

When we discussed the core concepts of Privana, we learned about key encumbrance as an essential component. It allows users to set programmable rules that execute trades automatically when the pre-defined conditions are met. This model is also at the foundation of Privana's automation engine.

When users create a rule, it is saved as an access-control policy inside the TEE and does not leave the enclave at any point. Whenever the condition is satisfied, execution is triggered and completed with the vault's encumbered key. The key itself stays unrevealed and bound within user-defined policy.

This is the goal of Privana's automated, policy-bounded trade execution: no external service can access or change the rules, nor their trigger conditions. Essentially, the functionality mirrors the conditional-order features of centralized exchanges while user sovereignty over the assets is maintained by self-custody.

Here is the list of rules that Privana plans to feature.

The rules have been designed to be non-conflicting. The accounting layer enforces balance constraints so that two active rules cannot claim the same assets simultaneously. This is the core governing principle of all Privana policies: asset-time segmentation stays consistent at all times.

AI Trading Agents

AI-enabled DeFi or DeFAI is popular among users, but it has its own security challenges. Traditional AI trading agents often involve users handing their private keys to centralized AI services. The automated trading thus comes at the cost of control and security.

Privana's alternative would connect AI-powered trading agents via scoped API keys to user vaults with strict, hardware-enforced guardrails. would connect AI-powered trading agents via scoped API keys to user vaults with strict, hardware-enforced guardrails. As a result, the agent can never exceed the user-set limits, nor can it view or access the private key. The automation here works via a scoped sub-policy. When the user grants access to the agent, it will be able to execute trades within the policy constraints.

Here is the list of agent policy controls.

This mechanism is starkly different from other AI trading setups. Centralized exchanges routinely ask users to share their API keys with the AI agents, often with withdrawal permissions. Traditional DEXes will let the user run bots, leaving their private key exposed in a hot wallet. Privana only lets the AI agent propose actions. The decision whether the action will be executed depends on the user's policy within the enclave, which also hosts the key, keeping it away from the agent.

Telegram Bot

Another feature in Privana that is in the pipeline is the private Telegram bot. It will help users manage their vault while keeping their identity confidential. Functionalities of this privacy-enabled bot will include:

  • balance check
  • swap execution
  • automation rule management
  • real-time notifications from Telegram regarding the user's portfolio

The bot's operations will take place through the Privana TEE. So, any commands the user gives to the bot will be processed only inside the enclave, sharing the same privacy guarantees as the main interface.

User confidentiality is the main USP of this bot, unlike typical DeFi notification bots. It does not require an email address or wallet address, so there is no permanent link between the user's identity and their on-chain activities. Instead of storing the user's Telegram handle in plaintext on any server, the enclave establishes a private connection via the link generated inside and also decrypts the handle. The TEE then sends notifications directly to the Telegram API.

Here is an overview of the bot's capabilities.

Safety model

The bot comes with limited action scope and baked-in restrictions.

  • No modifying vault policies or guardrails
  • No accessing or modifying API keys
  • No adding or removing AI-agent connections

If the user wants to perform actions that require high security, they must switch to the full Privana interface. Moreover, the bot's design takes into consideration any potential compromise of a Telegram account, as in such a scenario, the attacker's ability to cause damage is structurally bounded.

This concludes the deep dive into Privana's features. Next, I will discuss some Privana FAQs in detail. When new features arrive from Privana's roadmap, I plan to cover them as well. In the meantime, let's continue the discussion in the comments section about what you think of these features, what you like about them, and what else you would like to see incorporated.

Resources & references:

Top comments (0)