tangle-network / anon

A mixer for Substrate using multiple zero-knowledge backends.
Apache License 2.0
35 stars 9 forks source link

Design linking mechanism to link fixed/reward/variable trees together. #51

Open drewstone opened 3 years ago

drewstone commented 3 years ago

When people move between the various fixed and variable trees, we still want some way of linking them up, so that the underlying asset remains the same inside the trees linked together.

I should have a design for how we should link these together so that we ensure no mixing of asset types occurs.

lazovicff commented 3 years ago

Since the difference between these trees is just their leaves, we could use the same tree for fixed deposits, rewards, and variable deposits and expose different functions for each leaf type as:

  1. Proving to know a fixed amount leaf and inserting another variable amount leaf into the same tree
  2. Proving to know a variable amount leaf and adding another 2 variable amount leaves into the same tree (or combining 2 leaves into one) -- (can be any number, not just 2)
  3. Proving to know a variable amount leaf and withdrawing into some account