I wanted to pop this back up to the top of the discussion queue as it was previously buried in a Psychedelic authored post. Especially with all the talk of canister based wallets this becomes important again. If we can derive alt principles for our canisters we can provide more privacy for canister based wallets in much the same way that II does this for user principles. The wallet dapp would be able to collate data from different services as untraceable different principals and do the collation for the user in the wallet dapp canister.
Our Proposal: Right now, subaccounts are being derived at the application level. We propose adding a protocol level mechanism for canisters to derive more IDs (with or without the need to deploy more canisters), similar to the way that new principals can be derived and managed by wallets with BIP44 & BIP32.
We propose this is done by allowing a canister to make inter-canister calls with different principal IDs. Let’s say canister A is making a call to canister B, when canister B runs ic::caller() on A, we could get different Principal IDs for canister A.
To do so we propose introducing a new IC system api called
ic0.call_set_derivation in the WASM runtime, which could be used by canister A, to indicate it wants to make the call to canister B using its different account. The api call will become a member of the already existing IC system api calls:
ic0.call_new : // U Ry Rt H ( callee_src : i32, callee_size : i32, name_src : i32, name_size : i32, reply_fun : i32, reply_env : i32, reject_fun : i32, reject_env : i32 ) -> (); ic0.call_on_cleanup : (fun : i32, env : i32) -> (); // U Ry Rt H ic0.call_data_append : (src : i32, size : i32) -> (); // U Ry Rt H ic0.call_cycles_add : (amount : i64) -> (); // U Ry Rt H ic0.call_cycles_add128 : (amount_high : i64, amount_low: i64) -> (); // U Ry Rt H ic0.call_perform : () -> ( err_code : i32 ); // U Ry Rt H
This would be easy for developers to understand from other ecosystems, leave us with only a single ID to deal with, clean up client side code, and be very useful for canister based wallets once we have tECDSA