[Rapid Grant] Router Protocol’s cross-chain bridge on Terra

Hello, everyone! Our team at Router Protocol recently submitted a rapid grant proposal to the grant committee, and we are thrilled to announce that after much deliberation they have approved our grant request. Before moving forward, we feel it is necessary to introduce our project to the Terra community. We would like to engage with the Terra community members and get their valuable feedback.

Section 1: Project Overview

Project Name

Router’s cross-chain bridge on Terra

Team Name

Router Protocol

What is the team’s long term vision for the project?

We, at Router, are committed to building a bridging infrastructure that facilitates interoperability between blockchains. Such an infrastructure will a) allow for a range of use cases that leverage and extend the composability of DeFi across various blockchains, b) promote liquidity migration and developer efforts towards various emerging chains and solutions and c) eventually lead to a thriving multi-chain ecosystem that will onboard the next wave of crypto users.

What is the problem that Router Protocol is trying to solve?

The crypto industry was built on a fundamental premise; the fragmentation and limitations endemic to traditional finance needed to be replaced with a better, more robust system with user needs at the heart of it. Unfortunately, even the crypto market is littered with fragmented liquidity pools and creating the infrastructure that bridges the gap between them is becoming increasingly important. With over 5,000 different cryptocurrencies on the market encapsulating trillions of dollars in value, there has never been a more pressing need for porting liquidity across them. As more institutional investors join the crypto space, the need for better efficiency and flexibility increases almost exponentially. At Router, we believe that the crypto industry does not have to suffer from the fragmentation seen in traditional finance.

What is your team’s proposed solution to the problem listed above, and how does Terra come into the picture?

To combat the problem of liquidity fragmentation, Router is building a host of cross-chain infra primitives that will allow seamless flow of liquidity across chains. Aside from connecting blockchains and enabling a free flow of information, Router will also enable token mapping in a decentralized environment.

With over $3B in liquidity and a large user base, Terra is one of the most popular blockchains in DeFi. To realize our goal of becoming a liquidity super-mesh, we need to deploy Router bridges on all the major chains, Terra being one of them.

Do you have a working product?

Router’s XCLP testnet is live here. It currently supports cross-chain transfers and cross-chain swaps between Kovan (Ethereum testnet) and Polygon testnet, and other chains will follow soon. For tokens with liquidity reserves on both sides of the bridge, transfers/swaps are almost instantaneous and require very low fees. For some tokens that do not have sufficient native ‘on-bridge’ liquidity on one or both chains, transfers/swaps might take a bit longer and cost a little more. Here the costs are primarily driven by the operations of the underlying AMM.

We also have a internal mainnet which is undergoing a security audit from Halborn. We have already completed a security audit from Certik, details of which can be found here. Since the security of cross-chain projects has been under scrutiny as a result of recent hacks, we thought it was prudent to get a second audit to cover all our bases.

Section 2: Project Details

High-level technical approach, product flow & architecture

Architectural Components

  • Bridge Contracts (ParaRouters): Every chain supported by Router Protocol will have a bridge contract known as ParaRouter deployed on it. The ParaRouter is able to lock a stablecoin and broadcast an event that can be picked up by the event listener associated with the ParaRouter.
  • Event Handlers: ParaRouter uses event handlers to handle different operations based on the calldata passed by the UI (ERC20 token transfer, ERC721 token transfer, arbitrary message transfers, etc.).
  • Router Nodes: XCLP maintains a set of router nodes that listen for events on the source chain, generate proposals for those events, and submit signed proposals on the destination chain as a vote. For a transfer to be accepted and sent across the bridge, it must receive enough votes to exceed a predetermined threshold.

Working

When users submit their asset on the source chain, they are converted to stablecoins and locked in the source chain’s ParaRouter. The conversion to stablecoins takes place using an aggregator contract that fulfills the swap using the DEX that offers the best price. If the user-submitted asset is a stablecoin itself, the asset is directly locked in the bridge contract. Following this, the ParaRouter reserve on the source chain emits an event to be received by the listener interface attached to the router nodes. Upon receiving the event, listener parses the event into a general bridge message and relays it to the router interface. The router interface forwards this message to the writer interface, which converts the message to a valid proposal and submits it on the target blockchain. Once a proposal is created on the destination chain, other router nodes sign the proposal. Once the voting threshold is achieved, an executeProposal call is initiated, which releases the funds from the destination chain’s ParaRouter reserve and credits it to the user’s wallet. In case the user-requested asset is not available on the destination chain’s ParaRouter, the ParaRouter uses aggregator contracts to convert the stablecoins to the user-requested asset on the target chain.

