While work on Phase 3 of the Stacks 2.0 is ongoing, we have some exciting updates to share with you! Not only did we revamp the entire Blockstack documentation (it’s an absolute must-see! ), we also worked on a developer preview release of the Stacks Blockchain API .
This API provides a scalable access to the Stacks 2.0 network, making it easy to build:
- Dapp integrations, by receiving updates for user transactions or calling smart contracts
- Wallet integrations, by fetching updates for Stacks accounts
- Exchange integrations, by accessing and broadcasting blockchain transactions
For reference, the Stacks Blockchain API was built to maintain pageable materialized views of the Stacks 2.0 Blockchain. It is different than the Stacks Node as the main purpose of the API is to enable performant, advanced querying. A Stacks Node, on the other hand, is optimized for network participation.
This project consists of a NodeJS server that exposes a RESTful JSON API, making it easy to host, extend, and integrate with your product. Blockstack PBC currently provides a hosted version of the API to power projects like the Stacks 2.0 Explorer. Despite being in the early stages of its development, we are already seeing community members building projects with this API, including an implementation of the Rosetta specification.
We eagerly anticipate what you’ll build next with this API. The opportunities for exciting features and new business models are limitless! Imaging a dapp that enables premium features only for users that hold specific tokens (see the “Proof of HODL” concept Friedger showcased recently). This is just one example of how you might use over 20 endpoints now available in the Stacks Blockchain API.
To spark your imagination - here are a few endpoints dapp developers will likely benefit from:
- Make a contract call for a read-only smart contract function
- Get all events generated by a contract
- Read the datamap inside a smart contract
Note: Keep in mind that the Stacks 2.0 Testnet will reset every few days (as described in this forum post). This means STX addresses, balances, contracts, and transactions will become unavailable after some days on the Testnet. We intend to announce any chain resets at least an hour ahead of time on Discord, in the stacks-2-testnet channel . You can also check the Testnet status on this page.
The goal of this developer preview is to get your feedback. So please, take a minute and :