Skip to main content

Domain Node

Soroban Domains' protocol keeps records of domains and the addresses related to them, but to do that the protocol needs to know how to generate an ID that represents a domain, and to do that, it generates what we call a "node ID".

A node is just BytesN<32> value generated from the TLD and the domain, this means that a single change in one of the letters will generate a completely different node, and thanks to that we can safely keep records of each domain.

How is a "node ID" generated?

This ID is generated by using the keccak256 hash function on each section of the domain in the next way: hash(hash(TLD) + hash(root domain)). Later if we want to save a subdomain of the domain, we take the generated hash and use it with the subdomain like this: hash(hash(parent node ID) + hash(subdomain)).