Skip to content

ENS resolution at localhost not working with default resolver for resolver-options #486

@NoahMaizels

Description

@NoahMaizels

The problem: ENS resolution doesn't work at localhost for current default resolver-option RPC

The current default resolver for resolver-options is set to https://cloudflare-eth.com/. This works for bzz.link and eth.limo, but does not work for localhost.

So these resolve properly and load my website when using the default cloudflare:

https://<your-hash>.bzz.link/
https://<your-hash>.swarm.eth.limo/

But when I try at localhost it doesn't work:

http://localhost:1633/bzz/<your-hash>/

This is the error it shows:

{"code":400,"message":"invalid path params","reasons":[{"field":"address","error":"invalid name or bzz address: 1 error occurred:\n\t* failed parsing CID echinopsis.eth err invalid cid: selected encoding not supported: could not parse\n\n"}]}

After looking into it, supposedly the issue is that when registering the content hash I shouldn't be using the Swarm hash, but rather a properly encoded EIP-1577 contenthash. However this cannot be done through the app.ens.domains/ app as it shows an error when you try, and when trying to do it through etherscan and interacting directly with the contract, I got a transaction cost estimate of over 100 dollars (and I don't think we want users needing to do that anyway even if it was cheaper).

So when I tried a few other RPCs, I found a few which worked and others which didn't:

These worked:

https://mainnet.infura.io/v3/<your-api-key>
https://eth-mainnet.public.blastapi.io

These did not:

https://cloudflare-eth.com/ (currently the default used in Swarm Desktop)
https://rpc.ankr.com/eth

Proposed solution

I would recommend 2 changes:

  1. Changing to a trusted public RPC which allows proper localhost ENS domain name resolution.
  2. Also making the resolver RPC changeable through the Swarm Desktop UI (in case the default one does not work for whatever the user is trying to do or if the default one goes down or otherwise changes how it works), currently you can only change it by navigating to the Swarm desktop config.yaml in your filesystem. In fact the resolver is shown already in the settings, it just isn't editable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions