Skip to content

Instantly share code, notes, and snippets.

@jtremback
Created January 6, 2021 00:30
Show Gist options
  • Save jtremback/3df2de95ab7f10bfcec936f5d8ce2980 to your computer and use it in GitHub Desktop.
Save jtremback/3df2de95ab7f10bfcec936f5d8ce2980 to your computer and use it in GitHub Desktop.

The blog post: https://blog.cosmos.network/sifchain-announces-peggy-cosmos-ethereum-cross-chain-bridge-eeb46a8f91db contains several factual inaccuracies that we would like to see corrected.

Inaccuracies

1. Incorrect use of "Proof of Authority"

The post incorrectly claims that Althea's Peggy uses "Proof of Authority" and that a "select set of pre-ordained validators" control the bridge. This is simply wrong. Peggy processes transactions signed by the current validator set on the Cosmos chain. The only entities that a user of Peggy must trust are the Cosmos validators. Using the terms "select set of pre-ordained validators" and "proof of authority" gives readers of this blog post a false impression of how Peggy works. If Peggy is "Proof of Authority", then the Cosmos Hub is also "Proof of Authority".

2. Misquoting our documentation about the inherent tradeoffs of Proof of Stake

The blog post includes a quoted paragraph from our documentation where we discuss the fact that 66% of the validators of any proof of stake chain control the assets secured by that chain, and if the value of assets secured by the chain exceed it's staking token's market cap, this could provide an incentive to attack the chain.

The blog post then makes the claim that Sifchain is somehow not vulnerable to this attack, while Althea Peggy is. The fact is that every Cosmos SDK chain (and every other PoS platform) is vulnerable to a 66% attack. Claiming otherwise misleads the reader.

Suggested corrections

We don't mind Sifchain comparing our two approaches, and we don't mind if they think their approach is better. It's arguable whether an official Cosmos blog is the appropriate venue for Cosmos projects to dunk on each other, but that's your editorial prerogative. We simply want the factual inaccuracies in this blog post corrected, and a notice of the correction placed on the post, as is normal practice in most publications. If you replace the 3 incorrect paragraphs quoted below with our suggested paragraph, this will correct the post.

Current incorrect paragraphs:

The difference in the two lies in their cryptoeconomic security model. Althea Peggy uses a Proof of Authority model in which users accept the credibility of a select set of pre-ordained validators that operate the Peggy bridge. A cross-chain transaction is verified if the pre-ordained validators declare it valid above a certain threshold.

Althea Peggy Documentation: Validators are fully trusted to manage the bridge. Validator powers and votes are replicated on the Ethereum side so trust in bridge assets depends entirely on trust in the validator set of the peg zone chain. This has known problems where the assets in the bridge exceed the market cap of the native token. We accept these known issues in exchange for the dramatic design simplification combined with acceptable decentralization this design provides. https://github.com/cosmos/peggy/tree/althea-peggy

By contrast, Sifchain uses a Peggy deployment with a Staked Threshold model in which Peggy validators stake collateral to secure the bridge and they are subject to slashing as per Tendermint consensus rules on both the Cosmos SDK chain and the Ethereum smart contract side of that bridge. This solves the aforementioned cryptoeconomic security issue on the bridge. In exchange for being subject to slashing, validators earn a service rate. Althea trades off trust minimization in exchange for simple design whereas Sifchain trades off simple design for maximizing trustlessness supported by cryptoeconomic incentives.

Suggested correction:

Sifchain uses a Peggy deployment with a Staked Threshold model in which Peggy validators stake collateral to secure the bridge and they are subject to slashing as per Tendermint consensus rules on both the Cosmos SDK chain and the Ethereum smart contract side of that bridge. In exchange for being subject to slashing, validators earn a service rate. Althea's Peggy uses slashing only within the Cosmos SDK module, giving the bridge security equivalent to the Cosmos chain it is running on.

Incorrect diagram

There is also a diagram which incorrectly associates the words "Proof of Authority" with Althea Peggy. If you simply erase "Proof of Authority" from this diagram, it will be OK.

@jkbrooks
Copy link

jkbrooks commented Jan 6, 2021

Hey @jtremback we're happy to clear this up as we don't want to dunk on anyone.

My understanding is that you're using a select set of validators to run Althea Peggy. That set of validators happens to be the same validators as the validators in the Cosmos Hub but the original vision of a peg zone is to use a different set of validators on a different blockchain that is connected the Cosmos Hub via IBC.

You start at the Cosmos Hub. You move Photons via IBC to the peg zone. The peg zone receives an incoming IBC packet: a message containing a transaction for sending Photons.

