MynaWallet AA Grant Progress Update #3
We’re excited to have you back for the 3rd episode of our MynaWallet weekly series! As always, this report is your window into our development journey, which is made possible through a grant from the Ethereum Foundation.
Our milestones for the third week have been:
- Completing the contract wallet prototype with revised architecture.
- Implementing gas-efficient RSA verification implementation and getting a benchmark.
- Deploying the factory contract for the contract wallet on the testnet.
- Testing the contract wallet.
- Continuing researching ERC-4337, especially the paymaster.
Our outcomes are:
- Results from the RSA benchmarking exercise.
- Deployment of both the contract wallet factory and the contract wallet on the testnet.
Let’s deep dive into the topic.
Results from the RSA benchmarking exercise
In our current implementation, we perform on-chain RSA 2048-bit signature verification, which is notably gas-intensive. Furthermore, operating under the ERC-4337 protocol adds additional overhead in terms of gas. We have been actively exploring alternatives and have tested multiple implementations to benchmark potential efficiencies. For RSA signature verification on-chain, we leveraged a library developed by adria0 and modified a part of the codes.
While we managed to reduce the gas costs by approximately 10,000 gas by utilizing the unchecked block in areas where overflow or underflow cannot occur (not audited yet!), it is not a fundamental resolution to the issue. We are continuously investigating further optimizations (including ZKP verification instead of directly verifying RSA signature on-chain) to address this critical aspect of our system.
Version | Result (gas) |
---|---|
original | 327863 |
modified | 316919 |
You can clone this branch and forge test command lets you know the gas cost for each implementation.
Deployment of both the contract wallet factory and the contract wallet on the testnet
- https://sepolia.etherscan.io/address/0x6056cb4af4cf0c08ff85fbbebd311ecaf8e2b68c#code
- https://sepolia.etherscan.io/address/0xd77b5ae240a8056e7242e58a544d3752f4663b6b#code
Looking ahead
As anticipated, verifying RSA signatures on-chain is gas-intensive. While this high gas cost might be negligible on Layer 2 solutions, where gas fees are relatively cheaper, it presents a significant challenge for use on Layer 1. Next week, we’ll explore using Zero-Knowledge Proofs (ZKPs) as a potential solution to this issue.
References
- https://github.com/MynaWallet/contracts
- https://eips.ethereum.org/EIPS/eip-4337
- https://github.com/adria0/SolRsaVerify
- https://docs.soliditylang.org/en/v0.8.21/
Contributors
About a42x Inc.
a42x Inc. is developing a wallet system and digital auth infrastructure. Main achievement: Selected as a finalist at ETHGlobal Tokyo, one of the world’s largest blockchain developer competitions.
Recruitment of Developers/Researchers
At a42x Inc., we reinforce hiring in a wide range of positions, including iOS & Android app engineers, backend engineers, researchers, and business development. We look forward to applications from those with a strong interest and curiosity in technology and craftsmanship and a passion for creating products used in the real world. For details, please get in touch with the email address below.
Contact
info@a42x.co.jp