# 8.1 Lending Contract Overview

Smart contract platforms based on the Ethereum blockchain, exemplified by Ethereum, offer significant potential in eliminating the need for trust in distributed applications and enhancing transparency. Ethereum is a prominent platform in this space, leveraging sophisticated programming languages ​​such as Decentralized Applications to facilitate the creation of decentralized applications (DApps) with relative ease. However, these platforms currently lack straightforward ways to integrate meaningful privacy into these applications.

We can consider lending platforms on Ethereum. You can borrow and lend against cryptocurrency through smart contracts without the need for a bank or any intermediary. The contract automatically manages collateral, interest calculation and liquidation. These can be constructed without obvious difficulty, but when trying to implement a centralized lending, the recipient needs stronger credit endorsement and certain collateral. The bank will make the assessment and ultimately decide whether to lend. This obstacle makes many things more complicated. It is possible that the loaned funds flow into people who do not need the funds to start a business. The lending platform based on Ethereum simply solves this problem. The funds borrowed through the lending platform on Ethereum will play the role of the funds themselves.

For example, consider Ethereum’s decentralized exchange (DEX). Contracts allow you to trade crypto assets directly with other users without trusting centralized exchanges. Common ones include Uniswap, PancakeSwap, etc., and we can easily conduct transactions. The inherent transparency of the Ethereum trading system maintains the confidentiality of the initial price in such auctions. For the traditional lending mentioned above, the rigid official documents provide great obstacles to lending.

The Ethereum lending platform, as a core component of decentralized finance (DeFi), is completely changing our traditional understanding of lending. They leverage the automation and transparency of smart contracts to bring users many benefits that traditional finance cannot match.

In the development stage of Odyssey 2.0, the focus will be on building Odyssey protocol lending. Higher transparency and security. Traditional lending relies on centralized institutions such as banks, and its operations are often opaque, making it difficult for users to understand the flow of funds and risk control mechanisms. The Ethereum lending platform operates based on open and transparent smart contracts, and all codes and transaction records can be queried on the blockchain.

This means: Open audit allows anyone to review the contract code and understand its operating logic and risk parameters. Immutable Records Once a transaction is recorded on the blockchain, it cannot be modified or deleted, eliminating the possibility of human tampering. Eliminate middleman risks: Users interact directly with smart contracts without trusting third-party institutions, reducing centralized risks such as escape and misappropriation of funds.

Permissionless and Global Accessibility, the Ethereum lending platform is permissionless. This means: No barriers to entry. Anyone, no matter where they are, as long as they have an Ethereum wallet and crypto assets, can participate in the lending market without going through cumbersome background checks or credit checks. Globalized market lending is no longer restricted by geographical location or national borders, forming a global liquidity market and improving the efficiency of capital utilization.

Smart contracts run around the clock, and users can perform lending operations at any time, regardless of bank business hours. Higher capital efficiency and potential returns. By eliminating intermediate links and geographical restrictions, the Ethereum lending platform can improve the efficiency of capital utilization. Real-time interest rate adjustment, lending interest rates are usually automatically adjusted through algorithms based on supply and demand, reflecting the true situation of the market. Instant liquidation. When the value of the borrower's collateral is insufficient to cover the loan, the smart contract will automatically perform liquidation to ensure the safety of the lender's funds.

Yield aggregation, many DeFi protocols allow users to deposit loaned funds into other protocols to obtain additional income (i.e. "liquidity algorithm" or "yield farming"), further increasing the income potential of funds.

Collateral diversification and flexible lending. Traditional bank lending usually requires physical mortgages such as real estate and vehicles. The Ethereum lending platform uses crypto assets as collateral, which provides users with greater flexibility.

Multiple types of crypto-asset collateral: Users can use Ethereum (ETH), various stablecoins (USDT, USDC, DAI) and other ERC-20 tokens as collateral. Instead of selling assets, users can gain liquidity by staking crypto assets without having to sell their holdings, avoiding potential tax issues or missing out on asset appreciation. Flash Loans is a unique innovation in DeFi that allows users to borrow and return large amounts of funds in the same transaction. It is often used for advanced operations such as arbitrage and liquidation without providing any collateral.

Composability is one of the most powerful features of the Ethereum DeFi ecosystem. Smart contracts are modular and can be combined and called upon like Lego blocks to create more complex and powerful financial products. Protocol interoperability, a lending protocol can easily interact with another decentralized exchange, stablecoin project or revenue aggregator to provide users with one-stop financial services. Innovation acceleration, this composability greatly reduces the threshold and cost of developing new financial products, accelerating the speed of innovation in the DeFi field.

The concept of confidential transfers on Ethereum thus provides a compelling solution to inject privacy into critical applications such as lending and return channels. However, existing methods for handling confidential transactions mainly follow the Unspent Transaction Output (UTXO) model, a framework spent by Bitcoin in which new transactions are enacted using unspent outputs from transactions. This model, while effective in some cases, is not suitable for applications that need to maintain state, a key aspect of smart contract platforms such as Ethereum, which operates on an account-based model.