https://blog.cosmos.network/the-internet-of-blockchains-how-cosmos-does-interoperability-starting-with-the-ethereum-peg-zone-8744d4d2bc3f

A reason to have a separate blockchain is that it allows a unique validator set with its own separate staking collateral to provide cryptoeconomic security for the funds being pegged that is separate from the validator set of the destination chain and the collateral it staked for transactions internal to the destination chain.

In short, in general, pegs to PoW chains or any governless chains require overcollateralization.
Consensus-based peg collateralization requires the safe handling of +1/3 Byzantine faults, which means that some form of interchain staking is necessary. It isn't sufficient to slap a peg to Ethereum on the Cosmos Hub and require that all ATOM takers also stake on the Ethereum peg, because nothing is keeping the hub accountable in the case of +1/3 failure.

https://github.com/jaekwon/cosmos_roadmap/tree/master/shape_of_cosmos#token-pegging-to-pow

To elaborate, if Althea Peggy is deployed directly on the Cosmos Hub, Hub validators could be incentivized to censor correct cross-chain transactions or confirm incorrect cross-chain transactions without violating Tendermint consensus for intra-chain transactions and thus without being subject to slashing of separate staked collateral.

We go over this threat model and our proposed solution here https://docs.google.com/document/d/1pZjyQo4THIf-Y9NwZs3JDvUvw1UaBP353TXhn5OJb9w/edit#heading=h.iyqldg8jokar

We're always open to revisions and feedback but let me know your thoughts on the above.

@jtremback
Copy link
Author

jtremback commented Jan 6, 2021

To reiterate my point 1:

My main issue with the blog post is that it incorrectly states that Althea Peggy is "proof of authority", similar to fully custodial bridges such as xDai or WBTC. This is definitely not true, whatever the relative tradeoffs between our two approaches are. The use of the phrase "select set of validators" creates the impression that the bridge is custodial. It sounds like you are saying that Althea Peggy has custodians like xDai or WBTC. The phrase "select set of validators" isn't used by anyone anywhere else to refer to the validators on a Cosmos chain, and using it that way here makes it sound like Althea Peggy has custodians.

As for my point 2:

Althea Peggy's security is equivalent to the security of the Cosmos chain it is running on. Whether that chain is the Hub, or a designated peg zone, Peggy is as secure as that chain. Currently, your blog post talks about "cryptoeconomic security issue on the bridge". This creates the incorrect impression that there is a security issue with Althea Peggy, and quotes our documentation talking about a security issue that is present with any PoS system.

From your comment above, it sounds like you feel that Sifchain Peggy is MORE secure than the Cosmos chain it is running on. For your correction, you could state this clearly. You could explain why you think that it is a bad idea for a Cosmos chain alone to secure valuable assets, and explain how you think that Sifchain Peggy adds additional security beyond that provided by the underlying Cosmos chain. You can mention that Althea Peggy relies only on the security of the Cosmos chain.

I also just want to be clear that I don't have a problem with you writing about how you feel that Sifchain Peggy is the best. I have a problem with the mischaracterizations in points 1 and 2. I think you can explain why you feel that Sifchain Peggy is the best while also portraying Althea Peggy accurately.

@jtremback
Copy link
Author

Just to respond to your comment above:

To elaborate, if Althea Peggy is deployed directly on the Cosmos Hub, Hub validators could be incentivized to censor correct cross-chain transactions or confirm incorrect cross-chain transactions without violating Tendermint consensus for intra-chain transactions and thus without being subject to slashing of separate staked collateral.

If validators violate the rules of Althea Peggy, on the Cosmos chain, or on Ethereum, they are slashed by the Peggy module. We've just added the slashing code, so it's understandable if you missed that part of it.

Anyway, I'd love our teams to get on a call some time, just for fun, to compare our approaches. The variety of different approaches is a strength of the Cosmos ecosystem.

@jkbrooks
Copy link

jkbrooks commented Jan 6, 2021

If people can't distinguish between Althea Peggy and wBTC with "Proof of Authority" then we should just remove that term. We can do that imminently.

You could explain why you think that it is a bad idea for a Cosmos chain alone to secure valuable assets, and explain how you think that Sifchain Peggy adds additional security beyond that provided by the underlying Cosmos chain. You can mention that Althea Peggy relies only on the security of the Cosmos chain.

We can work on this but would need more time.

Anyway, I'd love our teams to get on a call some time, just for fun, to compare our approaches. The variety of different approaches is a strength of the Cosmos ecosystem.

That would be good, let's discuss more elsewhere

@jtremback
Copy link
Author

Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment