ic-siwe icon indicating copy to clipboard operation
ic-siwe copied to clipboard

Moving assets from siwe account

Open shah-aman opened this issue 3 months ago • 2 comments

SIWE Session ID Cannot Sign Update Functions for Persistent Principal Assets Issue Summary We are building a platform that provides persistent asset storage on the Internet Computer Protocol (ICP) for users authenticated via Sign-In with Ethereum (SIWE). While we can successfully create deterministic principals for users and execute query functions, update functions fail because the session ID cannot sign on behalf of the persistent principal ID that owns the stored assets. Expected Behavior

Users authenticate with SIWE and get a deterministic persistent principal Both query and update functions should work seamlessly with the persistent principal Assets stored under the persistent principal should be accessible and modifiable through update functions

we have deployed the base ic-swie canister here is the deployed mainnet link https://dashboard.internetcomputer.org/canister/nmepf-siaaa-aaaaj-qnsia-cai

Current Behavior Have also noticed that the session id is sometimes different than the persistent id

✅ SIWE authentication works and creates deterministic principals ✅ Query functions execute successfully on canisters ❌ Update functions fail because session ID cannot sign for the persistent principal ❌ Cannot modify assets stored under the persistent principal

shah-aman avatar Sep 17 '25 13:09 shah-aman

Hey, thanks for the report. In general, a delegate identity created by SIWE is just as much an identity as one created by Internet Identity. They use the same building blocks, the same libraries.

I'm not sure I fully understand the issue. Could you try to be more specific?

  • What is a "session ID"?
  • "the session ID cannot sign.." - sign what? Ethereum transactions, ICRC transactions?
  • What do you mean by "assets stored under the persistent principal"? Are we talking about icrc assets here?

I have a strong sense the issue is rather a misunderstanding as to how delegate identitties etc work. But, I am happy to figure this out together with you. Will be on vacation the coming week though.

kristoferlund avatar Sep 17 '25 18:09 kristoferlund

the issue i am facing is the identiry which is primary and holding assets is 3xsiy-atm24-ewttr-mflcp-22ptk-k2kap-mlard-lqihu-g4oxb-eeqgm-fae but the session is getting created ser6f-6lbxy-yk6ga-qgy4l-ojmyz-lvi6k-x3dgz-x254z-b32iu-euluo-tqe which is causing issue in signing the tx later

here is the console logs Ethereum wallet changed: {address: '0x4e8a6Eb77024169Bad60E3a7f10D6dd0089c5FCD', balance: '0.0', chainId: 1, isConnected: true, provider: BrowserProvider, …} icp-wallet.service.ts:121 Setting delegation identity, principal: 3xsiy-atm24-ewttr-mflcp-22ptk-k2kap-mlard-lqihu-g4oxb-eeqgm-fae actor.service.ts:37 ActorService: Identity set, principal: 3xsiy-atm24-ewttr-mflcp-22ptk-k2kap-mlard-lqihu-g4oxb-eeqgm-fae WalletContext.js:211 ICP wallet changed: {principal: '3xsiy-atm24-ewttr-mflcp-22ptk-k2kap-mlard-lqihu-g4oxb-eeqgm-fae', agent: HttpAgent, isConnected: true, walletType: 'siwe'} WalletContext.js:211 ICP wallet changed: {principal: '3xsiy-atm24-ewttr-mflcp-22ptk-k2kap-mlard-lqihu-g4oxb-eeqgm-fae', agent: HttpAgent, isConnected: true, walletType: 'siwe'} ethereum-wallet.service.ts:325 EthereumWalletService.connect: ICP DelegationIdentity set. Principal: ser6f-6lbxy-yk6ga-qgy4l-ojmyz-lvi6k-x3dgz-x254z-b32iu-euluo-tqe actor.service.ts:37 ActorService: Identity set, principal: 3xsiy-atm24-ewttr-mflcp-22ptk-k2kap-mlard-lqihu-g4oxb-eeqgm-fae ethereum-wallet.service.ts:332 ActorService identity set. Principal: ser6f-6lbxy-yk6ga-qgy4l-ojmyz-lvi6k-x3dgz-x254z-b32iu-euluo-tqe

shah-aman avatar Oct 14 '25 03:10 shah-aman