UTXO-based systems were originally proposed to address privacy issues in Bitcoin, thus requiring significant changes to Bitcoin's basic design. Simply put, UTXO is the "money that has not been spent" in your wallet. When you receive a bitcoin on the Bitcoin network, the money is not added directly to a total balance in your account. Instead, the money is recorded as a Transaction Output, and it is in an unspent state.

Imagine you have a $100 bill. This banknote is a UTXO. When you use it to buy something for 90 yuan, you cannot directly deduct 90 yuan from this note. On the contrary, you need to give this 100 yuan note to the merchant (consumed), and then the merchant will give you 10 yuan (new UTXO), and at the same time, the 90 yuan will belong to the merchant (another new UTXO).

In the Bitcoin network, each transaction contains: Inputs: UTXOs that reference one or more previous transactions. These UTXOs must belong to the spender and be in an unspent state. Outputs: Create new UTXO. These new UTXOs can be distributed to one or more recipients, with some of them potentially going back to the spender as change and some being paid to miners as transaction fees.

For example: Suppose you have the following UTXO in your Bitcoin wallet: UTXO A: 0.5 BTC/UTXO B: 0.3 BTC If you want to send 0.6 BTC to a friend, your transaction might look like this: Input: UTXO A (0.5 BTC)/UTXO B (0.3 BTC) Output: 0.6 BTC sent to friend (new UTXO C), change to you 0.2 BTC (0.5 + 0.3 - 0.6 = 0.2 BTC) (new UTXO D) After this transaction is completed, UTXO A and UTXO B are spent (Spent) and are no longer in an unspent state. UTXO C and UTXO D become new unspent transaction outputs and can be used for future transactions.

Nonetheless, implementing UXTO-based mechanisms into Ethereum contracts is fraught with challenges, including increased storage costs, reduced confidentiality, limited interoperability with other contracts, and barriers to widespread adoption. To address these challenges, we introduce Odyssey, an efficient, fully decentralized confidential payment mechanism tailored to an account-based model. Odyssey does not require any modifications to the basic design of smart contracts. Based on Ethereum contracts, Odyssey smart contracts can be executed independently or together with other smart contracts to facilitate the confidential exchange of token amounts and other account-based cryptocurrencies, independent of their specific consensus mechanisms.

Our contributions can be summarized as follows:

1. Confidentiality: Odyssey’s smart contract, its code logic and all transaction data are open and transparent and can be viewed by anyone. Under the premise of security, we keep the privacy of users and the core confidentiality of the enterprise confidential. Users use cryptographic proofs to transact with ZTH, ensuring a high level of privacy.
2. Zero-knowledge proof: A key component of Odyssey is the mechanism for zero-knowledge (ZK) proof. In order to optimize Odyssey, we introduced a new ZK proof mechanism, zk-SNARKs. This new mechanism synergizes its security features. Odyssey integrates with blockchain to run sensitive parts of smart contracts in TEEs, ensuring the privacy of data and calculations. The external interface of TEEs can interact with the blockchain and upload the results to the chain.

Coin mixers, such as Tornado Cash, increase the anonymity of transactions by mixing large numbers of users' funds together, breaking the link between money flows. The user deposits the tokens into the currency mixing contract, and after waiting for a period of time, withdraws the same amount from the currency mixing contract through a new address.

Tokens. Since the contract has a large number of deposits and withdrawals from other users, it is difficult for outside observers to correlate deposit and withdrawal transactions.

1. Implementation: We have implemented the Odyssey smart contract on Ethereum. Our analysis of what is needed for implementation shows that Odyssey is not only feasible within the current Ethereum framework, but will become even more efficient as the platform is enhanced. The pledge algorithm, incentives, pledge and other smart contracts deployed on Ethereum are all designed to be safe, reliable, open source, auditable, etc.
2. Interoperability. Even if privacy protection technology is used, it is necessary to ensure the safe exchange of value and information between different privacy protocols and different blockchains. The application of ZKP in Layer 2 solutions, such as zk-Rollups, actually also promotes interoperability between the Ethereum mainnet and Layer 2, because transactions on Layer 2 can be verified on the mainnet through a ZKP. Anonymity usually refers to the concealment of the identities of participants in a transaction and the amount of the transaction. ZKP plays a central role in this, allowing users to prove that they meet all the conditions for an action without revealing their identity. For example, with ZKP, users can prove they own an NFT without revealing their wallet address.

Anonymity: Users can generate a ZKP that proves they have enough funds to conduct a transaction and that the transaction complies with preset rules (e.g., no double spending), while hiding the specific sender address, receiver address, and transaction amount. Zk-SNARKs are the key technology to achieve this kind of private transactions, and privacy coins such as Zcash are based on this principle. We also propose an extension to Odyssey that does a good job of masking the identity of participants. Some projects are building specialized privacy DApps or privacy layer protocols on top of Ethereum, aiming to provide more native privacy protection.

These advances make Odyssey not only a practical solution to today’s blockchain challenges, but a groundbreaking step toward more secure, private, and efficient blockchain transactions in the future.