Router Testnet

  • Dashboard

  • Swap

  • Liquidity Mining

Road to Complete Decentralization

To ensure high throughput while maintaining protocol security, Router Protocol will initially operate under a trusted federation model, i.e. the validation mechanism will only be partially decentralized. However, in the spirit of DeFi, Router will eventually achieve full decentralization and trustlessness in a phased manner:

Phase 1 (Current version) - The validators are selected via a Proof-of-Authority mechanism wherein they are required to stake $ROUTE tokens (Router Protocol’s native currency). To curb any kind of malicious behaviour, validators are required to stake $ROUTE in value equal to the protocol’s AUM. Any validator having excessive downtime or engaging in any kind of malicious activity will be penalized by having a portion of their staked $ROUTE slashed.

Phase 2 (4 - 6 months) - Validator selection will move to a Delegated Proof-of-Stake (DPoS) mechanism. More validators will be added to the network and a Multi Party Computation (MPC) system will be set up to validate transactions.

Phase 3 (8 - 12 months) - Router will build and host a dedicated chain (tendermint consensus) to host the aggregator infrastructure. Consensus for all cross-chain transactions will be achieved on this chain.

Section 3: Ecosystem Fit

How will this project be integrated with Terra?

First, a custom bridge contract will be coded for the Terra chain. Since Terra is not EVM compatible, we will not be refactoring our code from the Ethereum bridge contract. We will have to custom-code the contract from the ground up. After rigorous testing and audits, we will launch a Router bridge between Ethereum, Polygon and Terra. Router bridges on Solana, Avalanche and Arbitrum are also in the pipeline. After the launch of the bridge, we will be able to allow for seamless communication between Terra and other blockchains.

How can the project benefit Terra Network’s ecosystem?

  1. Router’s dedicated liquidity reservoir, Dfyn AMM has a large community of users on Polygon. Even without a direct bridge between Polygon and Terra, we had an ATH of $80 million in UST liquidity. With a direct bridge between Polygon and Terra, much more liquidity can flow between these two chains.
  2. One immediate application of Router Protocol is its ability to enable cross-chain swaps in addition to cross-chain transfers. Basically, users will be able to swap any token on chain A to any other token on chain B.
  3. Router will enable token mapping across all chains that are a part of its network. This will enable more and more projects to map their tokens on Terra and start their operations there.
  4. Router will eventually launch its SDK to allow other DApps to plug into its infrastructure:
  • DEXes will be able to build on top of Router to allow cross-chain swaps for users.
  • Asset management applications will be able to use Router Protocol to power the bridge on their UI.
  • Wallet applications will be able to use Router to enable the direct transfer of funds to other blockchains from the wallet itself.

Section 4: Team

Core Team

  • Ramani Ramachandran (CEO & Co-founder)

    MIT, Deloitte, Moody’s, Schlumberger; In Crypto since 2014, built and ran Asia’s earliest crypto fund, returned 4x; Built Fordex - the world’s first stablecoin DEX; Qume, an institutional grade crypto exchange; Launched Asia’s first crypto-index token

    Email: [email protected]
    LinkedIn: /in/ramaniram/
    Twitter: @CrypoMan_Ram

  • Shubham Singh (CTO & Co-founder)

    Full-stack Developer and Technical Architect building in crypto and blockchain since 2016; Built a crypto-index (108token) as well as Fordex - the world’s first stablecoin DEX

    Email: [email protected]
    LinkedIn: /in/dev-shubham
    Github: ss-sonic

  • Harsh Patel (Chief Solutions Architect)

    Researcher and Architect building in crypto since 2014. Theorized the concept of DEX in FC2014. Proposed and developed a blockchain scaling solution based on capacity.
    Email: [email protected]
    Github: 18dew
    Google Scholar: Harsh Patel

  • Chandan Choudhury (Co-founder)

    Head of Strategy at Bitpolo, leading Indian crypto exchange; Veteran trader and advisor across asset classes spanning over 15 years. Energy trader at Futures first; Managed crypto fund, generating 4x returns; Head of Ops & Market Research at Tradelab

    Email: [email protected]
    LinkedIn: /in/chandan-choudhury-3b748a23/
    Twitter: @cchoudury

  • Monica Durga (Technical Architect)

    Full-stack Developer and Technical Architect building in crypto /blockchain since 2016; Built 108token (Asia’s first crypto index token) and Fordex, the world’s first stablecoin DEX with 0x grant; Worked on matching engine for crypto derivatives platform

    Email: [email protected]
    LinkedIn: /in/Monica-durga/
    Github: sudomon

  • Priyeshu Garg (Co-founder)

    Engineer/Growth hacker/Product Manager; Technical Advisor @ Umbrella Network; Software Engineer @ Ola; Journalist @ Cryptoslate & @ 8BTC

    Email: [email protected]
    LinkedIn: /in/priyeshu/
    Twitter: @priyeshugarg

