Stacks Rosetta API

We’re excited to announce the beta release of a new, Rosetta-compatible implementation for Stacks 2.0. Stacks is an open-source network that enables developers to build secure apps and smart contracts on Bitcoin. Stacks inherits Bitcoin’s security through an innovating mining technique called Proof of Transfer, and supports smart contracts with the Clarity Language. In our efforts to standardize the tooling and make the integration more seamless, Stacks became an early supporter of Rosetta Specifications.

We’ve integrated the Rosetta data and construction APIs with our existing RESTful API service, targeting the 1.4.6 spec. The implementation is in Typescript, and is fully specified in OpenAPI 3.0 format. At present, the construction API supports token transfer-related operations, and we aim to add support for smart contract operations with the new /call interface in the near future.

We have a docker image set up that packages the Stacks node, and our API server package, and can be used to either run a local mocknet for development, or connect with the existing testnet:

$ docker build -t stx-rosetta:stable https://raw.githubusercontent.com/blockstack/stacks-blockchain-api/master/stx-rosetta.Dockerfile
# other options for STACKS_NETWORK are: dev (local development),
# mocknet (same as testnet), and mainnet (will work when it is launched).
$ docker run -d -p 3999:3999 --mount source=rosetta-data,target=/data \
    --name stx-rosetta -e STACKS_NETWORK=testnet stx-rosetta:stable

After syncing with the blockchain, you can perform queries by using the rosetta-cli tool, or by hitting the API endpoints. Sample configuration files for rosetta-cli are in the repository, and the API documentation (including Rosetta endpoints) is at https://blockstack.github.io/stacks-blockchain-api/

New blockchain platforms, with unique and exciting capabilities, are released to developers very frequently. While exciting, many have diverging visions and differ significantly on an architectural level, making it very difficult to integrate with exchanges, wallets, decentralized apps, or other projects. Integration work requires in-depth understanding of the principles and designs of each platform, which is time-consuming and sometimes even impossible without changes to the platform itself. Rosetta is designed to help with this, giving us a set of explicit design choices, and tooling, to enable simpler, faster, and more reliable blockchain integrations.

The Stacks ecosystem is excited to support the Rosetta specification and contribute to an even more collaborative and cooperative blockchain and crypto industry.

3 Likes

Couldn’t have said it better myself! Welcome to the Rosetta community!