stacks-blockchain-api icon indicating copy to clipboard operation
stacks-blockchain-api copied to clipboard

add support for BNSv2

Open rafaelcr opened this issue 1 month ago • 1 comments

This issue will track any and all efforts to support BNSv2. For now, we will start with an analysis of technical viability and basic tasks that will need to be undertaken to start supporting the new domain names.

rafaelcr avatar Oct 29 '25 21:10 rafaelcr

Here's an initial breakdown of tasks that would need to be undertaken to support BNSv2:

1. Mark previous BNSv1 endpoints as deprecated without removing support.

This allows devs to migrate away from v1 at a reasonable pace.

2. Create new DB tables to track names, namespaces and owners.

This will allow us to respond to API endpoints quickly and even add retroactive support for names in existing endpoints (i.e. provide a BNS name instead of a Stacks address in the URI).

Since this is a schema change, exchanges and other partners would need to be notified. IMPORTANT: This would be a breaking change to the API because adopters will require a genesis sync / TSV replay to backfill existing BNSv2 data we have not yet indexed. It will generate API v9.x. Partners may be reluctant to adopt it quickly because of this.

3. Add a specialized handler which tracks name mints, burns, and transfers originating from the BNSv2 contract.

The BNSv2 contract emits print events with every name or namespace change, so we will need to index these. This would be part of the block ingestion process we have already in place and would need to be load tested to make sure we're not affecting current index block times. All indexed data will be written to the new tables mentioned before.

4. Create API endpoints to consume the new names.

Endpoints could include namespace lists, name holders, name transfer history, etc. These would need to be mapped out taking the most requested use cases into consideration.

5. Update the API client libraries to reflect these changes.

The client library will need to be adjusted to use BNSv2 names either in new functions or replacing the existing ones.

6. Update API documentation.

OpenAPI spec will need to be updated, and new sections added to our Docs reflecting the change and the eventual BNSv1 deprecation.

7. Perform load tests.

Load tests will need to be added to exercise the new BNS endpoints.

8. Deploy comms with the launch

Not related to technical work but we will need to be coordinated on this as well.

rafaelcr avatar Oct 30 '25 23:10 rafaelcr