Key Advisors

  • Surojit Chatterjee (Chief Product Officer, Coinbase)

    Surojit Chatterjee is a former Head of Product for the Indian e-commerce giant Flipkart and served as VP of Product at Google until the beginning of 2020. Last year, Chatterjee joined Coinbase, where he serves as the Chief Product Officer. While his investment in Router is in a personal capacity, it clearly resonates with his professed goal of using Coinbase as an enabler to deliver economic freedom to everyone.

  • Gokul Rajaram (Product & Business Helper, DoorDash)

    Gokul Rajaram is often referred to as the Godfather of Google AdSense, and has headed product development at companies such as Facebook and Square subsequently. In addition to his role on the board of Coinbase, Rajaram is also on the board of consumer-focused unicorn Pinterest.

Section 5: Development Roadmap

Core Product Development Timeline

In bold → Milestones
T0 → the start of the development

Task Deliverable Team member(s) involved Estimated Completion Time
1. Planning the architecture of our bride contract to suit the Terra ecosystem. The goal of this step is to simplify the development process. A clear architecture depicting the business logic of the smart contract and product specs for mapping out a path for developers to follow during the coding process. Shubham Singh and Harsh Patel T0 + 5
2. The bridge contract will be coded from the ground up since Terra is non-EVM compatible. The contracts will need to be coded in Rust instead of Solidity. Well compiled bridge contract compatible with Terra testnet. Shubham Singh and Harsh Patel T0 + 21
3. Adding test cases to the ParaRouter contract, performing rigorous manual testing and deploying the ParaRouter contract on Terra testnet. Working smart contract free from major bugs and issues deployed on Terra testnet. Shubham Singh and Harsh Patel T0 + 28
4. Router node (the bridge that enables the communication between different ParaRouters) config will be updated to enable transfers between Terra and other blockchains. Support for cross-chain transfers between Terra testnet and other testnets. Harsh Patel, Siva Ganesh (Senior Blockchain Engineer at Router Protocol) T0 + 35
5. Integrating the bridge contract with the testnet UI. Updated UI for the community to test cross-chain transfers between Kovan, Polygon testnet, OKExChain testnet and Terra testnet. Mayank Rawat (Front-end Engineer at Router Protocol) T0 + 42
6. Integrating the bridge contract with TerraSwap to add the swap functionality to the contract. Updated testnet bridge contracts supporting swaps between Kovan, Polygon testnet, OKExChain testnet and Terra testnet. Shubham Singh and Harsh Patel T0 + 49
7. Building Router analytics. An analytics engine to monitor on-chain stats. Siva Ganesh T0 + 49
8. Recording all the transactions while testing on test-net, analyzing results of all transactions with actual business logic of smart contracts. Stats detailing the reception of the testnet by the community, points to address, etc. Siva Ganesh T0 + 56
9. Unit testing and smart contract audit by a third party followed by bug fixes and code optimizations. Optimized smart contracts supporting cross-chain transfers and swaps, ready for deployment on Terra mainnet. Harsh Patel and Siva Ganesh T0 + 63
10. Deployment of bridge contract on mainnet. Router bridge contract deployed on Terra mainnet, supporting cross-chain swaps and transfers between Terra and other blockchains. Harsh Patel and Siva Ganesh T0 + 63

