Integration

A DigiByte domain replaces an address when sending DigiByte or DigiAssets. If you want to integrate sending to a DigiByte Domain you must create this feature:

  1. Ask the user to type a DigiByte address or a DigiByte Domain in the sender textbox of the wallet.
  2. Test the textbox content against this RegEx /^(?!-)[A-Za-z0-9-]{3,64}(?<!-)\.dgb$/. If it matches, the text is a DigiByte Domain.
  3. Query DigiAsset Core (personal record or provided by us) for the DigiByte Domain DNS DigiAsset with this AssetID Ua7Bd7UVtrzavSHhpHxHZ2nzS2hGaHXRMT9sqy
  4. Query the last metadata available for the DNS asset in a IPFS node or endpoint.
  5. Search the DNS field of the metadata object for the domain and find which AssetID represent that name.
  6. Query once again DigiAsset Core for the AssetID found and find the unique holder.
  7. Use that address as a recepient of the transaction.

If you own an instance of DigiAsset Core you can use the RPC Method getdomainaddress. If a valid holder exist it will return the address string.

We provide a free API powered by DigiAsset Core:
https://digiassets.info/api/domain/{domain}
It will return an object with the result of your search { address } or { error }.

A JavaScript client-side library to convert a DigiByte Domain to an address is provided, but we highly encourage to implement this process in the backend of your project and consult your own trusted sources for DigiAssets and IPFS data.