I am trying to create a tree-based token structure using ASA’s. What I mean is that we have NFT’s that have children, and they also might have children. Such structure should allow disconnecting a child ASA from its parent and create two tree structures.
At the first sight, an ASA has very little facilities for this. We need the parent to be able to store a list of its children or at least a pointer to another address (algorand app) that contains those children, and each child ASA also has to have a pointer to its direct parent (the tree should be traversable from the leaves to the parent as well). What I just said requires each ASA to have two mutable address pointers.
What do you suggest for this?
At first glance, I would look into the note field itself on an asset config transaction as an option of a “pseudo” mutable address pointer. Second, to that, you could use the reserve address field pointing to maybe an escrow account of an app that defines further information.
You could also use the means of Creator = Manageraddress = connected to parent creator != Manageraddress = disconnected from parent. Well, that would need some clarification in the front end an explorer or something.
Do you have specific needs regarding the generation process through the parent/child relation?
Example: token A
requires depositing tokens B1
and B2
in order to be minted.
Actually no, it should be possible to only have a root token and then arbitrary add children tokens to the tree as we go.
Let’s assume that A is the root of the tree with two children B and C. It should be possible to “rebuild” the tree by changing any of roots or children. This means that the pointers to children or parents have to be mutable.
That should be possible with the mutable addresses you just need to clarify the additional use in the note field of the asset configuration.