Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add peggy on the hub #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions peggy_on_the_hub.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Peggy

## Question

Should Peggy be deployed as a Shared Security Zone or module in Gaia as part of the Cosmos SDK?

## Context

In April 2020, Althea proposed an [DeFi enabled Ethereum bridge for Cosmos](https://blog.althea.net/defi-enabled-ethereum-bridge-for-cosmos/) for a DEFI enable PegZone.

The Interchain Foundation has provided [Althea](https://blog.althea.net/solid-foundations-for-peggy/)with resources to implement the technical components of this vision.
Copy link

@jackzampolin jackzampolin Jul 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think an argument could be made that because ATOM holders have paid for Peggy dev that it should be deployed on the hub as that would drive the most value for the atom holder.s

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. Most growth potential of peggy should be redistributed to Atom holders, except for some fraction to the operational institution who build, manage and operate peggy backend/frontend&interfaces/community/governance/branding&marketing. The fraction can be the institution's payoff over operating cost and opportunity cost.

zmanian marked this conversation as resolved.
Show resolved Hide resolved

Althea is developing a Cosmos SDK [module](https://github.com/cosmos/peggy/tree/althea-peggy)+ solidity contracts here.

A Schelling point has not been established on how this module should be deployed.

### Option 1

ATOM/(or another token:Althea?) holder set establishes a new blockchain purpose built for Peg zone management. Via an on chain script powered by COSM-WASM, the Cosmos Hub adds the ability for validators to opt their ATOMs into faults on the Peggy chain and a COSM WASM contract is added that recognizes Peggy specific faults and slashes ATOMs. An additional property would all the victims to be reimbursed via slashed or inflated ATOMs from the Hub.

### Option 2

Deploy Peggy as module in Gaia as the Hub. Hub Validators ( maybe some day delegators) vote in the Liquidity DAO managing the collateral. ERC20 tokens are minted by the Hub onto the Cosmos Network. Interests rate/ earnings would be distributed to staked ATOM holders.

## The case for Option 1: Sovereign Chains with Shared Security
Copy link

@Hyung-bharvest Hyung-bharvest Aug 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure why each option has different ways to implement?
I understand that the only difference between option 1 and 2 is how security is provided.
Implementation methodology seems another independent issue.
Maybe because the hub is not likely allow CosmWasm adoption?

For implementation methodology, I am also not sure about CosmWasm utilization for implementing peggy.
Isn't it reducing failure point if we directly implement it as a new module without CosmWasm?

So I think it would be nice if we can seperate the issues here.

  1. a pegzone with shared security OR hub(gaia) adoption
  2. a new module OR CosmWasm smart contract --> the peggy main branch is implemented with the new module and it does not utilize CosmWasm so I think we can remove CosmWasm option here?


In Option 1, the Cosmos Hub specializes as the security/ accountability layer of Cosmos. ATOM holders are not directly responsible for managing the Peg, the Ethereum event and instead a subset of validators opt into participation and governance of Peggy chain.

Because of the separation of concerns between Peggy and the Cosmos Hub the Cosmos hub can credibly and independently respond to collusion and malfeasance by the operators of Peggy.

The Cosmos Hub can offer this service to multiple similar Pegs rather than nominating a single blessed Peg zones.

The Cosmos hub will be required to be able to analyze pairs of state transitions and smart contract executions on the Cosmos Hub for correctness. This will involve being able execute module logic and block headers and ethereal smart contract state. The most likely implementation target for these capabilities is Rust executed inside CosmWasm.

The Smart Contract can be made more efficient by a smaller number of signers.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depending on ETH gas prices this might be a deciding factor?

Copy link

@jkilpatr jkilpatr Jul 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The difference between 3 and 100 signers is ~5x gas cost. So very sublinear thanks to our optimization work. Although I would like to do a much more detailed study before recommending any decisions.

Copy link

@Hyung-bharvest Hyung-bharvest Aug 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the integration of althea-peggy into main branch of peggy not included in the job description from ICF?

I think the integrated full cycle of peggy branch is necessary for us to bring it to production level, although it can be done by others. but because it is already funded to althea it seems like natural to complete the integration work by althea.

Copy link

@jkilpatr jkilpatr Aug 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this problem is more complex than it seems at first glance. We tried to address it more in this blog post.

https://blog.althea.net/solid-foundations-for-peggy/

Peggy master (currently) is targeting Option 1 in this proposal using different means than the CosmWasm based system described. In short a peg zone with little stake of it's owned governed by stake on another zone.

In the process of engineering this system some components of Peggy (master branch) are too immature to deploy in production.

Althea Peggy is focused on a lower level of security, but having all the components ready to deploy (the relayer and Ethereum contract specifically). These improvements can and should be integrated into Peggy master but more will have to be done to achieve a system where another zone governs the peg zone.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the explanation! So we need a team to bring these two branches into an integrated production level peggy!


## The case for Option 2: Integrating Peggy into the Cosmos Hub

Integrate Peggy directly into Gaia. Atom holder would directly earn yield on pegged assets and validators would be operating the Ethereum network oracle. The Validators would need to sign transactions on the Ethereum chain and participate in the governance of pegged assets connected to DEFI.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be interesting to see how many of the top 20 would be interested in the increased governance load. one thing that might help here is https://notifications.lunie.io/


They would also facilitate accounting for and tracking of yield earned on Ethereum back to ATOM holders for managing the Peg.

Ultimately the security of this system will depend on incentive alignments and honesty and accountability assumptions. There is no natural place to holder Cosmos Hub validators accountable and they are unlikely to punish themselves if 2/3rds fault or the software goes wrong.

I’d advocate for some mechanism for ATOM holders to provide ATOMs to anyone who loses funds due a fault in the Peg.