GuidesAPI Reference
DocumentationLog In

JSON-based RPC protocol

When working on this API, we considered many interface specification formats that have gained popularity in recent years (like Protobuf + gRPC and Avro) but found most only had strong support for a few programming languages, required users to have enough programming experience to know how to use autogenerated code to encode/decode some binary format, and/or didn't work well in the browser.

The Rosetta API is specified in the OpenAPI 3.0 format (the successor to Swagger/OpenAPI 2.0). Requests and responses can be crafted with autogenerated code using Swagger Codegen or OpenAPI Generator (with the downloadable JSON spec at the top of this site), are human-readable (easy to debug and understand), and can be used in servers and browsers. Using JSON incurs some performance penalty, however, we have found the challenge of robust integration to be a much more painful issue than mitigating the performance overhead of JSON.

Due to the complexity of requests (which can often contain a number of parameters of unspecified size), all communication with the Rosetta Interface Server utilizes HTTP POST requests. This makes the interface much closer to JSON-RPC 2.0 with the exception that requests go to specific paths instead of using methods. If you have used gRPC, it will feel very familiar.