Specification of the software or deliverable (will be used to confirm milestones have been reached), and the cost involved in each milestone

  • Deliverable from Milestone 1: Terra-compatible ParaRouter contract

    The first phase of the project will involve coding Router’s ParaRouter contract in Rust. This contract will be responsible for interacting with the bridge (Central Router) that connects multiple blockchains.

    ETA: 3 week from the start of development
    Full Time Equivalent (FTE): 0.8
    Costs: $16,000

  • Deliverable from Milestone 2: Router’s bridge supporting Terra testnet

    The second phase of the project will involve deploying our ParaRouter contract on Terra testnet that will allow transfers between Kovan, Polygon testnet, OKExChain testnet and Terra testnet.

    ETA: 3 week from the attainment of the first milestone
    Full Time Equivalent (FTE): 0.6
    Costs: $12,000

  • Deliverable from Milestone 3: Swap functionality in the Router testnet

    This phase will involve the integration of TerraSwap on Terra with Router’s bridge contract. At the end of this phase, users will be able to swap assets on Polygon testnet and Kovan directly from Terra’s testnet.

    ETA: 1 week from the attainment of the second milestone
    Full Time Equivalent (FTE): 0.2
    Costs: $4,000

  • Deliverable from Milestone 4: Router’s cross-chain bridge on Terra mainnet

    The fourth phase of the project will involve testing the ParaRouter contract, getting it audited and then finally deploying it on Terra mainnet. The deployment of the Router bridge on Terra mainnet will enable the movement of liquidity from Ethereum and Polygon to Terra.

    ETA: 2 weeks from the attainment of the third milestone
    Full Time Equivalent (FTE): 0.5
    Costs: $10,000

Total estimated duration and cost of the whole project

Estimated Cost: $42,000 + Audit Costs
Estimated Duration: 8-10 weeks

Reporting Obligations

To facilitate transparency, our team will provide brief progress reports for the work done at the completion of each milestone. To ensure a smooth collaborative experience, a telegram/discord channel will be set up for integrations and project discussion.

Section 6: Additional Resources

1 Like

The committee discussed this proposal thoroughly and decided to approve a Rapid Grant of $42,000 UST. Pros and cons identified for this proposal are summarized below.

Pros

  • Router Protocol will allow cross-chain transfer of Terra assets, with a specialization on stablecoin transfers.
  • Already has a functioning prototype running on testnets.
  • Clear roadmap and milestones
  • Asked amount is reasonable

Cons

  • Strong competition from other cross-chain solutions, such as IBC, Wormhole, and THORChain. At this early stage, it is hard to predict whether Router will be successfully in the long run.
  • Fragmentation of liquidity. For example, if Router and Wormhole both connects to Ethereum, most likely they will have their own version of wrapped UST there. The two wrapped coins will compete for liquidity and may cause confusion for users.
  • New attack vectors. As liquidity will be locked in Router smart contracts, there is a non-zero probability that the contracts may contain vulnerabilities and exploited.
  • Concerns over decentralization. As Router will use its own validator set, assets locked in the protocol are not protected by Terra validators. Certain security and design choices over this are still unclear, e.g. how validators are chosen and what incentives will be applied to ensure they behave honestly.

Further comments

  • Although there are already a few other cross-chain solutions coming to Terra, we believe users will always benefit from more choices and competitions between protocols.
  • Router is committed to train CosmWasm developers and deploy smart contracts on the Terra blockchain. Considering competent CosmWasm developers is a highly scarce resource, we believe these new developers introduced to Terra through Router will have broader benefits beyond the protocol itself.
2 Likes

Hello,

I hope you are well. We have not heard from you since your grant was approved by the committee. What is the status of this project?

Thank you!

1 Like

Hello,

Me again, any updates on this protocol?

Thank you!

Hey @somethingelse ! Due to certain security considerations, we had to delay our mainnet launch between EVM chains. That’s why we are running a bit late on the Terra front. As for the current status, the Terra contracts for the Router bridge are coming along quite well. Infact, we have already started talking to audit firms to audit our CosmWasm contracts.

Hey @Vatsal thanks for the quick response and apologies for the delay in response on my part. I appreciate the update. So it sounds like it is safe to say we will not be seeing Router Protocol on Terra for a few months given the massive cost and lead time that process takes.

May I ask that you fulfill the following obligation in full:

Hi @Vatsal,

Hope you are well. Did you get a chance to see my last message from 15 days ago? Would love a response.

Cheers!

Somethingelse

Hey @somethingelse, pardon me for the lateness of my reply. As far as the reporting obligations are concerned, I would be happy to share a progress report delineating the current status of our undertaking. Let me share the report by April 11th (Monday).

As promised, here you go @somethingelse :
Router Terra Integration Report (April 2022).pdf (1.1 MB)

Thanks & Regards,
Vatsal

2 Likes

Very professional and thought out update, I truly appreciate this and look forward to more updates!

1 Like