Buuiillddd — eif_0.3_0.7
gm people of web3,
Welcome to the second to last report on building the Human Wallet Project at the ETHIndia Fellowship. This report covers the sixth and the seventh week of building, head-scratching, pointless optimisations, progress and dealing with painful bugs. Let’s get this party started.
The Local Validation
Week 6 started with fiddling with the account-abstraction repo to create custom runOps and deployment scripts. After a few config changes, adding the HumanWalletApi, and testing the contracts on the hardhat network week six ran out of time.
I did struggle a lot with making the UserOps work with the custom API since a few gas parameters for pre-verification were not accurate. But well. Hard-coded values are the best fix. So I fixed the VerificationGasLimit manually :P
Deployment Pain
In week seven I started to test the contracts on Goerli with the Infinitism bundler. Which was, if I put it ever so gently, like having a multi-organ failure. There were many config-related issues at first but those cleared out eventually. I tried Alchemy, Infura and Stackup nodes to run the bundlers. Alchemy and Infura have throttled the eth_getLogs method which crashes the Infinitism bundler after a UserOp has been submitted. So those attempts failed a couple of times. There were also issues with gas estimation which reverted many ops. All efforts that went into getting the Infinitism bundler were a bust.
Stackup bundler did not let ops through citing ‘Unauthorised Request’. Then I moved on to work with the Stackup example repository which fixed the auth issue (still figuring out why). Then I published a few packages (built on top of the Infinitism forks) for the wallet SDK and contracts. Imported these packages in the Stackup repository, create new scripts to support the HumanAccount implementation and voila!
Factory Revelations
The contracts, bundler and client were now working perfectly for deployed accounts/contracts. Attempts to transact with a fresh account and deploy it were reverted by the bundler. The HumanAccountFactory accesses the state while deploying a new account. See, bundlers are protected from DoS attacks. And one vector could be bad UserOps that access the state while deployment and keep the bundler busy. To get over this, the bundlers need such factories to stake some ETH with the EntryPoint contract.
So the next step was adding a few ownerOnly functions to the HumanAccountFactory which would deposit ETH, stake and unstake from the Entrypoint. This setup works smoothly and now I am happy to say that the contracts are good to go for the first iteration.
Client Needs
Just like human clients, the human-wallet client is also a very attention-hungry entity. Right after deploying a new set of contracts to Goerli, I have been working on the final onboarding steps like encrypting the device with a pin and persisting the wallet state. Next up is a quick build sprint for the home page of the wallet and the transfers UI.
Phew
So this was everything human-wallet from weeks six and seven. In other news, there was a delightful panel on Web3 Wallets last Friday where some very smart folks from 0xpass and the Ethereum Foundation talked about well, Web3 Wallets and account abstraction. EIF fellows who are building 4337 related projects also presented their ideas.
Shoutout to Banana Wallet SDK and Rugproof! Some great builds are just around the corner. 👀
Take care, folks!
Keep building and hydrating.