What is Secret DeFi?
Secret DeFi describes all decentralized finance (DeFi) apps that use Secret Contracts. Apps that allow you to trade, invest, lend, and borrow like DeFi apps on Ethereum. But with Secret Contracts, user data is private by default. This means your financial details can’t be viewed by anyone else unless you choose to share them.
As a result, Secret Contracts protect your financial assets from spying eyes, hackers, MEV bots, and front-running. While viewing keys and permits allow you to share your details with third parties—an accountant or auditor—if needed.
The benefits of Secret DeFi
Decentralized finance (DeFi) has significant advantages over traditional finance: it’s open to all, censorship-resistant, cheaper to maintain, and anyone can inspect the code that governs it.
But most DeFi projects and applications are built on blockchains that reveal all user data. Wallet addresses, balances, and transfers can be viewed on a public ledger and used by others to profit at the expense of the app’s users.
With Secret Contracts—Secret’s privacy-preserving smart contracts—user data is private by default and can’t be viewed by others unless given permission. This gives users of Secret DeFi apps:
Protection from hackers and scammers
If others can’t figure out how much you hold, you’re much less likely to become the target of hackers and scammers. Even if hackers manage to get access to your wallet, they won’t be able to view your funds if you stored them as Secret Tokens—the token standard used in Secret DeFi apps.
Safety from front-running and MEV bots
Front-running and miner extractable value (MEV) occur when actors use knowledge of future trades and transactions to make a profit, often at the expense of individual investors. But with Secret Contracts, orders are never visible on the mempool, and no attacker or malicious miner can front-run orders.
The flexibility to share details and stay compliant
With Secret DeFi, you get privacy but can allow others to view your financial information with viewing keys. Viewing keys allow you to comply with financial regulations—now, and in the future.
Examples of Secret DeFi in action
Secret Contracts enable users and developers to choose what to reveal. We call this customizable privacy. Here’s an illustration of how Secret Contracts can be used to build different privacy-preserving DeFi apps:
How Secret Contracts can power a privacy-preserving lending platform like Maker
Imagine a straightforward DeFi project or lending application that can autonomously give out loans to users.
The app is run by a smart contract that checks a user’s eligibility to get a loan (and how big it should be) by scanning their wallets and prior transactions. It looks for loans you requested in the past and whether you paid them back on time.
With a typical smart contract, sharing this data would mean exposing it publicly, giving everyone complete visibility of your finances.
But with a Secret Contract, your financial data can remain encrypted while nodes verify whether your data meets certain requirements. Nodes can execute the contract and receive the eligibility result without being able to observe the user’s transactions. At no point will your data be visible to anyone.
How Secret Contracts can enable a privacy-preserving decentralized exchange like Uniswap
Imagine a private swap that works similarly to Uniswap, allowing users to add liquidity to a pool and trade against that pool. This is how developers could set it up:
The balances of the Secret Tokens in the pool could be made publicly available, as this is essential to set the price for the trading pair
By keeping the contract state encrypted, individual contributors to the pool remain anonymous
Users can then swap Secret Tokens privately and no one but the user themselves will be able to see their balance. This is because the state of the Secret Tokens contract, where all the balances and token holders are tracked, would be re-encrypted.
How to start using Secret DeFi
There are already privacy-preserving AMMs, lending protocols, and liquidity pools all live on Secret! Here’s how to start using them:
Step 1: Get SCRT
SCRT is used to pay for gas on the network. Check out our Get SCRT page to figure out the best way for you to buy SCRT.
Step 2: Get Secret Tokens
Secret Tokens are like private ERC-20 tokens and the building blocks of Secret DeFi. Use one of our Secret Bridges to convert your blockchain tokens into Secret Tokens:
- Binance Smart Chain
- Other IBC / Cosmos chains
- Shinobi / Bitcoin Bridge (coming soon)
- Plasma Bridge (coming soon)
To make your SCRT Secret, use our ↔️ SCRT <> sSCRT converter.
Step 3: Pick your app of choice
Now that you have your SCRT and Secret Tokens, you can start swapping, providing liquidity, and more!
We recommend creating a private wallet that can’t be linked to your identity. Want to find out how? Check out our guide.