Handling multiple Algorand accounts that deals with internal transfer

Hi,

I’m building a functionality that involves having multiple addresses that transfers ASA.
The tricky issue I’m encountering involves (1) Minimum balance on account (2) ASA opt-in

  1. Having multiple addresses means that as the number of addresses grow, I would need an increasing amount of ALGO which doesn’t seem practical. This does not seem scalable imo which might mean it is a wrong design.
  2. Multiple address would also mean that ASA opt-in would be required for all addresses as it scale.

Plausible solution:
Instead of having multiple address, I’m skewing towards having just 2 addresses: (1) for storing ALGO to use as gas & (2) for handling ASA transfer.

This way i would only require 1 opt-in and min. balance would not incrementally increase. To differentiate transaction, I would use memo as the differentiator.

Each transaction would be an atomic transfer that uses ALGO from (1) and ASA transfer would be made from (2)

Wanted to get some opinions on what you guys think about this?

Cheers

Without knowing more details its a bit hard to comment. Your solution seems very plausible though.

You can cover for transactions fees using Pooled Fee, so that Account (1) backs every operation.

Asset Transfers form Account (2) is little more complicated: you can “transfer” an ASA while not being opted-in that ASA only if you act as Clawback Address for that ASA. This means that your dApp can act as “asset transfer proxy” if and only if the Application address is at the same time the Clawback Address of the ASA you want to transfer. Note that the Clawback Address pays for transactions’ fees in this case, so maybe you will not even need to use Pooled Fee in this case, but I’m not sure this “Clawback scenario” fits your use-case 100%.