Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accounts can own multiple names which is forbidden by the BNS contract #1540

Closed
badonyx opened this issue Feb 7, 2023 · 4 comments
Closed

Comments

@badonyx
Copy link

badonyx commented Feb 7, 2023

API reports that this account owns 2 names

https://stacks-node-api.mainnet.stacks.co/v1/addresses/stacks/SP28NCDY6V4T7NJBMYGTJ55NHMXMC0GG806JW1ZTB

{
  "names": [
    "bc-6276751a883e8520.id.blockstack",
    "emanuele.btc"
  ]
}

Meanwhile the contract function resolve-principal only reports one associated name

(ok (tuple (name 0x656d616e75656c65) (namespace 0x627463)))

This results in inconsistencies like Gamma resolving to one name (.btc) and Tradeport resolving to another (.id.blockstack).

@badonyx
Copy link
Author

badonyx commented Feb 7, 2023

Revoked names also result in multiple names resolving as owned by an address (see #1502). Example:

https://stacks-node-api.mainnet.stacks.co/v1/addresses/stacks/SP1SHCAV24FGYN8CD8G4XHAGKRV69WFPKADBCH4GB

{
  "names": [
    "dailymail.btc",
    "nars.btc",
    "wimbldon.btc"
  ]
}

Update: Revoked names no longer resolve as of stacks-blockchain-api v6.3.4 (master:6d66c3cc)

{
  "names": [
    "dailymail.btc"
  ]
}

@badonyx
Copy link
Author

badonyx commented Feb 7, 2023

For the account in the top level comment, one of the names is I guess carried over from Blockstack in a way that I don't entirely understand; BNS contract does not have any registered_subdomain function, what does that mean?

Names carried over from Blockstack did not need to have an NFT minted which should be considered a bug to be fixed in the the next iteration of BNS. The resolution by the API of a name without an NFT should also be considered a bug.

https://stacks-node-api.mainnet.stacks.co/v1/names/bc-6276751a883e8520.id.blockstack

{
  "address": "SP28NCDY6V4T7NJBMYGTJ55NHMXMC0GG806JW1ZTB",
  "blockchain": "stacks",
  "last_txid": "0x2f079994c9bd92b2272258b9de73e278824d76efe1b5a83a3b00941f9559de8a",
  "resolver": "https://registrar.blockstack.org",
  "status": "registered_subdomain",
  "zonefile": "$ORIGIN bc-6276751a883e8520\n$TTL 3600\n_https._tcp URI 10 1 \"https://gaia.blockstack.org/hub/1EFUGLe28aJX11zs8fgqxmehdCSK7BzyEk/profile.json\n",
  "zonefile_hash": "c0999b5bd31a2e5b060439beb50345800ecdd09a"
}

@rafaelcr
Copy link
Collaborator

one of the names is I guess carried over from Blockstack

@0xbabo That's correct. When we boot an API node, we import old Blockstack v1 names into the new v2 tables. There are a lot of old subdomains imported during this process (a couple million IIRC), and some of them are owned by just one address. I think this is an artifact of the v1 chain but AFAIK wouldn't be possible to replicate from a v2 call to BNS to register a subdomain.

Names carried over from Blockstack did not need to have an NFT minted

Yep, also correct. It actually makes it very difficult to determine name ownership on API responses because we can't just look at the NFT tables.

@rafaelcr
Copy link
Collaborator

rafaelcr commented Mar 9, 2023

Closing this, feel free to reopen if you have further questions

@rafaelcr rafaelcr closed this as completed Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants