Technical FAQ (Butterfly Protocol)

Sergio Verdugo
Bproto Labs
Published in
3 min readAug 28, 2021

When we were immersed in an exciting discussion inside our newly launched telegram group, we were asked some really interesting technical questions which we have transformed into a FAQ in this medium article. Developers will definitely want to know these features and the ways we overcome potential obstacles. As you all know, Cortex and Escrow Protocol will leverage this insane technology in their platforms.

How is the IPFS/DNS resolution done in Butterfly domains?

It does happen on-chain. Each domain has a flexible and expandable attribute system that is a mapping of a 32byte key to a 32byte value. For the main functionality currently, clients look at attribute 0x0 where an IPFS CID (Content ID) is stored.

That CID points to a folder with the static site for its basic usage. There are some extra files you can add to that folder though that do things like set custom NFT metadata and in the future set traditional DNS records. This means we have one hash stored on-chain that points to a configuration folder in IPFS which contains a default static site and all standard config a client needs.

When attributes change they emit an event that can be indexed and preprocessed with services like thegraph.com or read directly from the chain.

The attributes can also be permanently locked which means they can have the NFT metadata set then locked and be used as a fully interactive NFT with a domain and site.

How do we address possible central points of failure?

The data needed for name resolution is all decentralized. The mapping happens on-chain and the records are all stored on IPFS.

We do run services to simplify access but those services can be run locally, redeployed on other servers, and configured to use any IPFS node.

Parts of the clients are currently open-sourced and those that aren’t will be as time permits.

The process for resolution is pretty simple though and can be done without special libraries and just access to an Ethereum and IPFS node:

1. Hash the domain using name hashing

2. Query chain or index for IPFS CID

3. Either redirect to a static site on IPFS or read JSON data from IPFS for advanced data.

More open-source clients and tools will be coming with time as we integrate with clients.

Why have there been problems with gas fees when interacting with the app?

As mentioned Metamask has a bug that sets the gas limit way, way higher than needed. We will address that especially when we focus more directly on end-user. Right now we are working with partners like Cortex to make fully owned TLDs more useful and onboard people.

We are also building out cross-chain functionality where all domains under a TLD will be managed by a specific chain. This is being done with several partners like Cortex on Polygon and Xinfin for full integration with their chain.

The details for cross-chain support are being ironed out but the general approach is that an attribute will be set in Ethereum pointing everything to a lite weight child contract on the other chain. The rest of the lookup process is handled by the different clients.

Our Socials

Telegram- https://t.me/bproto_org
Twitter- https://twitter.com/bproto_org
Discord- https://discord.gg/R29V5zA7
Twitch- https://www.twitch.tv/bproto_org
YouTube- https://www.youtube.com/channel/UCpie6yKcycoYLjLZIpJe70Q

--

--

Sergio Verdugo
Bproto Labs

Bproto co-founder. Spanish guy with a strong passion for crypto.