pos-portal icon indicating copy to clipboard operation
pos-portal copied to clipboard

Implement EIP-1271 isValidSignature to allow smart contract wallets to interact with Polygon PoS

Open skylarweaver opened this issue 2 years ago • 1 comments

Smart contract wallets (i.e., Argent, Dharma) are becoming ever more popular yet they do not possess private keys and therefore can not directly sign messages. This means that valid transactions from smart contract wallets are recognized as invalid by the current method Polygon PoS uses to determine whether a transaction is valid.

I'd like to suggest implementing the EIP-1271 isValidSignature method in addition to traditional verify method currently used which only works for EOAs. For example here:

https://github.com/maticnetwork/pos-portal/blob/dabb08ec28e236c2d2409663c82003fa3f431c9d/contracts/common/NativeMetaTransaction.sol#L87-L103 (There are also other places where verify is used, but I'm not familiar with the codebase enough to know where the change would need to take place)

Further exaggerating this issue IMHO, is that the current Polygon PoS functionality allows one to deposit funds from their smart contract wallet (i.e., Argent) successfully without issue nor warning, but once deposited, the funds remain locked due to the lack of implementation of EIP-1271. I know personally, because I just did this a few days ago to test out Polygon, and now those funds are locked on Polygon PoS with no way to withdraw nor send (Polygon support ticket #4393 open). I'm probably not the only one who has done this so far, and with growing usage of Polygon and smart contract wallets, I certainly won't be the last one to do this.

Another option would be to only allow for smart contract accounts to withdraw their funds back to mainnet L1 to their specific account. This may be an acceptable option if the complexity to implement EIP-1271 for all transaction types would be too high.

Thanks for your time. Feedback welcome!

Resources: https://eips.ethereum.org/EIPS/eip-1271 https://docs.walletconnect.org/smart-wallets https://docs.argent.xyz/wallet-connect-and-argent

skylarweaver avatar Aug 28 '21 14:08 skylarweaver

Hi @jdkanani @arthcp @itzmeanjan — could you all provide some feedback on the above issue I outlined? On what timeline would this be possible? Many thanks!! 😄

skylarweaver avatar Sep 14 '21 14:09 skylarweaver