Rosetta API for Cosmos SDK
Note: The Cosmos ecosystem is constantly growing and expanding. This article’s content is now outdated. For the latest content, see Integrating the Rosetta API in Cosmos Blockchains and https://cosmos.network/.

Introduction
In the blockchain space, as well as in other industries that rely on operational processes and exchange or sharing of information between different systems, having a set of Interoperability standards is key to building solid and foundational protocols.
Rosetta API, an open-source specification and set of tools developed by Coinbase, makes integration with blockchains simpler, faster, and more reliable by establishing a standard API for integrating blockchain applications.
By using a common interface that standardizes the process of how a user interacts with a blockchain, both the work of exchanges to integrate with new blockchains and also of the developers to build cross-blockchain applications such as block explorers, wallets and dApps is considerably reduced.
With IBC about to be enabled following the imminent Stargate upgrade and a vision of interconnectable blockchains on the horizon, Tendermint Engineering has been working on an initial implementation of Rosetta API for Cosmos SDK to enable applications to make blockchain data available through endpoints compliant with the standard proposed by Coinbase.
What does this mean for the Cosmos ecosystem?
The Rosetta API implementation allows:
- Exchanges to seamlessly integrate new blockchains that run Rosetta API without any additional developer effort.
- Cross-blockchain Apps like block explorers, wallets, and dApps to be built more easily and to have a faster onboarding integration
Tendermint team is excited to release the Rosetta API MVP, which we initially designed to support the Cosmos SDK Launchpad, and we invite the entire Cosmos community to test and provide feedback.
How can it be executed?
We have created a solution thinking broadly to be used in different use cases. The simpler one is to execute the standalone application that will communicate with a running node, preferably locally (but not enforced). But we know that some applications would prefer this service be embedded into their own application binaries. That is why we have abstracted the service in the code to provide the option to be instantiated via code. You can take an example reading the main.go in the repository.
Instructions
How to install the Rosetta API Standalone gateway
- Clone the repo
$ git clone -b v0.1.1 https://github.com/tendermint/cosmos-rosetta-gateway
2. Install the tool:
$ cd cosmos-rosetta-gateway
$ make install
3. Make sure you GOPATH is set, then execute:
$ crg --help
Testing the API
Requirements:
Any chain that uses the Cosmos SDK version 0.39.1 should work. (If not please open an issue). We will use Starport tool to scaffold and run a blockchain application and test against it. Here we go!
- Create an application:
$ starport app github.com/jgimeno/blog
$ cd blog
$ starport serve --verbose
These 3 commands should initiate a blockchain to run on your machine.
2. Look for flags:
- -prefix: This flag is important, as not every cosmos blockchain uses the default “cosmos” prefix. For example, for IOV blockchain we would use `-prefix star`.
- -blockchain and -network: These flags allow you to change the name of your blockchain application and the network name. These values are used by Rosseta in the network’s list endpoint. For example, for Bitcoin you would set ` — blockchain bitcoin — network mainnet`.
- -app-rpc and -tendermint-rpc: As default this point to localhost:1317 and localhost:26657. But you can put the endpoints that you need for testing. Remember that in Rosetta’s spec is mentioned that they should not talk with an external service when packing it to a Dockerfile.
- -port: By default the Rosetta service listens on 8080, use the one that works better for you.
3. Execute the application:
$ crg
If everything went well we will have our service listening at port 8080.
Pulling Data
On top of the endpoints that are documented in the official Rosetta site, we have prepared a basic Postman collection in order to help with testing and using the endpoints, that you can find here. Link.
Conclusion
The vision of Cosmos has always been to become a major part of the Interchain, a network of interoperable and scalable blockchain token economies. With Rosetta API, the integration of new blockchains and cross blockchains apps becomes a much easier experience for developers as it’s standardizing operations that allow different systems to better work together.
Also, with the upcoming Stargate upgrade, we will be expecting Exchanges to be able to use IBC as a way to simplify listing. Link.
Today, we are happy to provide the first Rosetta API MVP for the community to be able to test and to integrate into their apps. As this is the first release, some things are still pending and will be added with the upcoming integrations.
For now, we have added support for Cosmos Launchpad chains and MsgSend transaction types.
We would love to receive feedback! Don’t hesitate to contact us in the dedicated Cosmos discord channel.