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

`/v1/names/{name}` does not reflect buying usernames from bids on marketplaces

Open pradel opened this issue 1 year ago • 1 comments

Describe the bug

I am not sure if this is a bug or intended behaviour. Creating the issue to open discussion regarding the behavior of the /v1/names/{name} endpoint.

Problem: When buying a new .btc domain via a bid from a marketplace, the /v1/names/{name} seems to return outdated data.

The https://stacks-node-api.mainnet.stacks.co/v1/names/dayslikewater.btc endpoint, return the last_txid field with the transaction that registered the name. In the payload, we can see that SP1TY00PDWJVNVEX7H7KJGS2K2YXHTQMY8C0G1NVP is the current owner of this name (which is correct), but the last_txid explorer link point to a transaction made by SPP117ENNNDQVQ1G3E0N1AP178GXBTC2YNQ3H7J. SPP117ENNNDQVQ1G3E0N1AP178GXBTC2YNQ3H7J is the account that bought the username at the beginning and then sold it to SP1TY00PDWJVNVEX7H7KJGS2K2YXHTQMY8C0G1NVP.

Shouldn't this endpoint reference the bid transaction in the last_txid result as the owner changed in this process?

Expected behavior

The https://stacks-node-api.mainnet.stacks.co/v1/names/dayslikewater.btc endpoint should return the last last_txid when the name was transferred to the new account.

pradel avatar Jul 13 '22 12:07 pradel

~~This looks to be related to https://github.com/hirosystems/stacks-blockchain-api/issues/1176 which is blocked by an issue on the Stacks blockchain itself~~

rafaelcr avatar Aug 02 '22 16:08 rafaelcr

Related to #1287

rafaelcr avatar Aug 29 '22 14:08 rafaelcr

@pradel can you share the explorer link for the transaction that transferred this name via marketplace bid?

I think what's happening is that the API is only programmed to detect name-transfer events initiated by calling the BNS contract directly as opposed to those made through other contracts. It could be a simple fix but I'd need to see the original tx.

Thanks

rafaelcr avatar Aug 29 '22 14:08 rafaelcr

@rafaelcr I think this is the transaction https://explorer.stacks.co/txid/0xa75ebee2c824c4943bf8494b101ea7ee7d44191b4a8f761582ce99ef28befb19?chain=mainnet

pradel avatar Aug 29 '22 14:08 pradel

Thanks for the quick response @pradel

rafaelcr avatar Aug 29 '22 14:08 rafaelcr

:tada: This issue has been resolved in version 5.0.0-beta.5 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

blockstack-devops avatar Aug 31 '22 17:08 blockstack-devops

:tada: This issue has been resolved in version 5.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

blockstack-devops avatar Sep 07 '22 13:09 blockstack-devops

:tada: This issue has been resolved in version 7.0.0-stacks-2.1.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

blockstack-devops avatar Dec 21 '22 14:12 blockstack-devops