However, it’s not exactly the same use case.
I’m trying to decompose the “virtual canister” feature into smaller pieces. Breaking down the requirements:
we should have only one physical canister in this case
There will be one physical canister with two components: (1) main component, providing virtualization and controlling permissions (IC-aware language, like Rust or Motoko), and (2) library component, providing the functionality (any language compiling to Wasm).
The virtual canister should have its own ID and Candid IDL.
The number of canister IDs is limited per subnet. The virtual canister IDs seem like aliases of a single “physical” canister.
Different Candid IDLs probably also doable, but seems like a lot of work across different tools…
This virtual canister can have role-based permissions assigned to it.
The roles and permissions could be controlled by the main component.
Eventually, the virtual canister could have a time-to-live (TTL) expiration period
The canister ID alias might be created and deleted as needed by the main component.
All virtual canisters should share the same data space.
The main and library components will have their own memories, but they are shared across all virtual functions.
each Loan Provider will see only their loan data, and the filter attribute can be Provider Id
The main component controls access to the stable memory, so it can enforce that only a subset of data is returned from the stable memory.
Most of the requested functionality could likely be achieved with components and aliases. Seems our main point of contention is who controls permissions: the IC itself or the main component of a canister, right?