Skip to content

A private lending platform in the Oasis Sapphire blockchain that leverages on-chain and off-chain confidentiality to provide secure and private financial transactions without KYC.

Notifications You must be signed in to change notification settings

lla-dane/Lending-Sapphire

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lending Sapphire

Video demo

https://www.loom.com/share/9756111ea0a84ea785a8514b8eadfcf7?sid=928c23af-7cbb-4dc4-80f4-f7434e4ea849

Inspiration

A private lending platform in the Oasis Sapphire blockchain that leverages on-chain and off-chain confidentiality to provide secure and private financial transactions without KYC. It simulates a dual-token setup for loans and collateral, with automated oracle price feeds facilitated by Runtime Off-Chain Logic (ROFL) in Trusted Execution Environments (TEEs).

Presentation:

PPT: LendingSapphire.pdf

System Design

system_design

Protocols Used :-

Utilizes decentralised TEE’s using ROFL’s to secure the price feed, stopping anyone to mess with the price feed

1. OASIS:

This project leverages the Oasis Sapphire blockchain to boost the security and efficiency of a private lending platform. Using EVM-compatible smart contracts and Runtime Off-Chain Logic (ROFL) within Trusted Execution Environments (TEEs), it enables dynamic loan pricing and auto-liquidation without traditional KYC. This approach ensures privacy and broadens access, making lending secure and user-friendly globally.

2. PYTH:

We use Pyth to retrieve the prices of the tokens, and eventually, the prices are pushed on chain, from where they are queried by a Oracle.sol

Description:

How Sapphire benefits our platform (SAPPHIRE + ROFL) ?

This platform takes full advantage of the Oasis Sapphire blockchain to offer a secure environment for executing EVM compatible smart contracts with enhanced on-chain data confidentiality. This feature ensures that sensitive transaction details such as sender and receiver information are encrypted, allowing users to engage in lending and borrowing without compromising privacy. This shields them from common blockchain threats like front-running, where exposed transaction details could be misused by opportunistic observers.

Moreover, we integrate off-chain confidentiality using ROFL, which significantly boosts out platform's integrity and security, when paired with Trusted Execution Environments (TEEs). This setup not only secures sensitive operations like real-time pricing feeds but also ensures the accuracy and integrity of these feeds, crucial for calculating loan values reliably. By automating financial processes such as loan issuance based on collateral and auto-liquidation protocols in a secure manner, out platform delivers tailored and responsive financial services that preserve the inherent privacy first ideals of blockchain technology.

How Does The Platform Work ?

  1. Dual token setup: Token1 is used as collateral by borrowers and Token2 is loan currency provided by liquidity providers. This is what borrowers receive when they take out a loan.

  2. Lending process: People who want to lend money, deposit Token2 into a lending pool and earn an interest rate of 6% for particular time periods. These deposits boost the total amount of money available in the pool, which is then used to provide loans to borrowers.

  3. Borrowing process: Borrowers secure a loan by depositing Token1 as collateral. Then they receive an amount of Token2 equivalent to 90% of their Token1's current market value. This price feed is fetched through real-time, secure price feeds from ROFL. Borrowers are charged an interest rate of 7% on the loan amount.

  4. Pricing and Valuation: The value of Token1 and Token2 is dynamically updated using data from ROFL, which gathers information form multiple off-chain sources to ensure accurate, tamper proof pricing (with the help of TEEs). This is critical for fair loan assessments.

  5. Repayment process: Borrowers agree to repay the borrowed Token2 plus the accrued interest. The total amount to be repaid is based on how long the loan has been outstanding.

  6. Auto-Liquidation: A system continuously checks the price ratio of Token1 to Token2. If the value of the collateral falls significantly, and the loan-to-value (LTV) ratio drops below a set threshold, auto-liquidation is triggered automatically.

  7. Security leverage: All price feeds are tamper proof, with the help of TEEs, and on-chain confidential transactions leveraged over Sapphire.

What Real World Problem Our Platform Intends To Solve ?

  1. Eliminates the need for personal identification through KYC, ensuring user transactions remain anonymous and secure.

  2. Uses confidential smart contracts to keep transaction details private, preventing potential front-running and market manipulation.

  3. Integrates real-time data feeds to dynamically adjust loan terms based on market conditions, protecting both lenders and borrowers from volatility.

  4. Utilizes decentralised TEE’s using ROFL’s to secure the price feed, stopping anyone to mess with the price feed

Contract Address on RootStock Testnet:

Token1.sol - 0x4fe4C39d0296003Df97cB9bD3f2226a9260633be

Token2.sol - 0x94FAC27739Ac7825F70025988D7FAe34A51F5DeD

Lending.sol - 0xd872f8d12EE9e49b8ed16ae24f55afd5B043f53C

Contract Address on Sapphire Testnet:

Token1.sol - 0xA9623c34517256e29e89FD15F840dA2e78A34dCf

Token2.sol - 0xA5Bc167931bFAFd5FBF9c84488531300404Fc353

Lending.sol - 0x52cF0df87BB61fFe03A76A8491c8B945f8d903Ba

Future Developments

  1. Integrate more tokens for buying and lending in the protocol.

  2. Improve the UI/UX in the frontend.

About

A private lending platform in the Oasis Sapphire blockchain that leverages on-chain and off-chain confidentiality to provide secure and private financial transactions without KYC.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 50.6%
  • JavaScript 35.9%
  • Solidity 5.6%
  • Rust 3.5%
  • CSS 2.9%
  • HTML 1.5%