Holochain Forum

Having a main chain for a holochain DAPP

Let’s say I want to have agents, but then I want to have an agent registry where they can update their current IP address and other “app level” data. What would you assemble this architecture? Like let’s say there is a mainchain that is 6GB, and each node only needs a few MB of data that they control, how would you create this? I was just wondering if this would need to be a centralized backend, or could you have a more traditional blockchain that maintains app level data, and use holochain for the agent-centric architecture? It would be really nice if there was interoperability between these two layers as well.

Hello, and welcome to the weird world of Holochain development :wink: We’ve found that most things can be modelled without a ‘main chain’ of any sort. Even things that require a central registry can often be done without a main chain. The big question to ask is:

  • Can each member safely update their data without causing conflicts with other members’ data?

If the answer is yes, then it’s really easy and no consensus is needed. If the answer is no, it’s a bit tricky but still possible to do without main chains. Global ledgers or main chains (e.g., blockchain) aren’t necessary for collecting data and making it accessible in a central place; they’re only for getting global agreement on what hasn’t happened — this is mostly related to enforcing uniqueness (you can’t double-spend a token, no two people can register the same domain name or hold title on the same piece of land, etc).

There are simpler solutions for making data discoverable. To use your example, of agents advertising their most recent IP address, there’s no need for global consensus on uniqueness of IP addresses. If two people claim the same IP, that probably just means they’re using the same computer. So they just commit the new record to their chain, publish it to the DHT, and make it easy for others to find it.

There are different ways to do this, but they all look pretty much the same. On the unstructured DHT, which is just a big pile of data, there’s a special type of metadata called a ‘link’. It’s attached to one piece of data and points to another. Here’s an article about it:

And some design patterns related to the idea:

Note that none of these patterns guarantee uniqueness; they just let people make claims. In the example in link #1, it would be perfectly okay for two people to register the username @alice_ukulele.

If you need uniqueness guarantees in your data, it would be easy to drop in an ‘authority’ node who holds a ‘main chain’ of unique tokens and transactions. And this piece of centralisation might be appropriate for certain use cases. But it’s also possible do it without centralisation. That is another story though… for another time :slight_smile:

Let me know if this is clear to you and if you want help understanding certain concepts. I kinda took you on a deep dive here :grimacing:

1 Like

thanks for the thorough response, this was really helpful. I’ll take some time to dig into the design patterns you recommended, and follow up with any questions. Again, thanks for the thorough response!

1 Like