Skip to content

Commit

Permalink
rserglp and other bits n bobs
Browse files Browse the repository at this point in the history
  • Loading branch information
glasgowm148 committed Oct 22, 2024
1 parent 76f2954 commit 87e42c1
Show file tree
Hide file tree
Showing 16 changed files with 201 additions and 35 deletions.
63 changes: 31 additions & 32 deletions docs/contribute/standards/kya.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,89 +3,88 @@ tags:
- KYA
---


# Know Your Assumptions (KYA) in Ergo

The Ergo ecosystem operates on the **KYA (Know Your Assumptions)** model, which encourages transparency and user awareness regarding the assumptions they make when interacting with decentralized finance (DeFi) protocols. This model, embraced by the Ergo community, plays a significant role during the initialization of a wallet in Nautilus and while using decentralized applications (dApps) like Spectrum and Duckpools.
The Ergo ecosystem embraces the **KYA (Know Your Assumptions)** model, promoting transparency and user awareness regarding the assumptions made when interacting with decentralized finance (DeFi) protocols. This approach encourages users to understand risks and security concerns when using wallets like Nautilus and dApps such as Spectrum and Duckpools.

## Research Paper: *KYA - A Treatise on Assumptions in Cryptocurrencies and DeFi*

Developer Kushti is working on a research paper titled [KYA - A Treatise on Assumptions in Cryptocurrencies and DeFi](https://github.com/kushti/kya), aiming to explore overlooked but fundamental questions in the cryptocurrency space. The introduction highlights the importance of identifying the assumptions on which blockchain and DeFi protocols are built, shedding light on security, decentralization, and potential risks.

> "Traditional financial institutions rely on privacy-invasive checks such as KYC/AML. In the world of decentralized finance, we reverse that control, allowing users to check protocols for their underlying assumptions. KYA practices aim to introduce transparency where users can verify the security and properties of decentralized financial tools."
Developer Kushti is working on a research paper titled [KYA - A Treatise on Assumptions in Cryptocurrencies and DeFi](https://github.com/kushti/kya). It explores key assumptions underlying blockchain and DeFi protocols, highlighting their impact on security, decentralization, and risk management.

The KYA framework encourages users to take an active role in verifying the protocols they interact with, offering a more informed and secure participation in the decentralized financial ecosystem.
> "In decentralized finance, users can verify protocol assumptions, reversing the invasive privacy checks of traditional finance." - Kushti
The KYA framework encourages users to verify the protocols they interact with, fostering informed and secure participation in DeFi.

## KYA Prompts in the Ergo Ecosystem

Ergo introduces **KYA prompts** to educate users about the assumptions involved when interacting with different protocols. These prompts serve as a summary, providing necessary information that users should consider before engaging with the ecosystem’s applications. For example, projects like **SigmaFi** have incorporated KYA prompts to assist users in reviewing critical assumptions and the underlying technology.
Ergo introduces **KYA prompts** to inform users of key assumptions before interacting with different protocols. These prompts are designed to provide clear, concise information about the risks, requirements, and assumptions associated with each protocol, enabling users to make informed decisions.

KYA prompts typically cover the following areas:

For more information please see [Building a standard KYA Prompt](https://www.reddit.com/r/ergonauts/comments/159h9rs/building_a_standard_kya_prompt/)
1. **Security Assumptions**: Highlighting the underlying security mechanisms, such as cryptographic algorithms, consensus models, and trusted parties.
2. **Economic Assumptions**: Providing details on tokenomics, incentives, and economic factors that affect the protocol's stability and sustainability.
3. **User Responsibilities**: Outlining what actions users need to take to ensure their safety, such as managing private keys or understanding potential risks in smart contracts.
4. **External Dependencies**: Identifying any reliance on third-party services or external data, such as oracles, that could impact the protocol's functionality.
5. **Transparency**: Ensuring that users are aware of any opaque components or centralized elements within a supposedly decentralized protocol.

Projects like **SigmaFi** have adopted KYA prompts, helping users assess critical assumptions and understand the underlying technology. These prompts serve as a valuable tool in empowering users, promoting transparency, and mitigating risks in the DeFi landscape.

For more, see [Building a standard KYA Prompt](https://www.reddit.com/r/ergonauts/comments/159h9rs/building_a_standard_kya_prompt/).

## Ergo’s Assumptions

Building upon Bitcoins security foundation, Ergo operates under a distinct but modest set of assumptions to ensure a secure and scalable system.
Ergo builds on Bitcoin's security with its own unique set of assumptions to ensure a scalable and secure system.

### 1. Bootstrapping Techniques

Ergo employs advanced techniques like hash-based authenticated data structures for UTXO transformations, NiPoPoW (Non-Interactive Proofs of Proof-of-Work) proofs, and UTXO set snapshots. These methods enhance the security while optimizing storage requirements and scalability.
Ergo uses techniques like hash-based authenticated data structures, NiPoPoW proofs, and UTXO set snapshots for security, optimized storage, and scalability.

### 2. Signature Scheme

Ergo uses **Schnorr signatures** for cryptographic security, relying on the well-established secp256k1 curve also used in Bitcoin. Moreover, Ergo incorporates sigma protocols, enabling the construction of advanced cryptographic applications, with some relying on the **decisional Diffie-Hellman assumption**.
Ergo employs **Schnorr signatures** based on the secp256k1 curve and sigma protocols, enhancing cryptographic security through the **decisional Diffie-Hellman assumption**.

### 3. Miner Behavior

Like Bitcoin, Ergo assumes that the majority of miners will act honestly and follow protocol rules. However, Ergo's **storage rent** concept simplifies miner incentives for long-term sustainability of block rewards, while ensuring that data is retained efficiently.
Ergo assumes honest miner behavior akin to Bitcoin, using a **storage rent** mechanism to sustain block rewards and incentivize efficient data retention.

### 4. Scalability and Security

Ergo’s architecture supports Layer 1 (L1) scalability without compromising security. The platform offers feature-rich smart contracts and cryptographic protocols, ensuring secure interactions within the blockchain while addressing DeFi scalability challenges.

---
Ergo's architecture supports Layer 1 scalability while maintaining security, offering smart contracts and cryptographic protocols that ensure safe DeFi interactions.

## Bitcoin as Digital Gold

Bitcoin’s security model rests on several critical assumptions:
Bitcoin’s security model rests on several key assumptions:

1. **Hash Function Security**: Bitcoin’s reliance on the SHA-256 hash function assumes that its cryptographic properties—collision resistance, preimage resistance—will remain secure.
1. **Hash Function Security**: Bitcoin relies on SHA-256's resistance to collision and preimage attacks.
2. **Digital Signature Scheme**: Assumes no quantum computer will break 128-bit elliptic curve security.
3. **Honest Mining Hashrate**: Assumes the majority of miners will follow protocol rules, underpinning Bitcoin's consensus.

2. **Digital Signature Scheme**: The elliptic curve signature scheme assumes that quantum computers capable of breaking 128-bit security will not emerge.

3. **Honest Mining Hashrate**: The majority of Bitcoin’s mining power is expected to follow protocol rules, building on the longest chain. This forms the basis of Bitcoin’s consensus and overall security.

Despite uncertainties, Bitcoin has functioned effectively for over 13 years, with no major issues regarding its core assumptions.

---
Despite these assumptions, Bitcoin has functioned effectively for over 13 years.

## DeFi Applications on Ergo

The Ergo platform serves as a foundation for various decentralized finance (DeFi) applications, providing security, scalability, and flexibility.
Ergo's platform underpins various DeFi applications, ensuring security, scalability, and flexibility.

### 1. Oracles

Ergo supports oracles, which bring reliable external data into DeFi protocols. This integration ensures secure data feeds, which are crucial for many dApps within the ecosystem.
Ergo supports secure oracle integration, providing reliable data for dApps in the ecosystem.

### 2. ErgoDEX

ErgoDEX (formerly Spectrum) is a decentralized exchange (DEX) built on Ergo. Leveraging Ergo's security guarantees, it facilitates trustless peer-to-peer trading of digital assets.
Formerly Spectrum, **ErgoDEX** facilitates trustless peer-to-peer trading on Ergo, leveraging the platform’s security features.

### 3. Stablecoins: Djed and SigUSD

Djed and SigUSD are stablecoins designed on Ergo, providing a decentralized mechanism for stable value representation, contributing to the broader DeFi ecosystem with transparency and decentralization.
**Djed** and **SigUSD** are decentralized stablecoins built on Ergo, enhancing the DeFi ecosystem with transparent value stability.

### 4. Dexy

Dexy is another decentralized exchange focused on a simplified and user-friendly trading experience. It builds on Ergo’s core security and scalability assumptions to offer a more intuitive platform for users.


**Dexy** is a user-friendly decentralized exchange, utilizing Ergo's security and scalability to provide an accessible trading experience.

## References

1. [Original KYA Post](https://www.ergoforum.org/t/know-your-assumptions/4198)
2. [The Importance of KYA](https://ergoplatform.org/en/blog/The-Importance-of-Know-Your-Assumptions/)
3. [KYA Research Paper](https://docs.ergoplatform.com/contribute/standards/kya/#research-paper)
4. [Kushti’s KYA Paper](https://github.com/kushti/kya/blob/master/kya.pdf)
5. [SigmaFi dApp](https://sigmafi.app/#/)
5. [SigmaFi dApp](https://sigmafi.app/#/)
5 changes: 3 additions & 2 deletions docs/off-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Watchers, functioning as cross-chain oracles, are vital to the Rosen Bridge's op
3. **Monitor Transactions**: Vigilant monitoring of cross-chain transactions is imperative for watchers to validate them in adherence to the protocol's guidelines.
4. **Earn Rewards**: Watchers are remunerated in ERG for their pivotal role, with the distribution reflecting their contribution to network security and functionality.

### Estimated Rewards
### Estimated Rewards
The reward distribution for a watcher on the Rosen network from January 22, 2024, to February 3, 2024, is exemplified below. Note that rewards are contingent on bridge traffic and may fluctuate.

- ERG Watcher Rewards: 100.217 ERG
Expand Down Expand Up @@ -108,4 +108,5 @@ Explore the project [here](machina-finance.md)

## Conclusion

Ergo's ecosystem presents a plethora of off-chain earning prospects through roles such as watchers, oracles, and automated bots. These roles not only offer passive income streams but also significantly contribute to the Ergo blockchain's functionality and security. By participating in these opportunities, users can bolster the decentralized ecosystem and reap the benefits of its progression and success.
Ergo's ecosystem presents a plethora of off-chain earning prospects through roles such as watchers, oracles, and automated bots. These roles not only offer passive income streams but also significantly contribute to the Ergo blockchain's functionality and security. By participating in these opportunities, users can bolster the decentralized ecosystem and reap the benefits of its progression and success.

Binary file added docs/tutorials/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
164 changes: 164 additions & 0 deletions docs/tutorials/rsERGLP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
# Comprehensive Guide: Participating in rsERG/ETH Liquidity Pools

This guide walks you through the process of participating in rsERG/ETH liquidity pools. It covers essential precautions, the bridging process, and how to provide liquidity on Uniswap step by step.


---

## Table of Contents
1. [Important Notes](#important-notes)
2. [Preparing for the Bridge](#preparing-for-the-bridge)
3. [Bridging Assets Using Rosen](#bridging-assets-using-rosen)
4. [Adding rsERG to MetaMask](#adding-rserg-to-metamask)
5. [Step-by-Step: Providing Liquidity on Uniswap](#step-by-step-providing-liquidity-on-uniswap)
6. [Additional Tips and Notes](#additional-tips-and-notes)

---

## Important Notes

### ERGO Token Contract Address

- **ERGO Token Contract**: `0x6C060Ba738af39A09F3b45ac6487dFC9Ebb885f6`
- Always verify the token contract address on the [Rosen asset list](https://app.rosen.tech/assets) or on [Etherscan](https://etherscan.io/address/0x6C060Ba738af39A09F3b45ac6487dFC9Ebb885f6). Avoid using addresses shared via DMs or chats, as there are scams, especially on EVM chains.


### Liquidity Pools (LPs)
Liquidity pools are versatile financial tools used by both small investors and large entities. By providing liquidity, you can:

- **Earn Swap Fees**: LP providers share the swap fees paid by traders.
- **Hedge Risk**: By pooling multiple assets, you can reduce losses in volatile markets.

LPs are relatively safe, especially when using verified decentralized exchanges (DEXs) with high liquidity. However, it’s essential to do your own research (DYOR) to understand the risks involved.

---

## Preparing for the Bridge

Before bridging ERG to ETH, ensure you have an Ethereum wallet with enough ETH for gas fees. Recommended wallets include MetaMask and Rabby Wallet, both of which support hardware wallets for added security.

---

## Bridging Assets Using Rosen

To bridge ERG through Rosen, follow these steps:

1. **Access Rosen Bridge**: Visit the [Rosen Bridge application](https://app.rosen.tech/).
2. **Select Source and Target Chains**: Choose 'Ergo' as the source and 'Ethereum' as the target.
3. **Enter Destination Address**: Fill in the Ethereum destination address where you want to receive the assets.
4. **Select Token and Amount**: Choose 'ERG' as the token and specify the amount you wish to bridge.
5. **Review Fees**: The Rosen UI will display both the transaction fee and the bridge fee before you proceed.

By following these steps, you can efficiently bridge your assets using Rosen Bridge.

- **Consolidate Your Wallet**: If you encounter an "insufficient ERG" message but have funds, consolidate your wallet using Nautilus > Wallet Optimization.
- **Transaction Timing**: Transfers typically take around 2 hours, but delays can occur.
- **Monitor Transaction Status**: Track your transaction progress on the [Rosen events page](https://app.rosen.tech/events).




---

## Adding rsERG to MetaMask

After bridging the rsERG token, you may need to manually add rsERG to your MetaMask to view your assets. Here’s how to do it:

### Step 1: Open MetaMask
- In your MetaMask wallet, click on **"Assets"**.

### Step 2: Add Token
- Scroll down and click on **"Import Tokens"**.

### Step 3: Add Custom Token
- Paste the rsERG contract address (`0x6C060Ba738af39A09F3b45ac6487dFC9Ebb885f6`) into the **Token Contract Address** field.


### Step 4: Confirm
- Click **"Add Custom Token"** and your rsERG tokens will now be visible in your MetaMask wallet.

---

## Step-by-Step: Providing Liquidity on Uniswap

Follow these steps to provide liquidity in the rsERG/ETH pool on Uniswap:

### Step 0: Enable Smart Transactions in MetaMask
1. **MetaMask Advanced Settings**: Enable the "Smart Transactions" feature to ensure that if a transaction fails or gas fees exceed the market rate, the transaction will be reverted at no cost. This may take about 2 minutes to process.

### Step 1: Open Uniswap
- Access Uniswap via [this link](https://app.uniswap.org/) or by visiting it through a reliable source like DefiLlama (navigate to Chains > Ethereum > Uniswap).



### Step 2: Connect Your Wallet

- Connect Your Wallet

![Opening Uniswap](2.jpg)

- Select your ETH address that holds rsERG tokens.

![Connecting Wallet](3.jpg)

### Step 3: Confirm Permission
- Once connected, confirm that Uniswap has permission to access your wallet.

![Confirming Permission](4.jpg)

### Step 4: Access the Pool Section
- Navigate to the “Pool” tab and click on “+ New Position.”

![Access Pool](5.jpg)

### Step 5: Choose the ETH/rsERG Pair
- Enter ETH in the left field and copy-paste the rsERG contract address (`0x6C060Ba738af39A09F3b45ac6487dFC9Ebb885f6`) on the right side.

![Choosing ETH/rsERG Pair](7.jpg)

### Step 6: Select the Fee Tier
- The rsERG/ETH pair has a 1% fee pool, which is usually selected by default.

![Selecting Fee Tier](8.jpg)

### Step 7: Enter the Deposit Amount
- Input the amount of ETH or rsERG you want to provide. The system will automatically calculate the corresponding amount of the other asset (50/50 ratio).

![Entering Deposit Amount](9.jpg)

### Step 8: Preview and Confirm the Transaction
- If you have enough assets, click “Preview” to review the transaction details. Then click “Add” to initiate the liquidity transaction.

![Previewing Transaction](10.jpg)

### Step 9: Approving rsERG Interaction with Uniswap
- Uniswap will require your approval to interact with your rsERG tokens.
- **Infinite Approval Option**: You can set this approval to an infinite amount, meaning you won’t need to approve every time you interact with the contract. This can be revoked later via Etherscan if necessary.
- **Exact Amount Option**: Alternatively, you can set the approval to the exact amount of rsERG you plan to use, but this may become inconvenient in the future as you would need to sign the interaction transaction every time.

### Step 10: Confirm the Transaction in MetaMask

- MetaMask will open, showing the gas fees and transaction details. Double-check everything, then confirm the transaction if everything looks correct.

### Step 11: Sign Two Transactions
- **Transaction 1**: Approve Uniswap to interact with your rsERG tokens.
- **Transaction 2**: Send the assets to the liquidity pool.

![Confirming Transaction](12.jpg)

Congratulations! You’ve successfully added assets to the rsERG/ETH liquidity pool.

---

## Additional Tips and Notes

- **Track Your LP Tokens**: After adding liquidity, Uniswap may prompt you to add rsERG and LP tokens to your token list. Do this so that they appear in your wallet's assets tab.
- **Gas Fee Considerations**: ETH gas fees are based on current network load, not the transaction amount. Therefore, providing larger amounts may reduce overall fees as a percentage of the transaction.

To check your liquidity pool positions, visit the "Pool" tab on Uniswap.

---

This guide equips you with the knowledge to participate in rsERG/ETH liquidity pools effectively. Make sure to stay informed about ongoing risks, always verify contract addresses (such as on [Etherscan](https://etherscan.io/address/0x6C060Ba738af39A09F3b45ac6487dFC9Ebb885f6)), and use trusted platforms for your transactions.

*Credit for this guide goes to Vadim on Telegram.*
Binary file added docs/tutorials/uni/10.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/tutorials/uni/11.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/tutorials/uni/12.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/tutorials/uni/2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/tutorials/uni/3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/tutorials/uni/4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/tutorials/uni/5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/tutorials/uni/6.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/tutorials/uni/7.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/tutorials/uni/8.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/tutorials/uni/9.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ nav:
- Guards: eco/rosen/rosen-guard.md
- Tokenomics: eco/rosen/rosen-tokenomics.md
- Team: eco/rosen/rosen-team.md
- Uses: eco/rosen/rosen-uses.md
- Uses:
- eco/rosen/rosen-uses.md
- rsERG-LP: tutorials/rsERGLP.md
- Oracles:
- uses/oracles.md
- Oracle Pools V2: eco/oracles-v2.md
Expand Down

0 comments on commit 87e42c1

Please sign in to comment.